Merge pull request '优化下游推广公司搜索' (#19) from hotfix/and_bug into master

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

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

Loading…
Cancel
Save