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.

30 lines
660 B

  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 $dateFormat = 'Y-m-d h:i:s';
  9. protected $appends = [
  10. 'state_text',
  11. 'check_time_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. }