Merge pull request 'feat: 添加存储库产品逻辑和店铺存储发送功能' (#104) from dev into rose

Reviewed-on: #104
This commit is contained in:
mkm 2024-08-05 14:14:49 +08:00
commit 07e1f331ce
2 changed files with 2 additions and 4 deletions

View File

@ -34,6 +34,7 @@ class WarehouseProductLogic extends BaseLogic
try {
$data = [
'warehouse_id' => $params['warehouse_id'],
'store_id' => $params['store_id']??0,
'product_id' => $params['product_id'],
'financial_pm' => $params['financial_pm'],
'batch' => 0,
@ -59,6 +60,7 @@ class WarehouseProductLogic extends BaseLogic
return true;
} catch (\Exception $e) {
Db::rollback();
Log::error($e->getMessage().',file:'.$e->getFile().',line:'.$e->getLine());
self::setError($e->getMessage());
return false;
}
@ -80,7 +82,6 @@ class WarehouseProductLogic extends BaseLogic
'warehouse_id' => $params['warehouse_id'],
'product_id' => $params['product_id'],
'financial_pm' => $params['financial_pm'],
'batch' => WarehouseProduct::where(['product_id' => $params['product_id'], 'warehouse_id' => $params['warehouse_id'], 'financial_pm' => $params['financial_pm']])->count(),
'nums' => $params['nums'],
'price' => $params['price'],
'admin_id' => $params['admin_id'],
@ -101,7 +102,6 @@ class WarehouseProductLogic extends BaseLogic
return $res;
} catch (\Exception $e) {
Db::rollback();
d($e);
self::setError($e->getMessage());
return false;
}

View File

@ -87,7 +87,6 @@ class StoreStorageSend implements Consumer
if ($product_arr['stock'] > 0) {
$this->storage($find, $store_id, $admin_id, $product_arr,$warehouse_id);
}
StoreProductLogic::updateGoodsclass($find['cate_id'],$store_id);
Db::commit();
return true;
} catch (\Exception $e) {
@ -138,7 +137,6 @@ class StoreStorageSend implements Consumer
if ($product_arr['stock'] > 0) {
$this->storage($find, $store_id, $admin_id, $product_arr,$warehouse_id);
}
// StoreProductLogic::updateGoodsclass($find['cate_id'],$store_id);
Db::commit();
return true;
} catch (\Exception $e) {