select(); return app_show(0,"获取成功",$list); } public function area(){ $post=$this->request->post(); $city_code = isset($post['code'])&& $post['code']!="" ? $post['code']:""; if($city_code==""){ return error_show(1002,"市级未选择"); } $city =Db::name("city")->where(['city_code'=>$city_code])->find(); if(empty($city)){ return error_show(1003,"参数code非法数据"); } $list=Db::name("area")->where(['city_code'=>$city_code])->select(); return app_show(0,"获取成功",$list); } public function city(){ $post=$this->request->post(); $province_code = isset($post['code'])&& $post['code']!="" ? $post['code']:""; if($province_code==""){ return error_show(1002,"省级未选择"); } $provice = Db::name("province")->where(['province_code'=>$province_code])->find(); if(empty($provice)){ return error_show(1003,"参数code非法数据"); } $list=Db::name("city")->where(['province_code'=>$province_code])->select(); return app_show(0,"获取成功",$list); } }