From 7a2553940c4fc07c6f7eee5b1d1e6e069587dc90 Mon Sep 17 00:00:00 2001 From: wong <106998207@qq.com> Date: Wed, 6 Aug 2025 18:00:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...PotentialListWithInCompanyV1Controller.php | 36 +++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/Server/application/cunkebao/controller/traffic/GetPotentialListWithInCompanyV1Controller.php b/Server/application/cunkebao/controller/traffic/GetPotentialListWithInCompanyV1Controller.php index 9a68d3c7..ec35f503 100644 --- a/Server/application/cunkebao/controller/traffic/GetPotentialListWithInCompanyV1Controller.php +++ b/Server/application/cunkebao/controller/traffic/GetPotentialListWithInCompanyV1Controller.php @@ -270,7 +270,7 @@ class GetPotentialListWithInCompanyV1Controller extends BaseController $percentage = number_format(($taskNum / $passNum) * 100, 2); $total['percentage'] = $percentage; } - + $data['total'] = $total; @@ -322,14 +322,20 @@ class GetPotentialListWithInCompanyV1Controller extends BaseController public function getUserTags() { $userId = $this->request->param('userId', ''); + $companyId = $this->getUserInfo('companyId'); if (empty($userId)) { return json_encode(['code' => 500, 'msg' => '用户id不能为空']); } $data = Db::name('traffic_pool')->alias('tp') - ->join(['s2_wechat_friend' => 'wf'], 'tp.wechatId=wf.wechatId', 'left') + ->join('wechat_friendship f', 'tp.wechatId=f.wechatId AND f.companyId='.$companyId, 'left') + ->join(['s2_wechat_friend' => 'wf'], 'f.wechatId=wf.wechatId', 'left') ->where(['tp.id' => $userId]) ->order('tp.createTime desc') ->column('wf.id,wf.labels,wf.siteLabels'); + if (empty($data)) { + return ResponseHelper::success(['wechat' => [], 'siteLabels' => []]); + } + $tags = []; $siteLabels = []; @@ -350,5 +356,31 @@ class GetPotentialListWithInCompanyV1Controller extends BaseController return ResponseHelper::success(['wechat' => $tags, 'siteLabels' => $siteLabels]); } + /* public function editUserTags() + { + $userId = $this->request->param('userId', ''); + if (empty($userId)) { + return json_encode(['code' => 500, 'msg' => '用户id不能为空']); + } + $tags = $this->request->param('tags', []); + $tags = $this->request->param('tags', []); + $isWechat = $this->request->param('isWechat', false); + $companyId = $this->getUserInfo('companyId'); + + $friend = Db::name('traffic_pool')->alias('tp') + ->join('wechat_friendship f', 'tp.wechatId=f.wechatId AND f.companyId='.$companyId, 'left') + ->join(['s2_wechat_friend' => 'wf'], 'f.wechatId=wf.wechatId', 'left') + ->where(['tp.id' => $userId]) + ->order('tp.createTime desc') + ->column('wf.id,wf.accountId,wf.labels,wf.siteLabels'); + if (empty($data)) { + return ResponseHelper::error('该用户不存在'); + } + + + }*/ + + + } \ No newline at end of file