Browse Source

积分改为int类型,精确没有小数点

lizhen_gitee 1 year ago
parent
commit
1ef4bde7ee

+ 2 - 2
addons/unishop/behavior/Order.php

@@ -170,11 +170,11 @@ class Order
             if ($productInfo['stock'] < $numbers[$key]) {
                 throw new Exception(__('Insufficient inventory,%s pieces left', $productInfo['stock']));
             }
-            $orderPrice = bcadd($orderPrice, bcmul($productInfo['sales_price'], $numbers[$key], 2), 2);
+            $orderPrice = bcadd($orderPrice, bcmul($productInfo['sales_price'], $numbers[$key], 0), 0);
 //            $ordershouyi= bcadd($ordershouyi, bcmul($productInfo['pifa_shouyi'], $numbers[$key], 2), 2);
 
             $shouyi = $productInfo['sales_price']-($productInfo['pifa_price']*$productInfo['pifa_number'])+$productInfo['pifa_shouyi'];
-            $ordershouyi= bcadd($ordershouyi, bcmul($shouyi, $numbers[$key], 2), 2);
+            $ordershouyi= bcadd($ordershouyi, bcmul($shouyi, $numbers[$key], 0), 0);
 
 
             $baseProductInfo[] = $productInfo;

+ 1 - 2
application/common/model/Wallet.php

@@ -79,8 +79,7 @@ class Wallet extends Model
         );
 
         //获取小数点
-//        $point = $accountType == 'money' ? 2 : 0;
-        $point = 2;
+        $point = $accountType == 'money' ? 2 : 0;
         bcscale($point);
 
         //钱包名称

+ 4 - 1
application/extra/wallet.php

@@ -6,10 +6,13 @@ return [
     'logtype' => [
         1  => '邀请奖励',
         2  => '积分兑换', //score -
-        21  => '积分兑换返回', //score +
+        21 => '积分兑换(被拒返回)', //score +
+
         3  => '直推代理奖励', //支付后立刻获得 score +
         4  => '间推代理奖励', //支付后立刻获得 score +   废弃了
+
         5  => '下单收益',    //订单10日结算 score +
+
         6  => '总代奖励',    //订单10日结算 score +
         7  => '总代奖励(间推)',//订单10日结算 score +    废弃了
     ],

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

@@ -58,7 +58,7 @@ class Plantask extends Controller
 
                 //奖励
                 $bili = config('site.orderpaid_zhitui_bili') ?: 5;
-                $score = bcdiv(bcmul($jishu,$bili,2),100,2);
+                $score = bcdiv(bcmul($jishu,$bili,0),100,0);
                 if($score > 0){
                     $rs_wallet = $walletmodel->lockChangeAccountRemain($intro_uid,'score',$score,3,'直推代理奖励'.$remark_shaoshang,'unishop_order',$order['id'],$order['user_id']);
                     if($rs_wallet['status'] === false){
@@ -153,7 +153,7 @@ class Plantask extends Controller
         $jicha_bili = $rule['bili'] - $buyer_rule['bili'];
 
         //给直推
-        $score = bcdiv(bcmul($order['order_shouyi'],$jicha_bili,2),100,2);
+        $score = bcdiv(bcmul($order['order_shouyi'],$jicha_bili,0),100,0);
 //        dump($score);
         $remark = $intro_uid.':业绩'.$yeji.','.$rule['name'].'代理;'.$order['user_id'].':业绩'.$buyer_yeji.','.$buyer_rule['name'].'代理';
         //echo $remark;