You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
payment/app/Model/WithdrawApply.php

35 lines
925 B
PHP

<?php
declare(strict_types=1);
namespace App\Model;
class WithdrawApply extends Model
{
public const STATUS_PREPARE = 'PREPARE';
public const STATUS_APPLY_SUCCESS = 'APPLY_SUCCESS';
public const STATUS_APPLY_FAILED = 'APPLY_FAILED';
public const STATUS_REFUND = 'REFUND';
public const STATUS_PROCESS = 'PROCESS';
public const STATUS_SUCCESS = 'SUCCESS';
public const STATUS_FAILED = 'FAILED';
protected $table = 'withdraw_applies';
public function app()
{
return $this->belongsTo(App::class, 'app_id', 'app_id');
}
public static $shortStatusAndStatusMap = [
'0' => self::STATUS_PROCESS,
'1' => self::STATUS_SUCCESS,
'-1' => self::STATUS_FAILED,
'2' => self::STATUS_REFUND,
];
public static function getStatusByShortStatus($shortStatus)
{
return self::$shortStatusAndStatusMap[$shortStatus] ?: null;
}
}