瀏覽代碼

积分向下取整

Cherry 2 年之前
父節點
當前提交
1bcee6063b

+ 1 - 1
application/api/controller/Notification.php

@@ -266,7 +266,7 @@ class Notification extends Api
                 if ($return_order_money > 0) {
                     // 可退积分 进行中 = (入场+午餐+押金)- 订单优惠 - 押金
                     // 可退积分 未核销 = 订单金额 - 押金
-                    $real_score = ceil($return_order_money - $sumYajinMoney);
+                    $real_score = intval($return_order_money - $sumYajinMoney);
 
                     UserCommon::user_score_sum($v['user_id'], (-1) * $real_score, '超时未核销退款扣减积分');
                 }

+ 1 - 1
application/api/controller/Notify.php

@@ -68,7 +68,7 @@ class Notify extends Api
 
            // 下单返积分
            $user_number = $user_model->where('id',$order_info['user_id'])->value('score');
-           $zong = ceil($order_info['item_money']+$order_info['wucan_money']-$order_info['youhui_money']);
+           $zong = intval($order_info['item_money']+$order_info['wucan_money']-$order_info['youhui_money']);
            $score->score($order_info['user_id'],$user_number,$zong,'下单返利积分');
            Db::name('user')->where('id',$order_info['user_id'])->update(['score'=>$user_number+$zong]);
 

+ 1 - 1
application/api/controller/Pay.php

@@ -87,7 +87,7 @@ class Pay extends Api
             if($user->money<$order_info['order_money']){
                 $this->error('用户余额不足');
             }
-            $zong = ceil($order_info['item_money']+$order_info['wucan_money']-$order_info['youhui_money']);
+            $zong = intval($order_info['item_money']+$order_info['wucan_money']-$order_info['youhui_money']);
             $this->score($order_info['user_id'],$user->score,$zong,'下单返利积分');
 
             $user_before_money = $user->money;

+ 1 - 1
application/api/controller/Yorder.php

@@ -456,7 +456,7 @@ class Yorder extends Api
         (new Ordercode())->isUpdate('true', ['order_id' => $data['order_id']])->save(['ruchang_status' => 3, 'wucan_status' => 3, 'yajin_status' => 3]);
 
         // 修改积分
-        $order_score = $order_info['item_money'] + $order_info['wucan_money'] - $order_info['youhui_money'];
+        $order_score = intval($order_info['item_money'] + $order_info['wucan_money'] - $order_info['youhui_money']);
         $userM = $this->auth->getUser();
         $this->score($this->auth->id, $userM->score, $order_score, '鱼塘退款');
         $userM->score -= $order_score;