|
|
@@ -3800,4 +3800,24 @@ class WebService implements WebServiceInterface
|
|
|
];
|
|
|
return Result::success($result);
|
|
|
}
|
|
|
+ /**
|
|
|
+ * @param array $data
|
|
|
+ * @return array
|
|
|
+ */
|
|
|
+ /**
|
|
|
+ * 获取省份城市列表
|
|
|
+ * @param array $data
|
|
|
+ * @return array
|
|
|
+ */
|
|
|
+ public function getWebsiteProvinceCity(array $data): array
|
|
|
+ {
|
|
|
+ $province_city = District::whereIn('level', [1,2])
|
|
|
+ ->select('id', 'name', 'pid', 'abbreviation')
|
|
|
+ ->get()->all();
|
|
|
+ if (empty($province_city)) {
|
|
|
+ return Result::error("暂无相关省份城市信息", 0);
|
|
|
+ }
|
|
|
+ $result = Result::buildCityTree($province_city);
|
|
|
+ return Result::success($result);
|
|
|
+ }
|
|
|
}
|