From db64bea72f6c662c771e15125647dcb36ac00521 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Thu, 9 Jul 2020 09:15:48 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/MendController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Admin/Controller/MendController.class.php b/Application/Admin/Controller/MendController.class.php index 4d4d666ed..7a669350a 100644 --- a/Application/Admin/Controller/MendController.class.php +++ b/Application/Admin/Controller/MendController.class.php @@ -137,7 +137,7 @@ class MendController extends ThinkController { // $this->error('在订单日期内含有已经结算的订单,无法补链'); // } if(self::checkSpend(strtotime($_POST['order_time']),$_POST['account'])){ - $this->error("在订单日期内含有已经结算的订单,无法补链。如订单:{$this->tempid}"); + $this->error("在订单日期内含有已经结算的订单,无法补链。"); } if(self::checkPromote(strtotime($_POST['order_time']),$_POST['account'])){ $this->error('在订单日期内含有多个推广员,无法补链'); From 6c1f898fb9bfed5de149ae0527c4006a40d143d2 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Thu, 9 Jul 2020 10:36:14 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8D=A2=E7=BB=91?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/MendController.class.php | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/Application/Admin/Controller/MendController.class.php b/Application/Admin/Controller/MendController.class.php index 7a669350a..6b4bf9ca6 100644 --- a/Application/Admin/Controller/MendController.class.php +++ b/Application/Admin/Controller/MendController.class.php @@ -136,8 +136,12 @@ class MendController extends ThinkController { // if(self::checkSettlement(strtotime($_POST['order_time']),$_POST['promote_id'])){ // $this->error('在订单日期内含有已经结算的订单,无法补链'); // } - if(self::checkSpend(strtotime($_POST['order_time']),$_POST['account'])){ - $this->error("在订单日期内含有已经结算的订单,无法补链。"); + + // if(self::checkSpend(strtotime($_POST['order_time']),$_POST['account'])){ + // $this->error("在订单日期内含有已经结算的订单,无法补链。"); + // } + if(self::checkOrderTime(strtotime($_POST['order_time']))){ + $this->error('仅能补链本周数据,请重新选择补链时间'); } if(self::checkPromote(strtotime($_POST['order_time']),$_POST['account'])){ $this->error('在订单日期内含有多个推广员,无法补链'); @@ -195,6 +199,17 @@ class MendController extends ThinkController { $this->display(); } } + private function checkOrderTime($order_time){ + $sdefaultDate = date("Y-m-d"); + $first=1;//周一开始 + $w=date('w',strtotime($sdefaultDate)); + $checktime=strtotime("$sdefaultDate -".($w ? $w - $first : 6).' days'); //本周开始时间 + if($order_time >= $checktime){ + //在本周允许换绑 + return false; + } + return true; + } /** * 2020.1.3 之后判断订单是否已经结算 */ @@ -207,10 +222,11 @@ class MendController extends ThinkController { ); $spendlist = M("Spend","tab_")->field("id,selle_status,pay_order_number")->where($map)->select(); if(count($spendlist) < 1){ + //无流水可换绑 return false; } //获取结算方式 - $c_id = M("User","tab_") + $c_id = M("User","tab_") ->alias('a') ->field("IFNULL(p.company_id,0) company_id") ->join('tab_promote p ON a.promote_id= p.id') @@ -246,6 +262,7 @@ class MendController extends ThinkController { } //其他情况不允许换绑 return true; + } /**