From e8eb963fc14a91eec59c501396ec4f87f5f5bdde Mon Sep 17 00:00:00 2001 From: chenzhi Date: Thu, 20 Aug 2020 10:03:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=85=AC=E5=8F=B8=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E6=B8=B8=E6=88=8F=E6=8E=A8=E5=B9=BF=E5=91=98=E6=97=A0?= =?UTF-8?q?=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PromoteCompanyController.class.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index 586c60fc6..abbc73e48 100644 --- a/Application/Admin/Controller/PromoteCompanyController.class.php +++ b/Application/Admin/Controller/PromoteCompanyController.class.php @@ -890,9 +890,9 @@ class PromoteCompanyController extends ThinkController } else { $game_ids = ''; } + $this->changePromoteGameids($id,$game_ids); $res = M('promote_company', 'tab_')->where(['id'=>$id])->save(['game_ids'=>$game_ids]); if ($res) { - $this->changePromoteGameids($id,$game_ids); $this->ajaxReturn(['code'=>1,'msg'=>'更新成功']); } else { $this->ajaxReturn(['code'=>0,'msg'=>'数据未发生变化']); @@ -1029,12 +1029,11 @@ class PromoteCompanyController extends ThinkController $save['last_up_time'] = $time; } protected function changePromoteGameids($company_id,$game_ids){ - $is_change_game = false; $old_info = M("PromoteCompany","tab_")->field("company_belong,develop_type,game_ids")->where("id = {$company_id}")->find(); + $is_change_game = false; if($old_info['game_ids'] != $game_ids){ - // $is_change_game = true; $oids = explode(',', $old_info['game_ids']); - $nids = explode(',', $save['game_ids']); + $nids = explode(',',$game_ids); $diff_ids = []; if(count($oids) == 0){ $is_change_game = false; @@ -1051,19 +1050,18 @@ class PromoteCompanyController extends ThinkController $is_change_game = true; $diff_ids = $this->changeRelationGameidToGameid($diff_ids,true); } - if ($is_change_game) { - $Promote = M("Promote", "tab_"); - $dbres = $Promote->field("id,game_ids,company_belong,company_relation")->where("company_id = '{$company_id}'")->select(); + + $Promote = M("Promote", "tab_"); + if($is_change_game){ + $dbres = $Promote->field("id,game_ids")->where("company_id = '{$company_id}'")->select(); foreach ($dbres as $k=>&$v) { $temp_ids = explode(',', $v['game_ids']); $v['game_ids'] = implode(',', array_diff($temp_ids, $diff_ids)); - $v['company_belong'] = $save['company_belong']; - $v['company_relation'] = $save['develop_type']; $Promote->save($v); } } + } - } /** * 由于修改公司信息引起的会长信息修改