CityServer.php 467 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace app\api\server\user;
  3. use app\admin\model\YxCity;
  4. class CityServer
  5. {
  6. /**
  7. * Notes:省市区获取
  8. * @return array
  9. * User: 齐景峰
  10. * Date: 2022/9/23
  11. */
  12. public static function getCityList($city_id)
  13. {
  14. if($city_id == 0){
  15. $where['city_level'] = 1;
  16. }else{
  17. $where['city_parent_id'] = $city_id;
  18. }
  19. $res = YxCity::where($where)->get();
  20. return $res;
  21. }
  22. }