shish 3 лет назад
Родитель
Сommit
9263cdc94e
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      console/controllers/OrderItemController.php

+ 2 - 0
console/controllers/OrderItemController.php

@@ -26,6 +26,8 @@ class OrderItemController extends Controller
                 $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";