request->param()); $i++) { if ($obj = $this->request->param($i)) { $code = $obj["code"]; $dict = \app\common\model\Dict::where("code", $code)->findOrEmpty()->toArray(); $childs = \app\common\model\Dict::where("pid", $dict["id"])->order("num")->select(); $result[$obj["name"]] = $childs; } } return json(["code" => "200", "msg" => "", "obj" => $result]); } public function findCommonFileType() { } public function getProvinceSelect() { $where = []; $where[] = ["code", "like", "%0000"]; return json(Db::table("un_common_location")->where($where)->select()->toArray()); } public function findCityByProvinceSelect() { $code = $this->request->param("code"); $province_prefix = substr($code, 0, 2); return json(Db::table("un_common_location")->where("code", "like", $province_prefix . "%00")->select()->toArray()); } public function findCountyByCitySelect() { $code = $this->request->param("code"); $city_prefix = substr($code, 0, 4); return json(Db::table("un_common_location")->where("code", "like", $city_prefix . "%")->select()->toArray()); } }