From 2c90f6f33ce08c8c61fd99910cc7d3d51254ce0b Mon Sep 17 00:00:00 2001 From: wong <106998207@qq.com> Date: Mon, 29 Dec 2025 15:01:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=BA=E6=99=AF=E8=8E=B7=E5=AE=A2=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=AD=90=E8=B4=A6=E5=8F=B7=E5=8F=AA=E8=83=BD=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E8=87=AA=E5=B7=B1=E7=9A=84=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plan/GetPlanSceneListV1Controller.php | 16 ++++++++++++---- .../controller/plan/PlanSceneV1Controller.php | 4 ++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Server/application/cunkebao/controller/plan/GetPlanSceneListV1Controller.php b/Server/application/cunkebao/controller/plan/GetPlanSceneListV1Controller.php index cc8c6fbe..887bfee2 100644 --- a/Server/application/cunkebao/controller/plan/GetPlanSceneListV1Controller.php +++ b/Server/application/cunkebao/controller/plan/GetPlanSceneListV1Controller.php @@ -34,7 +34,6 @@ class GetPlanSceneListV1Controller extends BaseController $where[] = ['scenarioTags', 'like', '%' . $params['tag'] . '%']; } - // 查询数据 $query = PlansSceneModel::where($where); @@ -193,10 +192,19 @@ class GetPlanSceneListV1Controller extends BaseController return []; } + + $where = [ + ['companyId', '=', $companyId], + ['deleteTime', '=', 0], + ['sceneId', 'in', $sceneIds], + ]; + if(!$this->getUserInfo('isAdmin')){ + $where[] = ['userId', '=', $this->getUserInfo('id')]; + } + + $rows = Db::name('customer_acquisition_task') - ->whereIn('sceneId', $sceneIds) - ->where('companyId', $companyId) - ->where('deleteTime', 0) + ->where($where) ->field('sceneId, COUNT(*) as total') ->group('sceneId') ->select(); diff --git a/Server/application/cunkebao/controller/plan/PlanSceneV1Controller.php b/Server/application/cunkebao/controller/plan/PlanSceneV1Controller.php index cbba59fa..3812e565 100644 --- a/Server/application/cunkebao/controller/plan/PlanSceneV1Controller.php +++ b/Server/application/cunkebao/controller/plan/PlanSceneV1Controller.php @@ -30,7 +30,7 @@ class PlanSceneV1Controller extends BaseController 'companyId' => $this->getUserInfo('companyId'), ]; - if($this->getUserInfo('isAdmin')){ + if(!$this->getUserInfo('isAdmin')){ $where['userId'] = $this->getUserInfo('id'); } @@ -176,7 +176,7 @@ class PlanSceneV1Controller extends BaseController } // 如果是管理员,需要验证用户权限 - if ($this->getUserInfo('isAdmin')) { + if (!$this->getUserInfo('isAdmin')) { $userPlan = Db::name('customer_acquisition_task') ->where([ 'id' => $planId,