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