|
|
|
|
@ -221,9 +221,27 @@ class OrdersController extends CommonController
|
|
|
|
|
{
|
|
|
|
|
DB::beginTransaction();
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
$price = (array)json_decode($request->price, true);
|
|
|
|
|
foreach ($price as $item) {
|
|
|
|
|
Orders::find($item["order_id"]->update([
|
|
|
|
|
"price" => $item["price"]
|
|
|
|
|
]));
|
|
|
|
|
$res = (new OrderItems())->updateTodayItem($item["order_id"]);
|
|
|
|
|
if (!$res["status"]) {
|
|
|
|
|
return response()->json([
|
|
|
|
|
"errorcode" => "103",
|
|
|
|
|
"errormsg" => $res["msg"]
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
DB::commit();
|
|
|
|
|
return response()->json(true);
|
|
|
|
|
} catch (\Exception $exception) {
|
|
|
|
|
|
|
|
|
|
DB::rollBack();
|
|
|
|
|
return response()->json([
|
|
|
|
|
"errorcode" => $exception->getCode(),
|
|
|
|
|
"errormsg" => $exception->getMessage()
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|