|  | @@ -22,8 +22,9 @@ class Plantask extends Controller
 | 
											
												
													
														|  |              exit;
 |  |              exit;
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +        //最后买东西是11天前了,intro_num在这里使用,减少查到的数据量
 | 
											
												
													
														|  |          $tendays_ago = $this->hualuo_tendays_ago();
 |  |          $tendays_ago = $this->hualuo_tendays_ago();
 | 
											
												
													
														|  | -        $list = Db::name('user')->where('last_paytime','lt',$tendays_ago)->where('intro_num','gt',0)->select(); //最后买东西是11天前了
 |  | 
 | 
											
												
													
														|  | 
 |  | +        $list = Db::name('user')->where('last_paytime','lt',$tendays_ago)->where('intro_num','gt',0)->select();
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          if(!empty($list)){
 |  |          if(!empty($list)){
 | 
											
												
													
														|  |              Db::startTrans();
 |  |              Db::startTrans();
 | 
											
										
											
												
													
														|  | @@ -94,7 +95,8 @@ class Plantask extends Controller
 | 
											
												
													
														|  |              //直推代理商获益
 |  |              //直推代理商获益
 | 
											
												
													
														|  |              $intro_uid = Db::name('user')->where('id',$order['user_id'])->value('intro_uid');
 |  |              $intro_uid = Db::name('user')->where('id',$order['user_id'])->value('intro_uid');
 | 
											
												
													
														|  |              if($intro_uid){
 |  |              if($intro_uid){
 | 
											
												
													
														|  | -                $score = bcdiv(bcmul($order['total_price'],5,2),100,2);
 |  | 
 | 
											
												
													
														|  | 
 |  | +                $bili = config('site.orderpaid_zhitui_bili') ?: 5;
 | 
											
												
													
														|  | 
 |  | +                $score = bcdiv(bcmul($order['total_price'],$bili,2),100,2);
 | 
											
												
													
														|  |                  if($score > 0){
 |  |                  if($score > 0){
 | 
											
												
													
														|  |                      $rs_wallet = $walletmodel->lockChangeAccountRemain($intro_uid,'score',$score,3,'直推代理奖励','unishop_order',$order['id']);
 |  |                      $rs_wallet = $walletmodel->lockChangeAccountRemain($intro_uid,'score',$score,3,'直推代理奖励','unishop_order',$order['id']);
 | 
											
												
													
														|  |                      if($rs_wallet['status'] === false){
 |  |                      if($rs_wallet['status'] === false){
 | 
											
										
											
												
													
														|  | @@ -108,9 +110,10 @@ class Plantask extends Controller
 | 
											
												
													
														|  |              //上上级
 |  |              //上上级
 | 
											
												
													
														|  |              $top_uid = Db::name('user')->where('id',$intro_uid)->value('intro_uid');
 |  |              $top_uid = Db::name('user')->where('id',$intro_uid)->value('intro_uid');
 | 
											
												
													
														|  |              if($top_uid){
 |  |              if($top_uid){
 | 
											
												
													
														|  | -                $score = bcdiv(bcmul($order['total_price'],1,2),100,2);
 |  | 
 | 
											
												
													
														|  | 
 |  | +                $bili = config('site.orderpaid_jiantui_bili') ?: 1;
 | 
											
												
													
														|  | 
 |  | +                $score = bcdiv(bcmul($order['total_price'],$bili,2),100,2);
 | 
											
												
													
														|  |                  if($score > 0){
 |  |                  if($score > 0){
 | 
											
												
													
														|  | -                    $rs_wallet = $walletmodel->lockChangeAccountRemain($top_uid,'score',$score,4,'兼推代理奖励','unishop_order',$order['id']);
 |  | 
 | 
											
												
													
														|  | 
 |  | +                    $rs_wallet = $walletmodel->lockChangeAccountRemain($top_uid,'score',$score,4,'间推代理奖励','unishop_order',$order['id']);
 | 
											
												
													
														|  |                      if($rs_wallet['status'] === false){
 |  |                      if($rs_wallet['status'] === false){
 | 
											
												
													
														|  |                          echo $rs_wallet['msg'];
 |  |                          echo $rs_wallet['msg'];
 | 
											
												
													
														|  |                          Db::rollback();
 |  |                          Db::rollback();
 |