shish 3 yıl önce
ebeveyn
işleme
811ec6c630
1 değiştirilmiş dosya ile 9 ekleme ve 7 silme
  1. 9 7
      console/controllers/OrderItemController.php

+ 9 - 7
console/controllers/OrderItemController.php

@@ -24,13 +24,15 @@ class OrderItemController extends Controller
                 $productId = $item->productId ?? 0;
                 $name = $item->name ?? '';
                 $smallCost = bcdiv($cost, $ratio, 2);
-                if ($cost > 10 && $cost > $xhPrice) {
-                    echo $productId . ' ' . $name . ' 成本:' . $cost . ' 价格:' . $xhPrice . ' 比例:' . $ratio . ' 小单位成本:' . $smallCost . "\n";
-                    $item->cost = $smallCost;
-                    $item->save();
-                }
-                if ($cost < 10 && $cost > $xhPrice) {
-                    //echo $productId . ' ' . $name . ' 成本:' . $cost . ' 价格:' . $xhPrice . ' 比例:' . $ratio . "\n";
+                if ($ratio > 1) {
+                    if ($cost > 10 && $cost > $xhPrice) {
+//                        echo $productId . ' ' . $name . ' 成本:' . $cost . ' 价格:' . $xhPrice . ' 比例:' . $ratio . ' 小单位成本:' . $smallCost . "\n";
+//                        $item->cost = $smallCost;
+//                        $item->save();
+                    }
+                    if ($cost < 10 && $cost > $xhPrice) {
+                        echo $productId . ' ' . $name . ' 成本:' . $cost . ' 价格:' . $xhPrice . ' 比例:' . $ratio . "\n";
+                    }
                 }
             }
         }