From ee34bbec89d1b75a2bad85325190dec71aadd1b5 Mon Sep 17 00:00:00 2001 From: zyh Date: Thu, 24 Oct 2024 17:09:38 +0800 Subject: [PATCH 1/3] 123 --- app/store/service/order/Delivery.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/store/service/order/Delivery.php b/app/store/service/order/Delivery.php index 860f368e..e9da5a43 100644 --- a/app/store/service/order/Delivery.php +++ b/app/store/service/order/Delivery.php @@ -50,11 +50,12 @@ class Delivery extends BaseService */ public function delivery(int $orderId, array $param): bool { - if(empty($param['expressId'] && $param['delivery']!=20)) { + + if($param['deliveryMethod'] == self::DELIVERY_METHOD_MANUAL && empty($param['expressId'])) { $this->error = '物流公司不能为空'; return false; } - if (empty($param['expressNo'] && $param['delivery']!=20)) { + if ($param['deliveryMethod'] == self::DELIVERY_METHOD_MANUAL && empty($param['expressNo'])) { $this->error = '物流单号不能为空'; return false; } From 1c24ca1f6054ff374b787ba8c7da0e48a6a4f465 Mon Sep 17 00:00:00 2001 From: lqmac Date: Thu, 24 Oct 2024 22:27:18 +0800 Subject: [PATCH 2/3] 1 --- app/store/controller/Store.php | 2 +- config/module.php | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/store/controller/Store.php b/app/store/controller/Store.php index 7a186be7..29c60f5a 100644 --- a/app/store/controller/Store.php +++ b/app/store/controller/Store.php @@ -80,7 +80,7 @@ class Store extends Controller public function edit(int $storeId): Json { $params = $this->postForm(); - + unset($params['effective_time']); // 更新记录 if (!AdminStoreModel::withoutGlobalScope()->where('store_id', $storeId)->update($params)) { return $this->renderError('更新失败'); diff --git a/config/module.php b/config/module.php index b5e0944b..8e7882b7 100755 --- a/config/module.php +++ b/config/module.php @@ -28,11 +28,11 @@ return [ ], '' => [ 'name' => '商户管理', - 'required' => true, + 'required' => false, 'children' => [ - 'merchant' => ['name' => '商户管理', 'enable' => true], - 'merchant-manage' => ['name' => '商户列表', 'enable' => true], - 'merchant-cate' => ['name' => '商户分类', 'enable' => true], + 'merchant' => ['name' => '商户管理', 'enable' => false], + 'merchant-manage' => ['name' => '商户列表', 'enable' => false], + 'merchant-cate' => ['name' => '商户分类', 'enable' => false], ] ], 'goods' => [ @@ -116,6 +116,7 @@ return [ 'children' => [ 'customer' => ['name' => '客服设置', 'enable' => true], 'shoplist' => ['name' => '商城列表', 'enable' => false], + 'openshop' => ['name' => '开通商城', 'enable' => false], 'storage' => ['name' => '上传设置', 'enable' => true], 'printer' => ['name' => '小票打印机', 'enable' => true], ] From 53a5328f64dc2aa7edf1fd68bdbb2d1e3cc5c1c1 Mon Sep 17 00:00:00 2001 From: lqmac Date: Thu, 24 Oct 2024 22:54:21 +0800 Subject: [PATCH 3/3] 1 --- app/store/controller/Goods.php | 41 +++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/app/store/controller/Goods.php b/app/store/controller/Goods.php index ee24e063..8cca7b52 100644 --- a/app/store/controller/Goods.php +++ b/app/store/controller/Goods.php @@ -180,6 +180,9 @@ class Goods extends Controller if ($model->isEmpty()) { return $this->renderError("该商品已不存在!"); } + if ($model->store_id != $this->storeId) { + return $this->renderError("您不能修复改商品!"); + } if (!in_array($model->channel, ['zy'])) { $params['goods_price'] = $model->goods_price_min; $params['cost_price'] = $model->cost_price_min; @@ -206,6 +209,10 @@ class Goods extends Controller */ public function pool(array $goodsIds, bool $state): Json { + $count = GoodsModel::withoutGlobalScope()->whereIn('goods_id', $goodsIds)->where('store_id', "<>", $this->storeId)->count(); + if ($count > 0) { + return $this->renderError("您不能操作该商品"); + } $model = new GoodsModel; //过滤其他渠道的商品,只能把自营商品加入商品池 $list = GoodsModel::whereIn('goods_id', $goodsIds)->where('channel','zy')->select(); @@ -248,6 +255,10 @@ class Goods extends Controller */ public function state(array $goodsIds, bool $state): Json { + $count = GoodsModel::withoutGlobalScope()->whereIn('goods_id', $goodsIds)->where('store_id', "<>", $this->storeId)->count(); + if ($count > 0) { + return $this->renderError("您不能操作该商品"); + } $model = new GoodsModel; if (!$model->setStatus($goodsIds, $state)) { return $this->renderError($model->getError() ?: '操作失败'); @@ -283,6 +294,10 @@ class Goods extends Controller */ public function setBrand(array $goodsIds, bool $is_brand): Json { + $count = GoodsModel::withoutGlobalScope()->whereIn('goods_id', $goodsIds)->where('store_id', "<>", $this->storeId)->count(); + if ($count > 0) { + return $this->renderError("您不能操作该商品"); + } $model = new GoodsModel; if (!$model->setBrand($goodsIds, $is_brand)) { return $this->renderError($model->getError() ?: '操作失败'); @@ -297,6 +312,10 @@ class Goods extends Controller */ public function setNew(array $goodsIds, bool $is_new): Json { + $count = GoodsModel::withoutGlobalScope()->whereIn('goods_id', $goodsIds)->where('store_id', "<>", $this->storeId)->count(); + if ($count > 0) { + return $this->renderError("您不能操作该商品"); + } $model = new GoodsModel; if (!$model->setNew($goodsIds, $is_new)) { return $this->renderError($model->getError() ?: '操作失败'); @@ -311,6 +330,10 @@ class Goods extends Controller */ public function setInstore(array $goodsIds, bool $is_in_store): Json { + $count = GoodsModel::withoutGlobalScope()->whereIn('goods_id', $goodsIds)->where('store_id', "<>", $this->storeId)->count(); + if ($count > 0) { + return $this->renderError("您不能操作该商品"); + } $model = new GoodsModel; if (!$model->setInstore($goodsIds, $is_in_store)) { return $this->renderError($model->getError() ?: '操作失败'); @@ -325,6 +348,10 @@ class Goods extends Controller */ public function setRank(array $goodsIds, int $paihang): Json { + $count = GoodsModel::withoutGlobalScope()->whereIn('goods_id', $goodsIds)->where('store_id', "<>", $this->storeId)->count(); + if ($count > 0) { + return $this->renderError("您不能操作该商品"); + } $model = new GoodsModel; if (!$model->setRank($goodsIds, $paihang)) { return $this->renderError($model->getError() ?: '操作失败'); @@ -339,6 +366,10 @@ class Goods extends Controller */ public function category(array $goodsIds, array $categoryIds): Json { + $count = GoodsModel::withoutGlobalScope()->whereIn('goods_id', $goodsIds)->where('store_id', "<>", $this->storeId)->count(); + if ($count > 0) { + return $this->renderError("您不能操作该商品"); + } $model = new GoodsModel; foreach ($goodsIds as $key => $goodsId) { @@ -354,7 +385,11 @@ class Goods extends Controller * @return Json */ public function delete(array $goodsIds): Json - { + { + $count = GoodsModel::withoutGlobalScope()->whereIn('goods_id', $goodsIds)->where('store_id', "<>", $this->storeId)->count(); + if ($count > 0) { + return $this->renderError("您不能删除该商品"); + } $model = new GoodsModel; if (!$model->setDelete($goodsIds)) { return $this->renderError($model->getError() ?: '删除失败'); @@ -601,6 +636,10 @@ class Goods extends Controller */ public function jingpin(array $goodsIds, int $is_jingpin): Json { + $count = GoodsModel::withoutGlobalScope()->whereIn('goods_id', $goodsIds)->where('store_id', "<>", $this->storeId)->count(); + if ($count > 0) { + return $this->renderError("您不能操作该商品"); + } $model = new GoodsModel; if (!$model->setIsJingpin($goodsIds, $is_jingpin)) { return $this->renderError($model->getError() ?: '操作失败');