优化下游推广公司搜索

master
chenzhi 4 years ago
parent 72135079fa
commit fb798e82bf

@ -40,16 +40,20 @@ class PromoteCompanyController extends ThinkController
$is_export = true;
$this->getAggregatePackage();
}
$map = [];
$promotemap=[];
$map = [
"_string" => "1 = 1"
];
$promotemap=[
"_string" => "1 = 1"
];
$company_name = trim(I('company_name'));
//市场部权限begin
$pro_id = getMarketAuthPromoteId();
if($pro_id){
$promotemap["_string"]="p.id in ({$pro_id})";
$promotemap["_string"] .=" AND p.id in ({$pro_id})";
$c_id = throwPromoteIdToCompanyId($pro_id);
$map["_string"]="id in ({$c_id})";
$map["_string"] .=" AND id in ({$c_id})";
}
//市场部权限end
@ -74,11 +78,7 @@ class PromoteCompanyController extends ThinkController
$g_name = $_REQUEST['game_name'];
$g_id = M("Game","tab_")->where("relation_game_name = '{$g_name}'")->field("relation_game_id")->find()['relation_game_id'];
// $reg_str = "([^0-9]|^){$g_id },";
if (isset($map["_string"])) {
$map['_string'] = ' AND concat(",", game_ids, ",") like "%,' . $g_id . ',%"';
}else{
$map["_string"] = ' concat(",", game_ids, ",") like "%,' . $g_id . ',%"';
}
$map["_string"] .= ' AND concat(",", game_ids, ",") like "%,' . $g_id . ',%"';
// $map["game_ids"]=["EXP","REGEXP '{$reg_str}'"];
}
@ -93,11 +93,8 @@ class PromoteCompanyController extends ThinkController
$c_id = -1;
}
$c_id = implode(",", $c_id);
if(isset($map["_string"])){
$map["_string"] .= " ADN id in ($c_id)";
}else{
$map["_string"] = " id in ($c_id)";
}
$map["_string"] .= " AND id in ($c_id)";
}

Loading…
Cancel
Save