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.

47 lines
1.1 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. <?php
  2. namespace App\Model\v3;
  3. use App\Model\Model;
  4. use App\Constants\v3\Withdrawal;
  5. use App\Constants\v3\WithdrawalType;
  6. class StoreWithdrawal extends Model
  7. {
  8. protected $table = 'lanzu_store_withdrawal';
  9. protected $appends = [
  10. 'state_text',
  11. 'check_time_text',
  12. 'created_at_text',
  13. 'pay_type_text',
  14. 'real_cash_text'
  15. ];
  16. public function getStateTextAttribute()
  17. {
  18. return Withdrawal::getMessage($this->attributes['state']);
  19. }
  20. public function getCheckTimeTextAttribute()
  21. {
  22. if(empty($this->attributes['check_time'])){
  23. return '';
  24. }else {
  25. return date('Y-m-d H:i:s', $this->attributes['check_time']);
  26. }
  27. }
  28. public function getCreatedAtTextAttribute()
  29. {
  30. return date('Y-m-d H:i:s', $this->attributes['created_at']);
  31. }
  32. public function getPayTypeTextAttribute()
  33. {
  34. return '提现到'.WithdrawalType::getMessage($this->attributes['type']);
  35. }
  36. public function getRealCashTextAttribute()
  37. {
  38. return '¥ '.WithdrawalType::getMessage($this->attributes['real_cash']);
  39. }
  40. }