Merge pull request 'hotfix/and_bug' (#20) from hotfix/and_bug into release

优化下游推广公司搜索
master
陈志 4 years ago
commit 7286e3d157

@ -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)";
}
} }

@ -171,9 +171,9 @@
,util = layui.util; ,util = layui.util;
var data1 =data; var data1 =data;
var data2 = [];
if (JSON.parse(data1).data_president) { if (JSON.parse(data1).data_president) {
var data2 = JSON.parse(data1).data_president.split(","); data2 = JSON.parse(data1).data_president.split(",");
} }
// var dataTransfers = transfer.getData('key123'); // var dataTransfers = transfer.getData('key123');
// $('#promote_data').val(JSON.stringify(dataTransfers)); // $('#promote_data').val(JSON.stringify(dataTransfers));
@ -210,13 +210,12 @@
} }
// data2.push(data[0]['value']); // data2.push(data[0]['value']);
console.log(data2)
transfer.reload('key123',{elem: '#test4',data: JSON.parse(data1).list,title: ['全部成员', '选中成员'],showSearch: true,value: data2,id: 'key123'}); transfer.reload('key123',{elem: '#test4',data: JSON.parse(data1).list,title: ['全部成员', '选中成员'],showSearch: true,value: data2,id: 'key123'});
dataTransfer = transfer.getData('key123'); dataTransfer = transfer.getData('key123');
$('#promote_data').val(JSON.stringify(dataTransfer)); $('#promote_data').val(JSON.stringify(dataTransfer));
return; return;
} }
} }
}) })

Loading…
Cancel
Save