小程序接口
This commit is contained in:
@@ -26,6 +26,32 @@ class BillModel extends Model
|
||||
self::STATUS_PAID => '已支付',
|
||||
];
|
||||
|
||||
/** 支付进度(小程序端):待支付(可发起合并付款) */
|
||||
public const int PAY_STATE_UNPAID = 0;
|
||||
/** 支付进度:审核中(已提交合并付款凭证,待后台审核;审核拒绝后释放回待支付) */
|
||||
public const int PAY_STATE_REVIEWING = 1;
|
||||
/** 支付进度:已支付 */
|
||||
public const int PAY_STATE_PAID = 2;
|
||||
|
||||
/** 支付进度中文名 */
|
||||
public const array PAY_STATE_NAMES = [
|
||||
self::PAY_STATE_UNPAID => '待支付',
|
||||
self::PAY_STATE_REVIEWING => '审核中',
|
||||
self::PAY_STATE_PAID => '已支付',
|
||||
];
|
||||
|
||||
/**
|
||||
* 支付进度推导:已支付 > 审核中(payment_id 锁定中)> 待支付
|
||||
* (支付审核拒绝后 payment_id 释放为 0,回到待支付;线下收款直接置已支付)
|
||||
*/
|
||||
public function payState(): int
|
||||
{
|
||||
if ($this->status === self::STATUS_PAID) {
|
||||
return self::PAY_STATE_PAID;
|
||||
}
|
||||
return $this->payment_id > 0 ? self::PAY_STATE_REVIEWING : self::PAY_STATE_UNPAID;
|
||||
}
|
||||
|
||||
protected $table = 'bill';
|
||||
protected $primaryKey = 'id';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user