IP判断
This commit is contained in:
parent
7015ca6535
commit
a8b1c746c5
@ -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()]);
|
||||
|
@ -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;
|
||||
}
|
||||
/**
|
||||
|
@ -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');
|
||||
|
Loading…
x
Reference in New Issue
Block a user