From 25e710c27e2474988d362d699082ded59d1f942e Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Fri, 30 Oct 2020 15:31:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=96=E5=9B=A2=E6=8E=A8=E5=B9=BF=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MarketPercentageController.class.php | 8 +++++++ .../Controller/TimingController.class.php | 24 ++++++++++++------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/Application/Admin/Controller/MarketPercentageController.class.php b/Application/Admin/Controller/MarketPercentageController.class.php index 2971aacf5..716e0ada4 100644 --- a/Application/Admin/Controller/MarketPercentageController.class.php +++ b/Application/Admin/Controller/MarketPercentageController.class.php @@ -1596,6 +1596,14 @@ class MarketPercentageController extends ThinkController $data['end_time'] = $last_month; // $this->ajaxReturn(['msg'=>"过去已结算过的比例不能修改","status"=>0]); } + $last_month_first = strtotime(date('Y-m-1',strtotime("-1 month"))); + if ($company_belong_game_data['begin_time'] > $last_month && $data['begin_time'] < $last_month) + { +// $time_end = $last_month; + $data['begin_time'] = $last_month_first; +// $this->ajaxReturn(['msg'=>"过去已结算过的比例不能修改","status"=>0]); + } + if ($data['begin_time'] < $last_month && $data['end_time'] <= $last_month) { diff --git a/Application/Admin/Controller/TimingController.class.php b/Application/Admin/Controller/TimingController.class.php index fed20a38f..e34aee1b6 100644 --- a/Application/Admin/Controller/TimingController.class.php +++ b/Application/Admin/Controller/TimingController.class.php @@ -983,27 +983,29 @@ class TimingController extends AdminController { $spend_map = []; $time_start = 0; $time_end = 0; + + $month_time = []; + if($_REQUEST['time'] == 'all') { $belong_map = []; - $map = []; + $month_time[] = date('Y-m',strtotime(date('Y',time()).'-'.(date('m',time())-1).'-01')); + $month_time[] = date('Y-m',strtotime(date('Y',time()).'-'.(date('m',time())-2).'-01')); + $map['pay_time'] = ['in',$month_time]; $spend_map['pay_time'] = ['elt',strtotime(date('Y-m-t 23:59:59', strtotime(date('Y',time()).'-'.(date('m',time())-1).'-01')))]; } else { - + $month_time = $map['pay_time']; $time_start = strtotime(date('Y-m-1',strtotime($map['pay_time']))); $time_end = strtotime(date('Y-m-t',strtotime($map['pay_time']))); $belong_map = "((begin_time<={$time_start} and (end_time >={$time_start} or end_time=0)) or (begin_time<={$time_end} and end_time >={$time_end}) or (end_time>={$time_start} and end_time <={$time_end}))"; } + if ($map['pay_time']) { M("settleup_marketorder","tab_") - ->where(['pay_time'=>$map['pay_time']]) - ->delete(); - } else { - M("settleup_marketorder","tab_") - ->where('1=1') + ->where(['pay_time'=>['in',$month_time]]) ->delete(); } @@ -1170,13 +1172,17 @@ class TimingController extends AdminController { // ->where(['company_id'=>313,'spend.promote_id'=>4359,'relation_game_id'=>191]) // ->order("is_settlement ASC") ->select(); -// dump($promote_data);die(); + $specialPayAmount = []; $unsettlement_amount = []; foreach ($promote_data as $key => $value) { + if ($value['pay_time'] == date("Y-m",time())) { + continue; + } + $cp_radio = getGameCpRadio($value['game_id'],$value['pay_amount'],true); if (!$cp_radio) { $cp_radio = getGameCpRadio($value['game_id'],$value['pay_amount'],false); @@ -1359,7 +1365,7 @@ class TimingController extends AdminController { unset($promote_data[$key]['market_percentage']); $marker_data = M("settleup_marketorder","tab_") - ->where(['pay_time'=>$value['pay_time'],'promote_id'=>$value['promote_id'],'game_name'=>$value['game_name'],'admin_id'=>$value['admin_id']]) + ->where(['pay_time'=>$value['pay_time'],'promote_id'=>$value['promote_id'],'game_name'=>$value['game_name'],'admin_id'=>$value['admin_id'],'is_settlement'=>$value['is_settlement']]) ->find(); echo "日期:{$value['pay_time']},游戏:{$value['game_name']},推广员:{$value['promote_account']}\n"; echo "市场员:{$value['admin_id']} 推广员:{$value['promote_id']} 公司id:{$value['company_id']} 游戏关联id:{$value['relation_game_id']} 支付时间:{$value['pay_time']} 金额:{$value['pay_amount']}\n";