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.
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace App\Model;
|
|
|
|
|
|
|
|
class Order extends Model
|
|
|
|
{
|
|
|
|
public const STATUS_PREPARE = 'PREPARE';
|
|
|
|
public const STATUS_APPLY_SUCCESS = 'APPLY_SUCCESS';
|
|
|
|
public const STATUS_APPLY_FAILED = 'APPLY_FAILED';
|
|
|
|
public const STATUS_INIT = 'INIT';
|
|
|
|
public const STATUS_PROCESS = 'PROCESS';
|
|
|
|
public const STATUS_SUCCESS = 'SUCCESS';
|
|
|
|
public const STATUS_FAILED = 'FAILED';
|
|
|
|
|
|
|
|
protected $table = 'orders';
|
|
|
|
|
|
|
|
protected $casts = [
|
|
|
|
'org_split_info_list' => 'array',
|
|
|
|
];
|
|
|
|
|
|
|
|
public function getExpiresIn() {
|
|
|
|
return strtotime($this->expired_at) - time();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function orderSplitInfos()
|
|
|
|
{
|
|
|
|
return $this->hasMany(OrderSplitInfo::class, 'order_no', 'order_no');
|
|
|
|
}
|
|
|
|
}
|