afa 10 сар өмнө
parent
commit
f8513ea665

+ 2 - 2
application/api/controller/Order.php

@@ -33,8 +33,8 @@ class Order extends Api
         if(!$validate->scene('add')->check($params)) $this->error($validate->getError());
         
         $order_info = $productPopular->where('id', $params['order_id'])->find();
-        // if($order_info->num == $order_info->stock) $this->error(__("库存不足"));
-        // if(empty($order_info)) $this->error(__("参数有误,无可用产品"));
+        if($order_info->num == $order_info->stock) $this->error(__("库存不足"));
+        if(empty($order_info)) $this->error(__("参数有误,无可用产品"));
         $order_data['order_id']  = $params['order_id'];
         $order_data['product_id']= $params['product_id'];
         $order_data['price']     = $order_info['price'];