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.

34 lines
777 B

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. class StoreWithdrawal extends Model
  6. {
  7. protected $table = 'lanzu_store_withdrawal';
  8. protected $appends = [
  9. 'state_text',
  10. 'check_time_text',
  11. 'created_at_text'
  12. ];
  13. public function getStateTextAttribute()
  14. {
  15. return Withdrawal::getMessage($this->attributes['state']);
  16. }
  17. public function getCheckTimeTextAttribute()
  18. {
  19. if(empty($this->attributes['check_time'])){
  20. return '';
  21. }else {
  22. return date('Y-m-d H:i:s', $this->attributes['check_time']);
  23. }
  24. }
  25. public function getCreatedAtTextAttribute()
  26. {
  27. return date('Y-m-d H:i:s', $this->attributes['created_at']);
  28. }
  29. }