Merge pull request 'hotfix/and_bug' (#22) from hotfix/and_bug into master

Reviewed-on: http://8.136.139.249:3000/wmtx/platform/pulls/22
master
廖金灵 4 years ago
commit ace44195c5

@ -3021,11 +3021,19 @@ function getMarketAuthPromoteId()
{ {
$map['level'] = 1; $map['level'] = 1;
if (isMarketLeader()) { if (isMarketLeader()) {
$map['admin_id'] = ['gt', 0]; //搜索所有市场部管理员id
$mid = M("AuthGroup")->where("title like '%市场%'")->getField("id",true);
$mid = implode(",",$mid);
$admin_id = M("AuthGroupAccess")->where("group_id in ({$mid})")->getField("uid",true);
$admin_id = implode(",",$admin_id);
$map['admin_id'] = ['in', $admin_id];
}elseif(isMarketAdmin()){ }elseif(isMarketAdmin()){
$userAuth = session('user_auth'); $userAuth = session('user_auth');
$adminId = $userAuth['uid']; $adminId = $userAuth['uid'];
$map['admin_id'] = $adminId; $map['admin_id'] = $adminId;
}else{ }else{
return false; return false;
} }
@ -3039,12 +3047,11 @@ function getMarketAuthPromoteId()
function throwPromoteIdToCompanyId($p_ids) function throwPromoteIdToCompanyId($p_ids)
{ {
$map["id"]=["in","{$p_ids}"]; $dbres = M("Promote","tab_")->where("id in ({$p_ids})")->field("count(*) count,company_id")->group("company_id")->select();
$dbres = M("Promote","tab_")->where($map)->group("company_id")->getField("company_id",true);
if(empty($dbres)){ if(empty($dbres)){
return -1; return -1;
}else{ }else{
return implode(",",$dbres); return implode(",",array_column($dbres,"company_id"));
} }
} }

Loading…
Cancel
Save