lizhen_gitee 1 anno fa
parent
commit
c81c27182c
1 ha cambiato i file con 10 aggiunte e 2 eliminazioni
  1. 10 2
      application/index/controller/Plantask.php

+ 10 - 2
application/index/controller/Plantask.php

@@ -154,16 +154,20 @@ class Plantask extends Controller
                     'user_id' => $intro_uid,
                 ];
                 $first_order = Db::name('unishop_order')->where($map)->order('have_paid asc')->value('order_price');
+                $first_order = $first_order ?: 0;
+
                 $jishu = $order['order_price'];
+                $remark_shaoshang = '';
                 if($first_order < $order['order_price']){
                     $jishu = $first_order;
+                    $remark_shaoshang = '(烧伤)';
                 }
 
                 //奖励
                 $bili = config('site.orderpaid_zhitui_bili') ?: 5;
                 $score = bcdiv(bcmul($jishu,$bili,2),100,2);
                 if($score > 0){
-                    $rs_wallet = $walletmodel->lockChangeAccountRemain($intro_uid,'score',$score,3,'直推代理奖励','unishop_order',$order['id'],$order['user_id']);
+                    $rs_wallet = $walletmodel->lockChangeAccountRemain($intro_uid,'score',$score,3,'直推代理奖励'.$remark_shaoshang,'unishop_order',$order['id'],$order['user_id']);
                     if($rs_wallet['status'] === false){
                         echo $rs_wallet['msg'];
                         Db::rollback();
@@ -183,16 +187,20 @@ class Plantask extends Controller
                     'user_id' => $top_uid,
                 ];
                 $first_order = Db::name('unishop_order')->where($map)->order('have_paid asc')->value('order_price');
+                $first_order = $first_order ?: 0;
+
                 $jishu = $order['order_price'];
+                $remark_shaoshang = '';
                 if($first_order < $order['order_price']){
                     $jishu = $first_order;
+                    $remark_shaoshang = '(烧伤)';
                 }
 
                 //奖励
                 $bili = config('site.orderpaid_jiantui_bili') ?: 1;
                 $score = bcdiv(bcmul($jishu,$bili,2),100,2);
                 if($score > 0){
-                    $rs_wallet = $walletmodel->lockChangeAccountRemain($top_uid,'score',$score,4,'间推代理奖励','unishop_order',$order['id'],$order['user_id']);
+                    $rs_wallet = $walletmodel->lockChangeAccountRemain($top_uid,'score',$score,4,'间推代理奖励'.$remark_shaoshang,'unishop_order',$order['id'],$order['user_id']);
                     if($rs_wallet['status'] === false){
                         echo $rs_wallet['msg'];
                         Db::rollback();