Browse Source

提现明细

master
Lemon 5 years ago
parent
commit
cbdf18b1a9
  1. 33
      app/Constants/v3/WithdrawalType.php
  2. 9
      app/Model/v3/StoreWithdrawal.php

33
app/Constants/v3/WithdrawalType.php

@ -0,0 +1,33 @@
<?php
namespace App\Constants\v3;
use Hyperf\Constants\AbstractConstants;
use Hyperf\Constants\Annotation\Constants;
/**
* @Constants
*/
class WithdrawalType extends AbstractConstants
{
/**
* @Message("微信")
*/
const WECHAT = 1;
/**
* @Message("余额")
*/
const BALANCE = 2;
/**
* @Message("银行")
*/
const BANK = 3;
/**
* @Message("支付宝")
*/
const ALIPAY = 4;
}

9
app/Model/v3/StoreWithdrawal.php

@ -4,6 +4,7 @@ namespace App\Model\v3;
use App\Model\Model;
use App\Constants\v3\Withdrawal;
use App\Constants\v3\WithdrawalType;
class StoreWithdrawal extends Model
{
protected $table = 'lanzu_store_withdrawal';
@ -11,7 +12,8 @@ class StoreWithdrawal extends Model
protected $appends = [
'state_text',
'check_time_text',
'created_at_text'
'created_at_text',
'pay_type_text'
];
public function getStateTextAttribute()
@ -32,4 +34,9 @@ class StoreWithdrawal extends Model
{
return date('Y-m-d H:i:s', $this->attributes['created_at']);
}
public function getPayTypeTextAttribute()
{
return '提现到'.WithdrawalType::getMessage($this->attributes['type']);
}
}
Loading…
Cancel
Save