Przeglądaj źródła

Merge branch 'v5.0.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v5.0.0dev

liaofei 2 lat temu
rodzic
commit
691cf845aa

+ 12 - 0
crmeb/app/adminapi/controller/v1/setting/SystemCity.php

@@ -140,4 +140,16 @@ class SystemCity extends AuthController
             return app('json')->fail(400186);
         }
     }
+
+    /**
+     * 获取城市数据完整列表
+     * @return \think\Response
+     * @author 吴汐
+     * @email 442384644@qq.com
+     * @date 2023/04/10
+     */
+    public function fullList()
+    {
+        return app('json')->success($this->services->fullList());
+    }
 }

+ 2 - 0
crmeb/app/adminapi/route/setting.php

@@ -77,6 +77,8 @@ Route::group('setting', function () {
     Route::put('group_data/set_status/:id/:status', 'v1.setting.SystemGroupData/set_status')->option(['real_name' => '修改组合数据状态']);
     //数据配置保存
     Route::post('group_data/save_all', 'v1.setting.SystemGroupData/saveAll')->option(['real_name' => '提交数据配置']);
+    //获取城市数据完整列表
+    Route::get('city/full_list', 'v1.setting.SystemCity/fullList')->option(['real_name' => '获取城市数据完整列表']);
     //获取城市数据列表
     Route::get('city/list/:parent_id', 'v1.setting.SystemCity/index')->option(['real_name' => '获取城市数据列表']);
     //添加城市数据表单

+ 12 - 1
crmeb/app/dao/shipping/SystemCityDao.php

@@ -39,7 +39,7 @@ class SystemCityDao extends BaseDao
      * @throws \think\db\exception\DbException
      * @throws \think\db\exception\ModelNotFoundException
      */
-    public function getCityList(array $where,string $field = '*')
+    public function getCityList(array $where, string $field = '*')
     {
         return $this->search($where)->field($field)->select()->toArray();
     }
@@ -87,4 +87,15 @@ class SystemCityDao extends BaseDao
     {
         return $this->getModel()->with('children')->where('parent_id', 0)->order('id asc')->select()->toArray();
     }
+
+    /**
+     * 获取城市数据完整列表
+     * @author 吴汐
+     * @email 442384644@qq.com
+     * @date 2023/04/10
+     */
+    public function fullList($field = '*')
+    {
+        return $this->getModel()->with('children')->order('id asc')->field($field)->select()->toArray();
+    }
 }

+ 1 - 0
crmeb/app/services/shipping/SystemCityServices.php

@@ -28,6 +28,7 @@ use crmeb\services\FormBuilder as Form;
  * @method update($id, array $data, ?string $key = null) 修改数据
  * @method value(array $where, ?string $field = '') 获取一条数据
  * @method getShippingCity() 获取运费模板城市数据
+ * @method fullList(?$field = '') 获取城市数据完整列表
  */
 class SystemCityServices extends BaseServices
 {