diff --git a/app/common/repositories/store/product/ProductRepository.php b/app/common/repositories/store/product/ProductRepository.php index a1074364..915f9660 100644 --- a/app/common/repositories/store/product/ProductRepository.php +++ b/app/common/repositories/store/product/ProductRepository.php @@ -2348,7 +2348,7 @@ class ProductRepository extends BaseRepository //有商品无规格或者无商品无规格,导入商品和规格 $product = $this->getWhere(['source_product_id' => $params['order_product_id'], 'mer_id' => $merId]); if (!empty($product)) { - $attrValue = ProductAttrValue::where('mer_id', $merId)->where('product_id', $product['product_id'])->find(); + $attrValue = ProductAttrValue::where('mer_id', $merId)->where('product_id', $product['product_id'])->where('unique', $params['unique'])->find(); if (!empty($params['order_id'])) { //采购、委托订单导入 $orderMerId = StoreOrder::where('order_id', $params['order_id'])->value('mer_id'); diff --git a/app/controller/api/server/StoreProduct.php b/app/controller/api/server/StoreProduct.php index acc64471..24ba3c60 100644 --- a/app/controller/api/server/StoreProduct.php +++ b/app/controller/api/server/StoreProduct.php @@ -239,11 +239,14 @@ class StoreProduct extends BaseController public function stockIn() { $params = $this->request->param(); + if($params['unique']==''){ + return app('json')->fail('多规格编号不能为空'); + } $res=$this->repository->stockIn($this->merId, $params); if($res){ return app('json')->success('入库成功'); }else{ - return app('json')->success('入库失败'); + return app('json')->fail('入库失败'); } }