weizong song 3 years ago
parent af37910c62
commit 76f53322ab

@ -858,15 +858,19 @@ class OrdersController extends CommonController
}
$customer = $order_items->first()->customer;
$price_changed_paid_items = $order_items->filter(function ($item) use ($request) {
return $request->has("price") && $item->paid_at && ($request->price != $item->total) && date("Ym", strtotime($item->paid_at)) != date("Ym");
return $request->has("price") && $item->paid_at && ($request->price != $item->total);
});
$price_changed_last_month_paid_items = $price_changed_paid_items->filter(function ($item) {
return date("Ym", strtotime($item->paid_at)) != date("Ym");
});
$total_increased = $price_changed_paid_items->count() * $request->price - $price_changed_paid_items->sum("total");
$warnings = [];
$errors = [];
if ($price_changed_paid_items->count()) {
$errors[] = "有" . $price_changed_paid_items->count() . "天已付款的往月子订单已锁定价格,不可修改";
if ($price_changed_last_month_paid_items->count()) {
$errors[] = "有" . $price_changed_last_month_paid_items->count() . "天已付款的往月子订单已锁定价格,不可修改";
}
$manager = $this->guard()->user();

Loading…
Cancel
Save