This commit is contained in:
Jerry Yan 2020-01-14 19:38:31 +08:00 committed by JerryYan
parent 7015ca6535
commit a8b1c746c5
3 changed files with 15 additions and 14 deletions

View File

@ -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()]);

View File

@ -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;
} }
/** /**

View File

@ -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');