ConfigCityManagement.php 750 B

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