From a250819d8777c043f120c3ac5bf46556b0f4168e Mon Sep 17 00:00:00 2001 From: wong <106998207@qq.com> Date: Fri, 16 Jan 2026 16:42:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CustomerServiceController.php | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/Server/application/chukebao/controller/CustomerServiceController.php b/Server/application/chukebao/controller/CustomerServiceController.php index d0eefb66..c6c7cd11 100644 --- a/Server/application/chukebao/controller/CustomerServiceController.php +++ b/Server/application/chukebao/controller/CustomerServiceController.php @@ -24,11 +24,17 @@ class CustomerServiceController extends BaseController $wechatAliveTime = time() - 86400 * 30; - $list = Db::table('s2_wechat_account') - ->whereIn('id',$accountIds) - ->where('wechatAliveTime','>',$wechatAliveTime) - ->order('id desc') - ->group('id') + $list = Db::table('s2_wechat_account')->alias('wa') + ->join(['s2_device' => 'd'],'wa.currentDeviceId = d.id','LEFT') + ->whereIn('wa.id',$accountIds) + ->where('wa.wechatAliveTime','>',$wechatAliveTime) + ->order('wa.id desc') + ->group('wa.id') + ->field([ + 'wa.*', + 'd.imei', + 'd.extra', + ]) ->select(); foreach ($list as $k=>&$v){ $v['createTime'] = !empty($v['createTime']) ? date('Y-m-d H:i:s',$v['createTime']) : ''; @@ -37,11 +43,16 @@ class CustomerServiceController extends BaseController $momentsSetting = Db::name('kf_moments_settings')->where(['userId' => $userId,'companyId' => $companyId,'wechatId' =>$v['id']])->find(); $v['momentsMax'] = !empty($momentsSetting['max']) ? $momentsSetting['max'] : 5; $v['momentsNum'] = !empty($momentsSetting['sendNum']) ? $momentsSetting['sendNum'] : 0; - + $v['deviceExtra'] = json_decode($v['extra'],true); + $v['deviceExtra']['imei'] = $v['imei']; + $v['deviceExtra']['memo'] = $v['deviceMemo']; unset( $v['accountUserName'], $v['accountRealName'], $v['accountNickname'], + $v['extra'], + $v['imei'], + $v['deviceMemo'], ); } unset($v);