From 418d5a6bda55c0fd991501b9f95b56d0155dee90 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Wed, 26 Aug 2020 16:41:48 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=B9=E6=AE=8A=E6=AF=94=E4=BE=8B=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E5=8A=9F=E8=83=BD=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompanyGameRatioController.class.php | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/Application/Admin/Controller/CompanyGameRatioController.class.php b/Application/Admin/Controller/CompanyGameRatioController.class.php index a33b551ad..ff55d7e66 100644 --- a/Application/Admin/Controller/CompanyGameRatioController.class.php +++ b/Application/Admin/Controller/CompanyGameRatioController.class.php @@ -423,7 +423,7 @@ class CompanyGameRatioController extends AdminController $v['verify_log']['admin_user']=$this->admininfo["username"]; $v['verify_log']['admin_time']=date("Y-m-d H:i:s"); $v['verify_log'] = json_encode($v['verify_log']); - $v['status']=2; + $v['status']=1; $company_game_ratio_log->save($v); //保存到其他表 //查找是否存在 @@ -459,7 +459,7 @@ class CompanyGameRatioController extends AdminController if (!$company_id || !$relation_game_id) { $this->error("公司与游戏的参数错误."); } - +// dump($end_time);dump($begin_time);die(); $check_data = M("company_game_ratio","tab_") ->where(['company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$begin_time,'end_time'=>$end_time]) ->find(); @@ -479,46 +479,46 @@ class CompanyGameRatioController extends AdminController ->where(['company_id'=>$company_id,'relation_game_id'=>$relation_game_id]) ->select(); - - foreach($data as $key => $value) { if ($value['begin_time'] > $begin_time) { + if (!$end_time) { + M("company_game_ratio","tab_") + ->where(['company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$value['begin_time'],'end_time'=>$value['end_time']]) + ->delete(); + continue; + } + if ($value['begin_time'] >= $end_time && $value['end_time']!=0) { continue; } if ($end_time > $value['begin_time'] && ($end_time < $value['end_time']||$value['end_time']==0)) { -// $value['begin_time'] = $end_time; -// M("company_game_ratio","tab_")->save($value); M("company_game_ratio","tab_") ->where(['company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$value['begin_time'],'end_time'=>$value['end_time']]) ->save(['begin_time'=>$end_time+1]); } else if ($end_time > $value['begin_time'] && ($end_time >= $value['end_time']&&$value['end_time']!=0)) { -// $value['begin_time'] = $begin_time; -// $value['end_time'] = $end_time; -// M("company_game_ratio","tab_")->save($value); M("company_game_ratio","tab_") ->where(['company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$value['begin_time'],'end_time'=>$value['end_time']]) ->save(['begin_time'=>$begin_time,'end_time'=>$end_time]); } } else if ($value['begin_time'] <= $begin_time) { - + if (!$end_time) { + M("company_game_ratio","tab_") + ->where(['company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$value['begin_time'],'end_time'=>$value['end_time']]) + ->save(['end_time'=>$begin_time-1]); + continue; + } if ($begin_time >= $value['end_time']&& $value['end_time']!=0) { continue; } if ($begin_time > $value['begin_time'] && ($end_time >= $value['end_time'] && $value['end_time']!=0)) { -// $value['end_time'] = $begin_time; -// M("company_game_ratio","tab_")->save($value); M("company_game_ratio","tab_") ->where(['company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$value['begin_time'],'end_time'=>$value['end_time']]) ->save(['end_time'=>$begin_time-1]); } else if ($begin_time > $value['begin_time'] && ($end_time < $value['end_time']||$value['end_time']==0)) { -// $value['end_time'] = $begin_time; -// M("company_game_ratio","tab_")->save($value); -// dump(2);die(); M("company_game_ratio","tab_") ->where(['company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$value['begin_time'],'end_time'=>$value['end_time']]) ->save(['end_time'=>$begin_time-1]); @@ -536,9 +536,6 @@ class CompanyGameRatioController extends AdminController ->where(['company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$value['begin_time'],'end_time'=>$value['end_time']]) ->save(['end_time'=>$begin_time-1]); } else if ($end_time == $value['end_time']&&$begin_time == $value['begin_time']) { - -// $value['begin_time'] = $begin_time; -// $value['end_time'] = $end_time; M("company_game_ratio","tab_") ->where(['company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$value['begin_time'],'end_time'=>$value['end_time']]) ->save(['begin_time'=>$begin_time,'end_time'=>$end_time]);