You've already forked qlg.tsgz.moe
							
							IP判断
This commit is contained in:
		| @@ -23,7 +23,6 @@ class Index extends Base{ | |||||||
|      * 首页 |      * 首页 | ||||||
|      */ |      */ | ||||||
|     public function index(){ |     public function index(){ | ||||||
|         echo 'hello';die; |  | ||||||
|         echo request()->ip();die; |         echo request()->ip();die; | ||||||
|     	$m = new M(); |     	$m = new M(); | ||||||
|     	hook('mobileControllerIndexIndex',['getParams'=>input()]); |     	hook('mobileControllerIndexIndex',['getParams'=>input()]); | ||||||
|   | |||||||
| @@ -189,19 +189,20 @@ class Settlements extends Base | |||||||
|         // 1,推荐人获得预获产品券时限上日有消费≥10元为优惠款的50%。 |         // 1,推荐人获得预获产品券时限上日有消费≥10元为优惠款的50%。 | ||||||
|         // refPreProductYdGTMoney     refPreProductYesInSaleScale |         // refPreProductYdGTMoney     refPreProductYesInSaleScale | ||||||
|         // 2,推荐人获得预获产品券时限上日有消费<10元为优惠款的25% refPreProductNoInSaleScale |         // 2,推荐人获得预获产品券时限上日有消费<10元为优惠款的25% refPreProductNoInSaleScale | ||||||
|         $m->setTable('user_trees'); |         // 20200114 -- 说用不上,注释 | ||||||
|         $pid = $m->getField(['uid'=>$shops['userId']],'pid'); | //        $m->setTable('user_trees'); | ||||||
|         if($pid && $pInfo = getUserInfo(['userId'=>$pid,'dataFlag'=>1,'userStatus'=>1],'userId') && 3 != $order->goodsType){//有推荐人并且推荐人状态正常 | //        $pid = $m->getField(['uid'=>$shops['userId']],'pid'); | ||||||
|             $yesterdayBuyMoney = Model('common/Orders')->getYesterdayBuyMoney($pid,'realTotalMoney'); | //        if($pid && $pInfo = getUserInfo(['userId'=>$pid,'dataFlag'=>1,'userStatus'=>1],'userId') && 3 != $order->goodsType){//有推荐人并且推荐人状态正常 | ||||||
|             if($yesterdayBuyMoney >= dataConf('refPreProductYdGTMoney')){//大于设定值 | //            $yesterdayBuyMoney = Model('common/Orders')->getYesterdayBuyMoney($pid,'realTotalMoney'); | ||||||
|                 $refProductMoney = round($discountMoney * (dataConf('refPreProductYesInSaleScale')*0.01),2);//1 | //            if($yesterdayBuyMoney >= dataConf('refPreProductYdGTMoney')){//大于设定值 | ||||||
|             }else{ | //                $refProductMoney = round($discountMoney * (dataConf('refPreProductYesInSaleScale')*0.01),2);//1 | ||||||
|                 $refProductMoney = round($discountMoney * (dataConf('refPreProductNoInSaleScale')*0.01),2);//2 | //            }else{ | ||||||
|             } | //                $refProductMoney = round($discountMoney * (dataConf('refPreProductNoInSaleScale')*0.01),2);//2 | ||||||
|             if($refProductMoney > 0){ | //            } | ||||||
|                 Model('common/UserVouchers')->insertVouchersNotice($pid,$orderId,$refProductMoney,0,'交易订单【'.$order->orderNo.'】推荐所得'); | //            if($refProductMoney > 0){ | ||||||
|             }          | //                Model('common/UserVouchers')->insertVouchersNotice($pid,$orderId,$refProductMoney,0,'交易订单【'.$order->orderNo.'】推荐所得'); | ||||||
|         } | //            } | ||||||
|  | //        } | ||||||
|         return true; |         return true; | ||||||
|     } |     } | ||||||
|     /** |     /** | ||||||
|   | |||||||
| @@ -7,6 +7,7 @@ use think\Db; | |||||||
|  */ |  */ | ||||||
| class UserVouchers extends Base{ | class UserVouchers extends Base{ | ||||||
|     public function startGiveVouchers(){ |     public function startGiveVouchers(){ | ||||||
|  |         if(request()->ip(0) != '127.0.0.1') return; | ||||||
|     	set_time_limit(0); |     	set_time_limit(0); | ||||||
|     	$sm = Model('common/SysSummary'); |     	$sm = Model('common/SysSummary'); | ||||||
|     	$sysData= $sm->getInfo('toPayFast,toPaySlow'); |     	$sysData= $sm->getInfo('toPayFast,toPaySlow'); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user