私域操盘手 - 设备详情中获取设备绑定微信的消息总数添加TODO

This commit is contained in:
柳清爽
2025-05-09 14:19:55 +08:00
parent 4ab353c198
commit 1eecc85551

View File

@@ -66,16 +66,13 @@ class GetDeviceDetailV1Controller extends BaseController
*/ */
protected function getTaskConfig(int $deviceId): array protected function getTaskConfig(int $deviceId): array
{ {
$where = [ $companyId = $this->getUserInfo('companyId');
'deviceId' => $deviceId,
'companyId' => $this->getUserInfo('companyId'),
];
$conf = DeviceTaskconfModel::alias('c') $conf = DeviceTaskconfModel::alias('c')
->field([ ->field([
'c.autoAddFriend', 'c.autoReply', 'c.momentsSync', 'c.aiChat' 'c.autoAddFriend', 'c.autoReply', 'c.momentsSync', 'c.aiChat'
]) ])
->where($where) ->where(compact('companyId', 'deviceId'))
->find(); ->find();
if (!is_null($conf)) { if (!is_null($conf)) {
@@ -95,12 +92,9 @@ class GetDeviceDetailV1Controller extends BaseController
*/ */
protected function getTotalFriend(int $deviceId): int protected function getTotalFriend(int $deviceId): int
{ {
$where = [ $companyId = $this->getUserInfo('companyId');
'deviceId' => $deviceId,
'companyId' => $this->getUserInfo('companyId'),
];
$ownerWechatId = DeviceWechatLogin::where($where)->order('createTime desc')->value('wechatId'); $ownerWechatId = DeviceWechatLogin::where(compact('companyId', 'deviceId'))->order('createTime desc')->value('wechatId');
if ($ownerWechatId) { if ($ownerWechatId) {
return WechatFriend::where(['ownerWechatId' => $ownerWechatId])->count(); return WechatFriend::where(['ownerWechatId' => $ownerWechatId])->count();
@@ -110,7 +104,7 @@ class GetDeviceDetailV1Controller extends BaseController
} }
/** /**
* 获取设备绑定微信的消息总数 * TODO 获取设备绑定微信的消息总数
* *
* @return int * @return int
*/ */