15669368801 4 anos atrás
pai
commit
a7afc663d6

+ 3 - 2
app/api/controller/company/SectionController.php → app/api/controller/section/SectionController.php

@@ -1,9 +1,10 @@
 <?php
 
-namespace app\api\controller\company;
+namespace app\api\controller\section;
 
-use app\models\section\section;
+use app\models\section\SectionModel;
 use app\Request;
+use crmeb\services\UtilService;
 
 class SectionController
 {

+ 2 - 3
app/api/route/route.php

@@ -29,9 +29,6 @@ Route::group(function () {
     Route::get('wechat/bindPush', 'wechat.WechatController/bindPush')->name('bindPush');//公众号绑定推送
     Route::post('wechat/UserInfo', 'wechat.WechatController/addUserInfo')->name('addUserInfo');//用户信息入库
     Route::get('wechat/reportList', 'wechat.WechatController/getReportList')->name('getReportList');//统计报表列表
-
-//公司信息
-    Route::get('section/list', 'company.SectionController/list')->name('getSectionList');//部门列表
 })->middleware(\app\http\middleware\AllowOriginMiddleware::class);
 
 Route::any('wechat/serve', 'wechat.WechatController/serve');//公众号服务
@@ -274,6 +271,8 @@ Route::group(function () {
     Route::get('pink', 'PublicController/pink')->name('pinkData');
     //用户访问
     Route::post('user/set_visit', 'user.UserController/set_visit')->name('setVisit');// 添加用户访问记录
+    //部门信息
+    Route::get('section/list', 'section.SectionController/list')->name('sectionList');//部门列表
 
 })->middleware(\app\http\middleware\AllowOriginMiddleware::class)->middleware(\app\api\middleware\AppAuthorizeMiddleware::class)->middleware(\app\api\middleware\AuthTokenMiddleware::class, false);
 

+ 3 - 3
app/models/company/CompanyModel.php

@@ -25,8 +25,8 @@ class CompanyModel extends BaseModel
     public static function systemPage($where)
     {
         $model = new self;
-        if ($where['title'] !== '') $model = $model->where('title', 'LIKE', "%$where[title]%");
-        if ($where['sid'] !== '') $model = $model->where('sid', $where['sid']);
+        if (isset($where['title']) && $where['title'] !== '') $model = $model->where('title', 'LIKE', "%$where[title]%");
+        if (isset($where['sid']) && $where['sid'] !== '') $model = $model->where('sid', $where['sid']);
         $model = $model->where('is_del', 0);
         $model = $model->order('sort desc,id desc');
         $count = $model->count();
@@ -45,7 +45,7 @@ class CompanyModel extends BaseModel
         if ($info) {
             $info['example'] = ExampleModel::where(['cid' => $id])->order('sort desc, id asc')->select();
             $info['designer'] = DesignerModel::where(['cid' => $id])->order('sort desc, id asc')->select();
-            if ($info['slider_image'])
+            if (isset($info['slider_image']) && $info['slider_image'])
                 $info['slider_image'] = json_decode($info['slider_image'], true);
             else
                 $info['slider_image'] = [];

+ 2 - 2
app/models/section/SectionModel.php

@@ -25,8 +25,8 @@ class SectionModel extends BaseModel
     public static function systemPage($where)
     {
         $model = new self;
-        if ($where['title'] !== '') $model = $model->where('title', 'LIKE', "%$where[title]%");
-        if ($where['status'] !== '') $model = $model->where('status', $where['status']);
+        if (isset($where['title']) && $where['title'] !== '') $model = $model->where('title', 'LIKE', "%$where[title]%");
+        if (isset($where['status']) && $where['status'] !== '') $model = $model->where('status', $where['status']);
         $model = $model->where('is_del', 0);
         $model = $model->order('sort desc,id desc');
         $count = $model->count();