流量池添加及场景获客统计数据
This commit is contained in:
@@ -4,6 +4,7 @@ namespace app\cunkebao\controller\plan;
|
||||
|
||||
use app\common\model\Device as DeviceModel;
|
||||
use app\common\model\DeviceWechatLogin as DeviceWechatLoginModel;
|
||||
use app\common\model\WechatCustomer as WechatCustomerModel;
|
||||
use library\ResponseHelper;
|
||||
use think\Controller;
|
||||
use think\Db;
|
||||
@@ -143,13 +144,18 @@ class GetAddFriendPlanDetailV1Controller extends Controller
|
||||
->field([
|
||||
'd.id', 'd.imei', 'd.memo', 'd.alive',
|
||||
'l.wechatId',
|
||||
'a.nickname', 'a.alias', '0 totalFriend'
|
||||
'a.nickname', 'a.alias', '0 totalFriend', '0 totalFriend'
|
||||
])
|
||||
->leftJoin('device_wechat_login l', 'd.id = l.deviceId and l.alive =' . DeviceWechatLoginModel::ALIVE_WECHAT_ACTIVE . ' and l.companyId = d.companyId')
|
||||
->leftJoin('wechat_account a', 'l.wechatId = a.wechatId')
|
||||
->order('d.id desc')
|
||||
->whereIn('d.id',$reqConf['deveiceGroups'])
|
||||
->select();
|
||||
foreach ($deveiceGroupsOptions as &$device) {
|
||||
$curstomer = WechatCustomerModel::field('friendShip')->where(['wechatId' => $device['wechatId']])->find();
|
||||
$device['totalFriend'] = $curstomer->friendShip->totalFriend ?? 0;
|
||||
}
|
||||
unset($device);
|
||||
$reqConf['deveiceGroupsOptions'] = $deveiceGroupsOptions;
|
||||
}else{
|
||||
$reqConf['deveiceGroupsOptions'] = [];
|
||||
|
||||
Reference in New Issue
Block a user