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.

28 lines
620 B

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. ];
  12. public function getStateTextAttribute()
  13. {
  14. return Withdrawal::getMessage($this->attributes['state']);
  15. }
  16. public function getCheckTimeTextAttribute()
  17. {
  18. if(empty($this->attributes['check_time'])){
  19. return '';
  20. }else {
  21. return date('Y-m-d H:i:s', $this->attributes['check_time']);
  22. }
  23. }
  24. }