From a8b1c746c54a22add1bba5e1aae1104409968c20 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Tue, 14 Jan 2020 19:38:31 +0800 Subject: [PATCH] =?UTF-8?q?IP=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hyhproject/app/controller/Index.php | 1 - hyhproject/common/model/Settlements.php | 27 ++++++++++++------------ hyhproject/common/model/UserVouchers.php | 1 + 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/hyhproject/app/controller/Index.php b/hyhproject/app/controller/Index.php index 5bb1e0e..aa29927 100755 --- a/hyhproject/app/controller/Index.php +++ b/hyhproject/app/controller/Index.php @@ -23,7 +23,6 @@ class Index extends Base{ * 首页 */ public function index(){ - echo 'hello';die; echo request()->ip();die; $m = new M(); hook('mobileControllerIndexIndex',['getParams'=>input()]); diff --git a/hyhproject/common/model/Settlements.php b/hyhproject/common/model/Settlements.php index 52d3597..2da4523 100755 --- a/hyhproject/common/model/Settlements.php +++ b/hyhproject/common/model/Settlements.php @@ -189,19 +189,20 @@ class Settlements extends Base // 1,推荐人获得预获产品券时限上日有消费≥10元为优惠款的50%。 // refPreProductYdGTMoney refPreProductYesInSaleScale // 2,推荐人获得预获产品券时限上日有消费<10元为优惠款的25% refPreProductNoInSaleScale - $m->setTable('user_trees'); - $pid = $m->getField(['uid'=>$shops['userId']],'pid'); - if($pid && $pInfo = getUserInfo(['userId'=>$pid,'dataFlag'=>1,'userStatus'=>1],'userId') && 3 != $order->goodsType){//有推荐人并且推荐人状态正常 - $yesterdayBuyMoney = Model('common/Orders')->getYesterdayBuyMoney($pid,'realTotalMoney'); - if($yesterdayBuyMoney >= dataConf('refPreProductYdGTMoney')){//大于设定值 - $refProductMoney = round($discountMoney * (dataConf('refPreProductYesInSaleScale')*0.01),2);//1 - }else{ - $refProductMoney = round($discountMoney * (dataConf('refPreProductNoInSaleScale')*0.01),2);//2 - } - if($refProductMoney > 0){ - Model('common/UserVouchers')->insertVouchersNotice($pid,$orderId,$refProductMoney,0,'交易订单【'.$order->orderNo.'】推荐所得'); - } - } + // 20200114 -- 说用不上,注释 +// $m->setTable('user_trees'); +// $pid = $m->getField(['uid'=>$shops['userId']],'pid'); +// if($pid && $pInfo = getUserInfo(['userId'=>$pid,'dataFlag'=>1,'userStatus'=>1],'userId') && 3 != $order->goodsType){//有推荐人并且推荐人状态正常 +// $yesterdayBuyMoney = Model('common/Orders')->getYesterdayBuyMoney($pid,'realTotalMoney'); +// if($yesterdayBuyMoney >= dataConf('refPreProductYdGTMoney')){//大于设定值 +// $refProductMoney = round($discountMoney * (dataConf('refPreProductYesInSaleScale')*0.01),2);//1 +// }else{ +// $refProductMoney = round($discountMoney * (dataConf('refPreProductNoInSaleScale')*0.01),2);//2 +// } +// if($refProductMoney > 0){ +// Model('common/UserVouchers')->insertVouchersNotice($pid,$orderId,$refProductMoney,0,'交易订单【'.$order->orderNo.'】推荐所得'); +// } +// } return true; } /** diff --git a/hyhproject/common/model/UserVouchers.php b/hyhproject/common/model/UserVouchers.php index 37a748a..92e4e77 100755 --- a/hyhproject/common/model/UserVouchers.php +++ b/hyhproject/common/model/UserVouchers.php @@ -7,6 +7,7 @@ use think\Db; */ class UserVouchers extends Base{ public function startGiveVouchers(){ + if(request()->ip(0) != '127.0.0.1') return; set_time_limit(0); $sm = Model('common/SysSummary'); $sysData= $sm->getInfo('toPayFast,toPaySlow');