Просмотр исходного кода

fix bug: 1.成长值与积分去除转为正数 2.符号优先级问题没搞清楚,用括号明确谁优先

shizhongqi 4 месяцев назад
Родитель
Сommit
3b0522a5ce
2 измененных файлов с 4 добавлено и 4 удалено
  1. 2 2
      biz-ghs/order/classes/OrderClass.php
  2. 2 2
      console/controllers/CustomController.php

+ 2 - 2
biz-ghs/order/classes/OrderClass.php

@@ -1492,7 +1492,7 @@ class OrderClass extends BaseClass
         $refundNum = $current['refundNum'] ?? 0;
         $unitName = $current['unitName'] ?? '扎';
         $remark = $current['remark'] ?? '';
-        $ratioType = $current['ratioType'] === null ? -1 : $current['ratioType'];
+        $ratioType = $current['ratioType'] === null ? -1 : intval($current['ratioType']);
         $ratio = $current['ratio'];
 
         $lastNum = bcsub($itemNum, $refundNum);
@@ -1511,7 +1511,7 @@ class OrderClass extends BaseClass
             if (floatval($unitPrice) == 0.01) {
                 $content .= $productNum . ' = ' . $productPrice . '元 赠送价<BR>';
             }else{
-                $content .= $productNum . ' = ' . $productPrice . '元  ' . ($ratioType==0 ? $ratio.'支装' : $ratioType==1 ? '若干支装' : '') . '<BR>';
+                $content .= $productNum . ' = ' . $productPrice . '元  ' . ($ratioType==0 ? $ratio.'支装' : ($ratioType==1 ? '若干支装' : '')) . '<BR>';
             }
         }
         $content .= '--------------------------------<BR>';

+ 2 - 2
console/controllers/CustomController.php

@@ -176,8 +176,8 @@ class CustomController extends Controller
                                 }
                             }
                             $c->buyAmount = $buyAmount;
-                            $c->growth = intval($buyAmount);
-                            $c->integral = intval($buyAmount);
+                            $c->growth = $buyAmount;
+                            $c->integral = $buyAmount;
 
                             // 根据 growth 设置等级
                             $memberData = CustomClass::getCustomExpenseLevel($c->growth, $mainId, $levelDatas); // 设置等级多处需要同步修改的,请搜索:getCustomExpenseLevel