From d78ff1e37618768d5dd315671b11a03fd1565b0e Mon Sep 17 00:00:00 2001 From: wong <106998207@qq.com> Date: Mon, 28 Jul 2025 17:41:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E6=97=A0=E5=85=B3=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cunkebao/controller/TrafficController.php | 121 ------------------ 1 file changed, 121 deletions(-) delete mode 100644 Server/application/cunkebao/controller/TrafficController.php diff --git a/Server/application/cunkebao/controller/TrafficController.php b/Server/application/cunkebao/controller/TrafficController.php deleted file mode 100644 index c00154de..00000000 --- a/Server/application/cunkebao/controller/TrafficController.php +++ /dev/null @@ -1,121 +0,0 @@ -request->param('page',1); - $pageSize = $this->request->param('pageSize',10); - $device = $this->request->param('device',''); - $packageId = $this->request->param('packageId',''); // 流量池id - $userValue = $this->request->param('userValue',''); // 1高价值客户 2中价值客户 3低价值客户 - $addStatus = $this->request->param('addStatus',''); // 1待添加 2已添加 3添加失败 4重复用户 - $keyword = $this->request->param('keyword',''); - - $companyId = $this->request->userInfo['companyId']; - - // 1 文字 3图片 47动态图片 34语言 43视频 42名片 40/20链接 49文件 419430449转账 436207665红包 - - $where = []; - - // 添加筛选条件 - if (!empty($device)) { - $where['d.id'] = $device; - } - - if (!empty($packageId)) { - $where['tp.id'] = $packageId; - } - - if (!empty($userValue)) { - $where['tp.userValue'] = $userValue; - } - - if (!empty($addStatus)) { - $where['tp.addStatus'] = $addStatus; - } - - - // 构建查询 - 通过traffic_pool的identifier关联wechat_account的wechatId、alias或phone - $query = Db::name('traffic_pool')->alias('tp') - ->join('wechat_account wa', 'wa.wechatId = tp.wechatId', 'LEFT') - ->field('tp.id, tp.identifier,tp.createTime, tp.updateTime, - wa.wechatId, wa.alias, wa.phone, wa.nickname, wa.avatar') - ->where($where); - - // 关键词搜索 - 支持通过wechat_friendship的identifier关联wechat_account的wechatId、alias或phone - if (!empty($keyword)) { - $query->where(function($q) use ($keyword) { - $q->where('tp.identifier', 'like', '%' . $keyword . '%') - ->whereOr('wa.wechatId', 'like', '%' . $keyword . '%') - ->whereOr('wa.alias', 'like', '%' . $keyword . '%') - ->whereOr('wa.phone', 'like', '%' . $keyword . '%') - ->whereOr('wa.nickname', 'like', '%' . $keyword . '%'); - }); - } - - // 获取总数 - $total = $query->count(); - - - // 分页查询 - $list = $query->order('tp.createTime desc') - ->group('tp.identifier') - ->order('tp.id desc') - ->page($page, $pageSize) - ->select(); - - - - return json([ - 'code' => 200, - 'msg' => '获取成功', - 'data' => [ - 'list' => $list, - 'total' => $total, - ] - ]); - } - - - /** - * 用户旅程 - * @return false|string - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\ModelNotFoundException - * @throws \think\exception\DbException - */ - public function getUserJourney() - { - $page = $this->request->param('page',1); - $pageSize = $this->request->param('pageSize',10); - $userId = $this->request->param('userId',''); - if(empty($userId)){ - return json_encode(['code' => 500, 'msg' => '用户id不能为空']); - } - - $query = Db::name('user_portrait') - ->field('id,type,trafficPoolId,remark,count,createTime,updateTime') - ->where(['trafficPoolId' => $userId]); - - $total = $query->count(); - - $list = $query->order('createTime desc') - ->page($page,$pageSize) - ->select(); - - - foreach ($list as $k=>$v){ - $list[$k]['createTime'] = date('Y-m-d H:i:s',$v['createTime']); - $list[$k]['updateTime'] = date('Y-m-d H:i:s',$v['updateTime']); - } - return json_encode(['code' => 200,'data'=>['list' => $list,'total'=>$total],'获取成功']); - } - - -} \ No newline at end of file