diff --git a/app/admin/lists/warehouse_product/WarehouseProductLists.php b/app/admin/lists/warehouse_product/WarehouseProductLists.php index 8183d703..3b9976f2 100644 --- a/app/admin/lists/warehouse_product/WarehouseProductLists.php +++ b/app/admin/lists/warehouse_product/WarehouseProductLists.php @@ -89,7 +89,7 @@ class WarehouseProductLists extends BaseAdminDataLists implements ListsSearchInt } if($item->product_id){ $find=StoreProduct::where('id',$item->product_id)->field('image,store_name')->find(); - $item->store_name=$find->store_name; + $item->store_name=$find->store_name.'|'.$item->product_id; $item->image=$find->image; }else{ $item->store_name=''; diff --git a/app/admin/logic/warehouse_product/WarehouseProductLogic.php b/app/admin/logic/warehouse_product/WarehouseProductLogic.php index 78b0db94..508f1f37 100644 --- a/app/admin/logic/warehouse_product/WarehouseProductLogic.php +++ b/app/admin/logic/warehouse_product/WarehouseProductLogic.php @@ -148,7 +148,7 @@ class WarehouseProductLogic extends BaseLogic if ($res) { $res->delete(); if ($res['financial_pm'] == 1) { - WarehouseProductStorege::where('warehouse_id', $res['warehouse_id'])->dec('nums', $res['nums'])->update(); + WarehouseProductStorege::where('warehouse_id', $res['warehouse_id'])->where('product_id',$res['product_id'])->dec('nums', $res['nums'])->update(); } elseif ($res['financial_pm'] == 0) { $find = SystemStoreStorage::where(['outbound_id' => $res['id']])->find(); if ($find) { @@ -162,7 +162,7 @@ class WarehouseProductLogic extends BaseLogic } $find->delete(); } - WarehouseProductStorege::where('warehouse_id', $res['warehouse_id'])->inc('nums', $res['nums'])->update(); + WarehouseProductStorege::where('warehouse_id', $res['warehouse_id'])->where('product_id',$res['product_id'])->inc('nums', $res['nums'])->update(); } return true; diff --git a/app/admin/logic/warehouse_product_storege/WarehouseProductStoregeLogic.php b/app/admin/logic/warehouse_product_storege/WarehouseProductStoregeLogic.php index a1da050d..2bd0c5e6 100644 --- a/app/admin/logic/warehouse_product_storege/WarehouseProductStoregeLogic.php +++ b/app/admin/logic/warehouse_product_storege/WarehouseProductStoregeLogic.php @@ -26,24 +26,7 @@ class WarehouseProductStoregeLogic extends BaseLogic */ public static function add(array $params): bool { - Db::startTrans(); - try { - WarehouseProductStorege::create([ - 'warehouse_id' => $params['warehouse_id'], - 'product_id' => $params['product_id'], - 'nums' => $params['nums'], - 'price' => $params['price'], - 'total_price' => $params['total_price'], - 'status' => $params['status'] - ]); - - Db::commit(); - return true; - } catch (\Exception $e) { - Db::rollback(); - self::setError($e->getMessage()); - return false; - } + return true; } @@ -57,24 +40,6 @@ class WarehouseProductStoregeLogic extends BaseLogic public static function edit(array $params): bool { return true; - Db::startTrans(); - try { - WarehouseProductStorege::where('id', $params['id'])->update([ - 'warehouse_id' => $params['warehouse_id'], - 'product_id' => $params['product_id'], - 'nums' => $params['nums'], - 'price' => $params['price'], - 'total_price' => $params['total_price'], - 'status' => $params['status'] - ]); - - Db::commit(); - return true; - } catch (\Exception $e) { - Db::rollback(); - self::setError($e->getMessage()); - return false; - } } @@ -100,6 +65,6 @@ class WarehouseProductStoregeLogic extends BaseLogic */ public static function detail($params): array { - return WarehouseProductStorege::findOrEmpty($params['id'])->toArray(); + return []; } } \ No newline at end of file diff --git a/app/queue/redis/StoreStorageSend.php b/app/queue/redis/StoreStorageSend.php index e9dd5bed..be8c44b2 100644 --- a/app/queue/redis/StoreStorageSend.php +++ b/app/queue/redis/StoreStorageSend.php @@ -10,7 +10,6 @@ use app\common\model\store_branch_product_exchange\StoreBranchProductExchange; use app\common\model\store_product\StoreProduct; use app\common\model\store_product_attr_value\StoreProductAttrValue; use app\common\model\system_store_storage\SystemStoreStorage; -use app\common\model\warehouse_product_storege\WarehouseProductStorege; use Webman\RedisQueue\Consumer; use support\Log; use think\facade\Db;