CityModel.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace App\Models\Common;
  3. use App\Models\Model;
  4. /**
  5. * App\Models\Common\CityModel
  6. *
  7. * @property int $id
  8. * @property string $province 省份
  9. * @property string $city 城市
  10. * @property string $province_name 省份全称
  11. * @property string $city_name 城市全称
  12. * @property int $sort
  13. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Common\CityModel newModelQuery()
  14. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Common\CityModel newQuery()
  15. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Common\CityModel query()
  16. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Common\CityModel whereCity($value)
  17. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Common\CityModel whereCityName($value)
  18. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Common\CityModel whereId($value)
  19. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Common\CityModel whereProvince($value)
  20. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Common\CityModel whereProvinceName($value)
  21. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Common\CityModel whereSort($value)
  22. * @mixin \Eloquent
  23. */
  24. class CityModel extends Model
  25. {
  26. protected $table = "fpdx_citys";
  27. protected $appends = ['full_name'];
  28. /**
  29. * 获取城市全称
  30. * @return string
  31. */
  32. public function getFullNameAttribute()
  33. {
  34. return "{$this->province}-{$this->city}";
  35. }
  36. }