ConfigCityManagement.php 858 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\SoftDeletes;
  4. class ConfigCityManagement extends BaseModel
  5. {
  6. use SoftDeletes;
  7. protected $dates = ['deleted_at'];
  8. protected $table = 'config_city_management';
  9. /**
  10. * 可被批量赋值的字段
  11. * @var array
  12. */
  13. protected $fillable = ['province_id','city_id','province_name','city_name','express_type'];
  14. /**
  15. *
  16. * 快递方式:0.快递;1. 自提
  17. *
  18. * @return string
  19. */
  20. public function getExpressTypeAttribute()
  21. {
  22. $express_type = '';
  23. switch ($this->express_type) {
  24. case 0:
  25. $express_type = '快递';
  26. break;
  27. case 1:
  28. $express_type = '自提';
  29. break;
  30. default:
  31. }
  32. return $express_type;
  33. }
  34. }