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.

41 lines
980 B

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. ];
  15. public function getStateTextAttribute()
  16. {
  17. return Withdrawal::getMessage($this->attributes['state']);
  18. }
  19. public function getCheckTimeTextAttribute()
  20. {
  21. if(empty($this->attributes['check_time'])){
  22. return '';
  23. }else {
  24. return date('Y-m-d H:i:s', $this->attributes['check_time']);
  25. }
  26. }
  27. public function getCreatedAtTextAttribute()
  28. {
  29. return date('Y-m-d H:i:s', $this->attributes['created_at']);
  30. }
  31. public function getPayTypeTextAttribute()
  32. {
  33. return '提现到'.WithdrawalType::getMessage($this->attributes['type']);
  34. }
  35. }