|
|
|
|
@ -222,10 +222,18 @@ class OrdersController extends CommonController
|
|
|
|
|
DB::beginTransaction();
|
|
|
|
|
try {
|
|
|
|
|
$price = (array)json_decode($request->price, true);
|
|
|
|
|
if (!$price) {
|
|
|
|
|
return response()->json([
|
|
|
|
|
"errorcode" => "103",
|
|
|
|
|
"errormsg" => "错误的价格参数"
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
$updated = [];
|
|
|
|
|
foreach ($price as $item) {
|
|
|
|
|
Orders::find($item["order_id"]->update([
|
|
|
|
|
$order = Orders::find($item["order_id"]);
|
|
|
|
|
$order->update([
|
|
|
|
|
"price" => $item["price"]
|
|
|
|
|
]));
|
|
|
|
|
]);
|
|
|
|
|
$res = (new OrderItems())->updateTodayItem($item["order_id"]);
|
|
|
|
|
if (!$res["status"]) {
|
|
|
|
|
return response()->json([
|
|
|
|
|
@ -233,9 +241,10 @@ class OrdersController extends CommonController
|
|
|
|
|
"errormsg" => $res["msg"]
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
$updated[] = $order;
|
|
|
|
|
}
|
|
|
|
|
DB::commit();
|
|
|
|
|
return response()->json(true);
|
|
|
|
|
return response()->json($updated);
|
|
|
|
|
} catch (\Exception $exception) {
|
|
|
|
|
DB::rollBack();
|
|
|
|
|
return response()->json([
|
|
|
|
|
|