This commit is contained in:
mkm 2023-11-16 15:23:16 +08:00
parent b9298d45c0
commit 8c716b11e2

View File

@ -2338,14 +2338,6 @@ class ProductRepository extends BaseRepository
$model = new PurchaseRecord();
$stockIn = $params['number'] ?? 0;
$price = $params['price'] ?? 0;
if ($stockIn == 0) {
$number=$model->where('order_id',$params['order_id'])
->where('order_product_id',$params['order_product_id'])->where('order_unique',$params['order_unique'])->value('number');
if($number<=0){
throw new ValidateException('数量不能为空');
}
$stockIn = $number;
}
if (empty($params['product_id']) && !empty($params['order_product_id'])) {
//有商品无规格或者无商品无规格,导入商品和规格
$product = $this->getWhere(['source_product_id' => $params['order_product_id'], 'mer_id' => $merId]);
@ -2362,6 +2354,8 @@ class ProductRepository extends BaseRepository
}
}
if ($orderProduct->is_imported == 0) {
$stockIn=$orderProduct['product_num'];
ProductAttrValue::where('mer_id', $merId)
->where('product_id', $product['product_id'])