场景获客优化子账号只能展示自己的数据
This commit is contained in:
@@ -34,7 +34,6 @@ class GetPlanSceneListV1Controller extends BaseController
|
|||||||
$where[] = ['scenarioTags', 'like', '%' . $params['tag'] . '%'];
|
$where[] = ['scenarioTags', 'like', '%' . $params['tag'] . '%'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 查询数据
|
// 查询数据
|
||||||
$query = PlansSceneModel::where($where);
|
$query = PlansSceneModel::where($where);
|
||||||
|
|
||||||
@@ -193,10 +192,19 @@ class GetPlanSceneListV1Controller extends BaseController
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$where = [
|
||||||
|
['companyId', '=', $companyId],
|
||||||
|
['deleteTime', '=', 0],
|
||||||
|
['sceneId', 'in', $sceneIds],
|
||||||
|
];
|
||||||
|
if(!$this->getUserInfo('isAdmin')){
|
||||||
|
$where[] = ['userId', '=', $this->getUserInfo('id')];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$rows = Db::name('customer_acquisition_task')
|
$rows = Db::name('customer_acquisition_task')
|
||||||
->whereIn('sceneId', $sceneIds)
|
->where($where)
|
||||||
->where('companyId', $companyId)
|
|
||||||
->where('deleteTime', 0)
|
|
||||||
->field('sceneId, COUNT(*) as total')
|
->field('sceneId, COUNT(*) as total')
|
||||||
->group('sceneId')
|
->group('sceneId')
|
||||||
->select();
|
->select();
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class PlanSceneV1Controller extends BaseController
|
|||||||
'companyId' => $this->getUserInfo('companyId'),
|
'companyId' => $this->getUserInfo('companyId'),
|
||||||
];
|
];
|
||||||
|
|
||||||
if($this->getUserInfo('isAdmin')){
|
if(!$this->getUserInfo('isAdmin')){
|
||||||
$where['userId'] = $this->getUserInfo('id');
|
$where['userId'] = $this->getUserInfo('id');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,7 +176,7 @@ class PlanSceneV1Controller extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 如果是管理员,需要验证用户权限
|
// 如果是管理员,需要验证用户权限
|
||||||
if ($this->getUserInfo('isAdmin')) {
|
if (!$this->getUserInfo('isAdmin')) {
|
||||||
$userPlan = Db::name('customer_acquisition_task')
|
$userPlan = Db::name('customer_acquisition_task')
|
||||||
->where([
|
->where([
|
||||||
'id' => $planId,
|
'id' => $planId,
|
||||||
|
|||||||
Reference in New Issue
Block a user