|
|
@@ -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";
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|