| xqd
@@ -580,16 +580,21 @@ class OrderController extends BaseController
|
|
|
{
|
|
|
$order_device = OrderDevice::find($request->input('id'));
|
|
|
if(!$order_device) return $this->error(['msg' => '找不到设备']);
|
|
|
- if($request->input('quantity')){
|
|
|
+
|
|
|
+ if(!empty($request->input('quantity'))){
|
|
|
+ $quantity = $request->input('quantity');
|
|
|
$order_device->update([
|
|
|
- 'quantity' => $request->input('quantity')
|
|
|
+ 'quantity' => intval($quantity)
|
|
|
]);
|
|
|
}
|
|
|
- if($request->input('price')){
|
|
|
+
|
|
|
+ if(!empty($request->input('price'))){
|
|
|
+ $price = $request->input('price');
|
|
|
$order_device->update([
|
|
|
- 'price' => intval($request->input('pricre'))*100
|
|
|
+ 'price' => intval($price)*100
|
|
|
]);
|
|
|
}
|
|
|
+
|
|
|
$order = $this->model->find($order_device['order_id']);
|
|
|
if(!$order) return $this->error(['msg' => '找不到订单']);
|
|
|
$order->updateMoney();
|