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/Order.php

34 lines
804 B
PHTML

2 years ago
<?php
declare(strict_types=1);
namespace App\Model;
class Order extends Model
{
public const STATUS_PREPARE = 1;
public const STATUS_WAIT_PAY = 2;
2 years ago
public const STATUS_APPLY_FAIL = 3;
2 years ago
public const STATUS_PAYED = 6;
public const STATUS_FAILED = 9;
protected $table = 'orders';
2 years ago
2 years ago
protected $casts = [
'org_split_info_list' => 'array',
];
2 years ago
public function getStatusText() {
$statusMap = [
self::STATUS_APPLY_FAIL => '申请失败',
self::STATUS_WAIT_PAY => '待支付',
self::STATUS_PAYED => '支付成功',
self::STATUS_FAILED => '支付失败',
];
return $statusMap[$this->status];
}
2 years ago
public function getExpiresIn() {
return strtotime($this->expired_at) - time();
}
2 years ago
}