新版流量池提交
This commit is contained in:
@@ -25,8 +25,8 @@ class TrafficController extends BaseController
|
||||
$keyword = $this->request->param('keyword', '');
|
||||
|
||||
$companyId = $this->getUserInfo('companyId');
|
||||
$package = Db::name('traffic_source_package')->alias('tsp')
|
||||
->join('traffic_source_package_item tspi', 'tspi.packageId=tsp.id', 'left')
|
||||
$package = Db::name('traffic_source_package_v1')->alias('tsp')
|
||||
->join('traffic_source_package_item_v1 tspi', 'tspi.packageId=tsp.id', 'left')
|
||||
->whereIn('tsp.companyId', [$companyId, 0])
|
||||
->field('tsp.id,tsp.name,tsp.description,tsp.pic,tsp.isSys as type,tsp.createTime,count(tspi.id) as num')
|
||||
->group('tsp.id');
|
||||
@@ -412,7 +412,11 @@ class TrafficController extends BaseController
|
||||
'wa.nickname', 'wa.avatar', 'wa.gender', 'wa.phone', 'wa.alias'
|
||||
]
|
||||
)
|
||||
// ========== 旧版流量池代码(已废弃) ==========
|
||||
// ->join('traffic_pool_v1 p', 'p.identifier=tspi.identifier', 'left')
|
||||
// ========== 新版流量池代码 ==========
|
||||
->join('traffic_pool p', 'p.identifier=tspi.identifier', 'left')
|
||||
// ========== 旧版流量池代码结束 ==========
|
||||
->join('wechat_account wa', 'tspi.identifier=wa.wechatId', 'left')
|
||||
->where($where);
|
||||
|
||||
@@ -424,7 +428,7 @@ class TrafficController extends BaseController
|
||||
foreach ($list as $k => &$v) {
|
||||
//流量池筛选
|
||||
$package = TrafficSourcePackageItem::alias('tspi')
|
||||
->join('traffic_source_package p', 'tspi.packageId=p.id AND tspi.companyId=p.companyId')
|
||||
->join('traffic_source_package_v1 p', 'tspi.packageId=p.id AND tspi.companyId=p.companyId')
|
||||
->where(['tspi.identifier' => $v['identifier']])
|
||||
->whereIn('tspi.companyId', [0, $v['companyId']])
|
||||
->column('p.name');
|
||||
@@ -497,7 +501,7 @@ class TrafficController extends BaseController
|
||||
foreach ($list as $k => &$v) {
|
||||
// 获取好友所属的流量池包
|
||||
$package = TrafficSourcePackageItem::alias('tspi')
|
||||
->join('traffic_source_package p', 'tspi.packageId=p.id AND tspi.companyId=p.companyId')
|
||||
->join('traffic_source_package_v1 p', 'tspi.packageId=p.id AND tspi.companyId=p.companyId')
|
||||
->where(['tspi.identifier' => $v['identifier']])
|
||||
->whereIn('tspi.companyId', [0, $companyId])
|
||||
->column('p.name');
|
||||
|
||||
Reference in New Issue
Block a user