diff --git a/app/admin/controller/system_store/SystemStoreController.php b/app/admin/controller/system_store/SystemStoreController.php index e327dc7ec..748652db1 100644 --- a/app/admin/controller/system_store/SystemStoreController.php +++ b/app/admin/controller/system_store/SystemStoreController.php @@ -40,35 +40,6 @@ class SystemStoreController extends BaseAdminController { return $this->dataLists(new SystemStoreSourceLists()); } - /** - * @notes 根据商品源获取门店列表 - * @return \think\response\Json - * @author admin - * @date 2024/05/31 17:45 - */ - public function source_product_update_store() - { - $addList=$this->request->post('addList'); - $product_id=$this->request->post('product_id'); - if($addList){ - foreach ($addList as $key=>$value){ - StoreProductLogic::copy($product_id,$value); - if(StoreProductLogic::hasError()){ - return $this->fail(StoreProductLogic::getError()); - } - } - } - $removeList=$this->request->post('removeList'); - if($removeList){ - foreach ($removeList as $key=>$value){ - StoreProductLogic::store_del($product_id,$value); - if(StoreProductLogic::hasError()){ - return $this->fail(StoreProductLogic::getError()); - } - } - } - return $this->success('设置成功', [], 1, 1); - } /** * @notes 添加门店列表 diff --git a/app/admin/controller/warehouse_order/WarehouseOrderController.php b/app/admin/controller/warehouse_order/WarehouseOrderController.php index 5c2876fb4..bb75e99da 100644 --- a/app/admin/controller/warehouse_order/WarehouseOrderController.php +++ b/app/admin/controller/warehouse_order/WarehouseOrderController.php @@ -125,7 +125,6 @@ class WarehouseOrderController extends BaseAdminController Db::commit(); } catch (\Throwable $e) { Db::rollback(); - d($e); throw new BusinessException($e->getMessage()); } return $this->success('已导入后台队列,请在门店入库记录中查看', [], 1, 1); diff --git a/app/admin/logic/store_product/StoreProductLogic.php b/app/admin/logic/store_product/StoreProductLogic.php index 55614093c..83f64333f 100644 --- a/app/admin/logic/store_product/StoreProductLogic.php +++ b/app/admin/logic/store_product/StoreProductLogic.php @@ -14,6 +14,7 @@ use app\common\model\store_product_cate\StoreProductCate; use app\common\model\system_store\SystemStore; use app\common\model\system_store_storage\SystemStoreStorage; use Illuminate\Support\Facades\Log; +use support\exception\BusinessException; use think\facade\Db; use Webman\RedisQueue\Redis; @@ -101,8 +102,7 @@ class StoreProductLogic extends BaseLogic return true; } catch (\Exception $e) { Db::rollback(); - self::setError($e->getMessage()); - return false; + throw new BusinessException('添加商品失败'.$e->getMessage()); } } @@ -220,8 +220,8 @@ class StoreProductLogic extends BaseLogic return true; } catch (\Exception $e) { Db::rollback(); - self::setError($e->getMessage()); - return false; + throw new BusinessException('编辑商品失败'.$e->getMessage()); + } } @@ -280,8 +280,8 @@ class StoreProductLogic extends BaseLogic return true; } catch (\Exception $e) { Db::rollback(); - self::setError($e->getMessage()); - return false; + throw new BusinessException('删除失败'.$e->getMessage()); + } } @@ -289,6 +289,10 @@ class StoreProductLogic extends BaseLogic /**普通 */ public static function ordinary($product_arr, $store_id, $admin_id, $find) { + $res=StoreBranchProduct::where('store_id',$store_id)->where('product_id',$find['id'])->find(); + if($res){ + return $res; + } $dealCate = self::dealChangeCate($find['cate_id']); $product = [ 'product_id' => $find['id'], @@ -357,8 +361,7 @@ class StoreProductLogic extends BaseLogic return true; } catch (\Exception $e) { Db::rollback(); - Log::error('store-storage队列消费失败: ' . $e->getMessage() . ',line:' . $e->getLine() . ',file:' . $e->getFile()); - return false; + throw new BusinessException('添加兑换商品失败'.$e->getMessage()); } } // else {