|
|
|
@ -289,14 +289,22 @@ class PromoteCompanyController extends ThinkController
|
|
|
|
|
if ($batchType == 1) { // 批量增加
|
|
|
|
|
$where['_string'] = "concat(',', game_ids, ',') not like \"%,{$gameId},%\"";
|
|
|
|
|
$exp = "trim(BOTH ',' FROM concat(game_ids, ',', {$gameId}))";
|
|
|
|
|
$op_name = "批量上架";
|
|
|
|
|
}
|
|
|
|
|
if ($batchType == 2) { // 批量删除
|
|
|
|
|
$where['_string'] = "concat(',', game_ids, ',') like \"%,{$gameId},%\"";
|
|
|
|
|
$exp = "trim(BOTH ',' FROM replace(concat(',', game_ids, ','), \",{$gameId},\", ','))";
|
|
|
|
|
$op_name = "批量下架";
|
|
|
|
|
}
|
|
|
|
|
M('promote', 'tab_')->where($where)->save([
|
|
|
|
|
'game_ids' => ['exp', $exp]
|
|
|
|
|
]);
|
|
|
|
|
//加入日志
|
|
|
|
|
$companys = M('promote_company', 'tab_')->field("id")->where($where)->select();
|
|
|
|
|
if(!empty($companys)){
|
|
|
|
|
$company_ids = implode(",",array_column($companys,"id"));
|
|
|
|
|
addOperationLog(['op_type'=>1,'key'=>"","op_name"=>$op_name,"content"=>json_encode(["company_id"=>$company_ids,"batchCompanyType"=>$batchCompanyType,"game_id"=>$gameId,'batch_type'=>$batchType])]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
M('promote_company', 'tab_')->where($where)->save([
|
|
|
|
|
'game_ids' => ['exp', $exp]
|
|
|
|
|