Files
ProxyPanel/app/Models/PaymentCallback.php
兔姬桑 71828a0ac5 数据库改版 +Rule 编辑相关 (Rule未实际应用)
1. 规范化数据库数据;
2. 添加Rule相关页面
为未来加入web api做准备
2020-08-05 03:20:33 +08:00

56 lines
1.9 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
/**
* 支付回调日志
*
* @property int $id
* @property string|null $trade_no 本地订单号
* @property string|null $out_trade_no 外部订单号(支付平台)
* @property int|null $amount 交易金额,单位分
* @property int|null $status 交易状态0-失败、1-成功
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read mixed $status_label
* @method static Builder|PaymentCallback newModelQuery()
* @method static Builder|PaymentCallback newQuery()
* @method static Builder|PaymentCallback query()
* @method static Builder|PaymentCallback whereAmount($value)
* @method static Builder|PaymentCallback whereCreatedAt($value)
* @method static Builder|PaymentCallback whereId($value)
* @method static Builder|PaymentCallback whereOutTradeNo($value)
* @method static Builder|PaymentCallback whereStatus($value)
* @method static Builder|PaymentCallback whereTradeNo($value)
* @method static Builder|PaymentCallback whereUpdatedAt($value)
* @mixin \Eloquent
*/
class PaymentCallback extends Model {
protected $table = 'payment_callback';
protected $primaryKey = 'id';
protected $appends = ['status_label'];
function getStatusLabelAttribute() {
$status_label = '';
switch($this->attributes['status']){
case 'WAIT_BUYER_PAY':
$status_label = '等待买家付款';
break;
case 'WAIT_SELLER_SEND_GOODS':
$status_label = '等待卖家发货';
break;
case 'TRADE_SUCCESS':
$status_label = '交易成功';
break;
case 'PAID':
$status_label = '支付完成';
break;
}
return $status_label;
}
}