|
|
|
@ -3021,14 +3021,23 @@ function getMarketAuthPromoteId()
|
|
|
|
|
{
|
|
|
|
|
$map['level'] = 1;
|
|
|
|
|
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()){
|
|
|
|
|
$userAuth = session('user_auth');
|
|
|
|
|
$adminId = $userAuth['uid'];
|
|
|
|
|
$map['admin_id'] = $adminId;
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
// dd($map['admin_id']);
|
|
|
|
|
$dbres = M("Promote","tab_")->where($map)->getField("id",true);
|
|
|
|
|
if(empty($dbres)){
|
|
|
|
|
return -1;
|
|
|
|
@ -3039,12 +3048,13 @@ function getMarketAuthPromoteId()
|
|
|
|
|
|
|
|
|
|
function throwPromoteIdToCompanyId($p_ids)
|
|
|
|
|
{
|
|
|
|
|
$map["id"]=["in","{$p_ids}"];
|
|
|
|
|
$dbres = M("Promote","tab_")->where($map)->group("company_id")->getField("company_id",true);
|
|
|
|
|
// $map["id"]=["in",$p_ids];
|
|
|
|
|
$dbres = M("Promote","tab_")->where("id in ({$p_ids})")->field("count(*) count,company_id")->group("company_id")->select();
|
|
|
|
|
// echo($dbres);
|
|
|
|
|
if(empty($dbres)){
|
|
|
|
|
return -1;
|
|
|
|
|
}else{
|
|
|
|
|
return implode(",",$dbres);
|
|
|
|
|
return implode(",",array_column($dbres,"company_id"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|