From 60c7bdce34aa1e2d08acaf849cf875e59c800d8e Mon Sep 17 00:00:00 2001 From: chenzhi Date: Wed, 11 Dec 2019 18:23:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=A1=A5=E9=93=BE=E6=97=B6?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E5=B7=B2=E7=BB=93=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/MemberController.class.php | 2 +- .../Admin/Controller/MendController.class.php | 29 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/Application/Admin/Controller/MemberController.class.php b/Application/Admin/Controller/MemberController.class.php index d44b5d2a8..a97128fe5 100644 --- a/Application/Admin/Controller/MemberController.class.php +++ b/Application/Admin/Controller/MemberController.class.php @@ -13,7 +13,7 @@ class MemberController extends ThinkController */ public function user_info($p=0){ //设定默认时间 - if(!array_key_exists("time_start",$_REQUEST)){ + if(!array_key_exists("time_start",$_REQUEST) && I('type') != 2){ $this->redirect(ACTION_NAME, array('time_start' => date('Y-m-d',strtotime('-30 day')),"time_end"=>date('Y-m-d'))); } //基础信息 diff --git a/Application/Admin/Controller/MendController.class.php b/Application/Admin/Controller/MendController.class.php index 0dee9cae9..493c4a882 100644 --- a/Application/Admin/Controller/MendController.class.php +++ b/Application/Admin/Controller/MendController.class.php @@ -115,6 +115,12 @@ class MendController extends ThinkController { if ($_POST['order_time'] == '') { $this->error('没有订单日期'); } + //判断是否已经结算 + if(self::checkSettlement(strtotime($_POST['order_time']),$_POST['promote_id'])){ + $this->error('在订单日期内含有已经结算的订单,无法补链'); + } + + $create = $_REQUEST; $create['order_time'] = date($create['order_time']); $params = array( @@ -150,6 +156,29 @@ class MendController extends ThinkController { $this->display(); } } + private function checkSettlement($order_time,$prmoote_id) + { + //判断是否已经结算 + //获取会长信息 + $Promote = M('promote','tab_'); + $prmootedata = $Promote->field('chain')->find($prmoote_id); + $chain = trim($prmootedata['chain'], '/'); + if ($chain == '') { + $prmoote_id = 0; + } else { + $prmoote_id = explode('/', $chain)[0]; + } + $jsres = M("Settlement","tab_")->where(array( + "total_money"=>array("GT",0), + "starttime"=>array("ELT",$order_time), + "endtime"=>array("EGT",$order_time), + "promote_id"=>$prmoote_id + ))->find(); + if($jsres) return true; + return false; + + # code... + } //补链详情 public function shiftInfo() {