@@ -33,6 +33,10 @@ class OrderItemController extends Controller
if ($cost < 10 && $cost > $xhPrice) {
echo $productId . ' ' . $name . ' 成本:' . $cost . ' 价格:' . $xhPrice . ' 比例:' . $ratio . "\n";
}
+ if (floatval($xhPrice) == 0) {
+ $item->cost = 0;
+ $item->save();
+ }