You can not 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
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'; protected $appends = [ 'state_text', 'check_time_text', 'created_at_text', 'pay_type_text', 'real_cash_text' ];
public function getStateTextAttribute() { return Withdrawal::getMessage($this->attributes['state']); }
public function getCheckTimeTextAttribute() { if(empty($this->attributes['check_time'])){ return ''; }else { return date('Y-m-d H:i:s', $this->attributes['check_time']); } }
public function getCreatedAtTextAttribute() { return date('Y-m-d H:i:s', $this->attributes['created_at']); }
public function getPayTypeTextAttribute() { return '提现到'.WithdrawalType::getMessage($this->attributes['type']); }
public function getRealCashTextAttribute() { return '¥ '.WithdrawalType::getMessage($this->attributes['real_cash']); }}
|