From 63f428575970b31bde1bc15363279f572052f678 Mon Sep 17 00:00:00 2001 From: lewis <604446095@qq.com> Date: Mon, 20 Jan 2025 15:51:42 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A2=84=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=87=BA=E5=BA=93=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/lists/warehouse_order/WarehouseOrderLists.php | 2 +- app/admin/logic/beforehand_order/BeforehandOrderLogic.php | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/admin/lists/warehouse_order/WarehouseOrderLists.php b/app/admin/lists/warehouse_order/WarehouseOrderLists.php index 9e57f516..22193d91 100644 --- a/app/admin/lists/warehouse_order/WarehouseOrderLists.php +++ b/app/admin/lists/warehouse_order/WarehouseOrderLists.php @@ -49,7 +49,7 @@ class WarehouseOrderLists extends BaseAdminDataLists implements ListsSearchInter public function lists(): array { return WarehouseOrder::where($this->searchWhere) - ->field(['id', 'warehouse_id', 'supplier_id', 'store_id', 'code', 'financial_pm', 'admin_id', 'batch', 'mark', 'purchase', 'total_price', 'status', 'create_time', 'completed_amount', 'outstanding_amount']) + ->field(['id', 'warehouse_id', 'supplier_id', 'store_id', 'code', 'financial_pm', 'admin_id', 'batch', 'mark', 'purchase', 'total_price', 'status', 'create_time', 'completed_amount', 'outstanding_amount', 'oid']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()->each(function ($item) { diff --git a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php index 13ad4ad0..21411135 100644 --- a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php +++ b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php @@ -389,7 +389,7 @@ class BeforehandOrderLogic extends BaseLogic Db::startTrans(); try { $arr = [ - 'oid' => 0, + 'oid' => $order['id'], 'warehouse_id' => $warehouse_id, 'store_id' => $store_id, 'supplier_id' => 0, @@ -436,7 +436,10 @@ class BeforehandOrderLogic extends BaseLogic } $finds = WarehouseProduct::where('oid', $res['id'])->field('sum(nums) as nums,sum(total_price) as total_price')->find(); WarehouseOrder::where('id', $res['id'])->update(['total_price' => $totalPrice, 'nums' => $finds['nums']]); - $order->save(['outbound_id' => $res['id'], 'is_outbound' => 1, 'pay_price' => $totalPrice]); + $result = BeforehandOrder::where('id', $order['id'])->where('outbound_id', 0)->where('is_outbound', 0)->update(['outbound_id' => $res['id'], 'is_outbound' => 1, 'pay_price' => $totalPrice]); + if (!$result) { + throw new BusinessException('出库失败,预订单更新出错'); + } BeforehandOrderCartInfo::where('bhoid', $params['bhoid'])->update(['is_buyer' => -1]); self::confirm(['id' => $params['bhoid']]); Db::commit(); From 0a131e0c165ef13300bdaade3ee76756bdbfad24 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Tue, 21 Jan 2025 15:10:51 +0800 Subject: [PATCH 2/3] =?UTF-8?q?refactor(purchase):=20=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E6=A8=A1=E5=9D=97=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 注释掉 PurchaseProductOfferController 中的 setStoreroomInfoTwo 方法 - 修改 BeforehandOrderLists 中的搜索条件逻辑 - 更新 PurchaseProductOfferLogic 中的采购逻辑: - 移除部分字段的更新 - 调整产品分组价格的设置位置 - 优化接受采购数量的处理流程 - 调整订单总价的计算方式 --- .../PurchaseProductOfferController.php | 12 +-- .../beforehand_order/BeforehandOrderLists.php | 7 +- .../PurchaseProductOfferLogic.php | 80 ++++++------------- 3 files changed, 36 insertions(+), 63 deletions(-) diff --git a/app/admin/controller/purchase_product_offer/PurchaseProductOfferController.php b/app/admin/controller/purchase_product_offer/PurchaseProductOfferController.php index bbe66e3e..9e2ed9db 100644 --- a/app/admin/controller/purchase_product_offer/PurchaseProductOfferController.php +++ b/app/admin/controller/purchase_product_offer/PurchaseProductOfferController.php @@ -109,12 +109,12 @@ class PurchaseProductOfferController extends BaseAdminController PurchaseProductOfferLogic::setStoreroomInfo($params); return $this->success('设置成功', [], 1, 1); } - public function setStoreroomInfoTwo() - { - $params = $this->request->post(); - PurchaseProductOfferLogic::setStoreroomInfoTwo($params); - return $this->success('设置成功', [], 1, 1); - } + // public function setStoreroomInfoTwo() + // { + // $params = $this->request->post(); + // PurchaseProductOfferLogic::setStoreroomInfoTwo($params); + // return $this->success('设置成功', [], 1, 1); + // } /** * @notes 删除采购商品 * @return \think\response\Json diff --git a/app/admin/lists/beforehand_order/BeforehandOrderLists.php b/app/admin/lists/beforehand_order/BeforehandOrderLists.php index e1bc7282..bb29f26d 100644 --- a/app/admin/lists/beforehand_order/BeforehandOrderLists.php +++ b/app/admin/lists/beforehand_order/BeforehandOrderLists.php @@ -77,9 +77,10 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte } if (!empty($this->params['store_staff_id']) || !empty($this->params['is_store'])) { $this->searchWhere[] = ['store_staff_id', '>', 0]; - } else { - $this->searchWhere[] = ['store_staff_id', '=', 0]; - } + } + // else { + // $this->searchWhere[] = ['store_staff_id', '=', 0]; + // } if ($order_rk!='') { $oid=WarehouseOrder::where('financial_pm',1)->where('code','like','%'.$order_rk)->column('id'); $this->searchWhere[] = ['warehousing_id','in',$oid]; diff --git a/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php b/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php index 51e775b2..f318f560 100644 --- a/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php +++ b/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php @@ -222,19 +222,19 @@ class PurchaseProductOfferLogic extends BaseLogic Db::startTrans(); try { $offer->save([ - 'buyer_nums' => $params['buyer_nums'], + // 'buyer_nums' => $params['buyer_nums'], 'supplier_id' => $params['supplier_id'], - 'price' => $params['purchase'], - 'purchase_price' => $params['purchase_price'] ?? 0, + // 'price' => $params['purchase'], + // 'purchase_price' => $params['purchase_price'] ?? 0, 'total_price' => $params['total_price'], 'pay_type' => $params['pay_type'] ?? 0, 'buyer_confirm' => 1, - 'package' => $params['package'], - 'store_info' => $params['store_info'], - 'marques' => $params['marques'], - 'after_sales' => $params['after_sales'], - 'manufacture' => $params['manufacture'], - 'expiration_date' => $params['expiration_date'], + // 'package' => $params['package'], + // 'store_info' => $params['store_info'], + // 'marques' => $params['marques'], + // 'after_sales' => $params['after_sales'], + // 'manufacture' => $params['manufacture'], + // 'expiration_date' => $params['expiration_date'], ]); // $find = StoreProductPrice::where(['offer_id' => $params['id']])->find(); $product = StoreProduct::where('id', $offer['product_id'])->withTrashed()->field('id,store_name,top_cate_id,two_cate_id,cate_id')->find(); @@ -243,36 +243,6 @@ class PurchaseProductOfferLogic extends BaseLogic $order->pay_price = PurchaseProductOffer::where('order_id', $order['id'])->sum('total_price'); $order->total_price = $order->pay_price; $order->save(); - self::setProductGroupPrice($params, $product); - // $data = []; - // $dict_data = DictData::where('type_value', 'price_lv_' . $product['top_cate_id'])->field('name,value')->select(); - // $data['bhoid'] = $offer['order_id']; - // $data['offer_id'] = $params['id']; - // $data['product_id'] = $offer['product_id']; - // $data['purchase_price'] = $params['purchase']; - // $data['status'] = 0; - // if ($dict_data) { - // foreach ($dict_data as $k => $v) { - // if ($v['name'] == 'purchase') { - // $data['purchase_lv'] = $v['value']; - // $lv = bcmul($v['value'], $params['purchase'], 2); - // $data['purchase'] = bcadd($lv, $params['purchase'], 2); - // } elseif ($v['name'] == 'cost') { - // $data['cost_lv'] = $v['value']; - // $lv = bcmul($v['value'], $params['purchase'], 2); - // $data['cost'] = bcadd($lv, $params['purchase'], 2); - // } elseif ($v['name'] == 'price') { - // $data['price_lv'] = $v['value']; - // $lv = bcmul($v['value'], $params['purchase'], 2); - // $data['price'] = bcadd($lv, $params['purchase'], 2); - // } - // } - // } - // if ($find) { - // $find->save($data); - // } else { - // StoreProductPrice::create($data); - // } Db::commit(); $offer['store_name'] = $product['store_name']; $offer['unit_name'] = $unit_name; @@ -288,7 +258,6 @@ class PurchaseProductOfferLogic extends BaseLogic return true; } catch (\Throwable $e) { Db::rollback(); - d($e); throw new BusinessException($e->getMessage()); } } @@ -336,22 +305,25 @@ class PurchaseProductOfferLogic extends BaseLogic { Db::startTrans(); try { - PurchaseProductOffer::where('id', $params['id'])->update(['is_accept' => 1]); - $find = BeforehandOrderCartInfo::where(['bhoid' => $params['bhoid'], 'product_id' => $params['product_id']])->find(); - $data = [ - 'gross_weight' => $params['gross_weight'] ?? 0, - 'net_weight' => $params['net_weight'] ?? 0, - 'accept_num' => $params['accept_num'] ?? 0, - ]; - if ($params['accept_num'] != $find['cart_num']) { - $pay_price = bcmul($params['accept_num'], $find['price'], 2); - $data['pay_price'] = $pay_price; + if($params['accept_num']<=0){ + throw new BusinessException('分拣数量不能小于0'); } - $find->save($data); - if ($params['accept_num'] != $find['cart_num']) { - $pay_price = BeforehandOrderCartInfo::where(['bhoid' => $params['bhoid']])->sum('pay_price'); - BeforehandOrder::where('id', $params['bhoid'])->update(['pay_price' => $pay_price]); + $offer=PurchaseProductOffer::where('id', $params['id'])->find(); + $offer_data = ['buyer_nums' => $params['accept_num'],]; + $offer_data['is_storage'] = 1; + if($offer['total_price']>0){ + $price= bcdiv($offer['total_price'],$params['accept_num'], 2); + $offer_data['price'] = $price; + }else{ + throw new BusinessException('采购总价不能为0'); } + $offer->save($offer_data); + + $pay_price = PurchaseProductOffer::where(['order_id' => $offer['order_id']])->sum('total_price'); + BeforehandOrder::where('id', $offer['bhoid'])->update(['pay_price' => $pay_price]); + $product = StoreProduct::where('id', $offer['product_id'])->withTrashed()->field('id,store_name,top_cate_id,two_cate_id,cate_id')->find(); + $offer['purchase']=$price; + self::setProductGroupPrice($offer, $product); Db::commit(); return true; } catch (\Throwable $e) { From db9257518eec687f107c01d62d91eefa4c1dc35f Mon Sep 17 00:00:00 2001 From: lewis <604446095@qq.com> Date: Tue, 21 Jan 2025 15:48:03 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=87=AA=E8=90=A5?= =?UTF-8?q?=E9=97=A8=E5=BA=97=E4=BB=B7=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BeforehandOrderCartInfoLogic.php | 5 +- .../WarehouseProductLogic.php | 131 ++++++++++++------ app/api/lists/product/ProductLists.php | 5 +- .../StoreProductGroupPrice.php | 13 ++ app/common/model/system_store/SystemStore.php | 10 ++ 5 files changed, 116 insertions(+), 48 deletions(-) diff --git a/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php b/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php index d74df291..d08c2a69 100644 --- a/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php +++ b/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php @@ -258,7 +258,10 @@ class BeforehandOrderCartInfoLogic extends BaseLogic if ($beforehandOrder['order_type'] == 7) { $attrs['is_buying'] = 1; } - BeforehandOrder::where('id', $params['bhoid'])->update($attrs); + $result = BeforehandOrder::where('id', $params['bhoid'])->where('warehousing_id', 0)->where('is_warehousing', 0)->update($attrs); + if (!$result) { + throw new BusinessException('出库失败,预订单更新出错'); + } Db::commit(); return true; } catch (\Throwable $e) { diff --git a/app/admin/logic/warehouse_product/WarehouseProductLogic.php b/app/admin/logic/warehouse_product/WarehouseProductLogic.php index ea046625..c99feaf2 100644 --- a/app/admin/logic/warehouse_product/WarehouseProductLogic.php +++ b/app/admin/logic/warehouse_product/WarehouseProductLogic.php @@ -238,13 +238,6 @@ class WarehouseProductLogic extends BaseLogic $datas['expiration_date'] = strtotime($params['expiration_date']); } $res->save($datas); - $finds = WarehouseProduct::where('oid', $params['oid'])->field('sum(nums) as nums,sum(total_price) as total_price')->find(); - if ($finds) { - WarehouseOrder::where('id', $params['oid'])->update([ - 'nums' => $finds['nums'], - 'total_price' => $finds['total_price'] - ]); - } } Db::commit(); return $res; @@ -266,22 +259,20 @@ class WarehouseProductLogic extends BaseLogic { $res = WarehouseProduct::where('id', $params['id'])->find(); if ($res) { - $res->delete(); - if ($res['financial_pm'] == 1) { - $find = WarehouseProductStorege::where('warehouse_id', $res['warehouse_id'])->where('product_id', $res['product_id'])->dec('nums', $res['nums'])->save(); - SqlChannelLog('WarehouseProductStorege', $find['id'], $res['nums'], -1, Request()->url(),$admin_id); - } elseif ($res['financial_pm'] == 0) { - $find = WarehouseProductStorege::where('warehouse_id', $res['warehouse_id'])->where('product_id', $res['product_id'])->inc('nums', $res['nums'])->save(); - SqlChannelLog('WarehouseProductStorege', $find['id'], $res['nums'], 1, Request()->url(),$admin_id); + Db::startTrans(); + try { + if ($res['financial_pm'] == 1) { + self::incProductDecStorege($res, $res['nums'], $admin_id); + } elseif ($res['financial_pm'] == 0) { + self::decProductIncStorege($res, $res['nums'], $admin_id); + } + $res->delete(); + Db::commit(); + return true; + } catch (\Throwable $th) { + Db::rollback(); + throw new BusinessException($th->getMessage()); } - $find = WarehouseProduct::where('oid', $res['oid'])->field('sum(nums) as nums,sum(total_price) as total_price')->find(); - if ($find) { - WarehouseOrder::where('id', $res['oid'])->update([ - 'nums' => $find['nums'], - 'total_price' => $find['total_price'] - ]); - } - return true; } throw new BusinessException('没有查到出入库信息'); } @@ -339,12 +330,6 @@ class WarehouseProductLogic extends BaseLogic } $res->save($datas); - $finds = WarehouseProduct::where('oid', $res['oid'])->field('sum(nums) as nums')->find(); - if ($finds) { - WarehouseOrder::where('id', $res['oid'])->update([ - 'nums' => $finds['nums'], - ]); - } } Db::commit(); } catch (\Throwable $th) { @@ -370,28 +355,84 @@ class WarehouseProductLogic extends BaseLogic } //减少 - private static function decProductIncStorege($res,$nums,$admin_id=0) + private static function decProductIncStorege($warehouseProduct,$nums,$admin_id=0) { - $res1 = WarehouseProductStorege::where('warehouse_id', $res['warehouse_id']) - ->where('product_id', $res['product_id'])->find(); - $res1->nums = bcadd($res1->nums,$nums,2); - $res1->save(); - SqlChannelLog('WarehouseProductStorege', $res1['id'], $nums, 1, Request()->url(),$admin_id); - - WarehouseProduct::where('id',$res['id'])->update(['nums'=>bcsub($res['nums'],$nums,2)]); - SqlChannelLog('WarehouseProduct', $res['id'], $nums, -1, Request()->url(),$admin_id); + $warehouseProductStorage = WarehouseProductStorege::where('warehouse_id', $warehouseProduct['warehouse_id']) + ->where('product_id', $warehouseProduct['product_id'])->find(); + $warehouseProductStorage->nums = bcadd($warehouseProductStorage->nums,$nums,2); + $warehouseProductStorage->save(); + SqlChannelLog('WarehouseProductStorege', $warehouseProductStorage['id'], $nums, 1, Request()->url(),$admin_id); + + $update = [ + 'nums' => bcsub($warehouseProduct['nums'], $nums, 2), + 'total_price' => bcsub($warehouseProduct['total_price'], bcmul($nums, $warehouseProduct['price'], 2), 2), + ]; + WarehouseProduct::where('id',$warehouseProduct['id'])->update($update); + SqlChannelLog('WarehouseProduct', $warehouseProduct['id'], $nums, -1, Request()->url(),$admin_id); + + $find = WarehouseProduct::where('oid', $warehouseProduct['oid'])->field('sum(nums) as nums,sum(total_price) as total_price')->find(); + if ($find) { + WarehouseOrder::where('id', $warehouseProduct['oid'])->update([ + 'nums' => $find['nums'], + 'total_price' => $find['total_price'] + ]); + } + + self::updateStoreStorage($warehouseProduct['oid'], $nums, 'dec'); } //增加 - private static function incProductDecStorege($res, $nums,$admin_id=0) + private static function incProductDecStorege($warehouseProduct, $nums,$admin_id=0) { - $res1 = WarehouseProductStorege::where('warehouse_id', $res['warehouse_id']) - ->where('product_id', $res['product_id'])->find(); - $res1->nums = bcsub($res1->nums,$nums,2); - $res1->save(); - SqlChannelLog('WarehouseProductStorege', $res1['id'], $nums, -1, Request()->url(),$admin_id); + $warehouseProductStorage = WarehouseProductStorege::where('warehouse_id', $warehouseProduct['warehouse_id']) + ->where('product_id', $warehouseProduct['product_id'])->find(); + $warehouseProductStorage->nums = bcsub($warehouseProductStorage->nums,$nums,2); + $warehouseProductStorage->save(); + SqlChannelLog('WarehouseProductStorege', $warehouseProductStorage['id'], $nums, -1, Request()->url(),$admin_id); - WarehouseProduct::where('id',$res['id'])->update(['nums'=>bcadd($res['nums'],$nums,2)]); - SqlChannelLog('WarehouseProduct', $res['id'], $nums, 1, Request()->url(),$admin_id); + $update = [ + 'nums' => bcadd($warehouseProduct['nums'], $nums, 2), + 'total_price' => bcadd($warehouseProduct['total_price'], bcmul($nums, $warehouseProduct['price'], 2), 2), + ]; + WarehouseProduct::where('id',$warehouseProduct['id'])->update($update); + SqlChannelLog('WarehouseProduct', $warehouseProduct['id'], $nums, 1, Request()->url(),$admin_id); + + $find = WarehouseProduct::where('oid', $warehouseProduct['oid'])->field('sum(nums) as nums,sum(total_price) as total_price')->find(); + if ($find) { + WarehouseOrder::where('id', $warehouseProduct['oid'])->update([ + 'nums' => $find['nums'], + 'total_price' => $find['total_price'] + ]); + } + + self::updateStoreStorage($warehouseProduct['oid'], $nums); } + + /** + * 更新门店库存和门店入库单 + * @param $outboundId + * @param $nums + * @param $type + * @return void + */ + private static function updateStoreStorage($outboundId, $nums, $type = 'inc') + { + $storeStorage = SystemStoreStorage::where('outbound_id', $outboundId)->find(); + if (empty($storeStorage)) { + return; + } + $storeStorage->nums = $type == 'inc' ? $storeStorage->nums + $nums : $storeStorage->nums - $nums; + $storeStorage->save(); + if ($storeStorage->status == 0) { + return; + } + // 门店入库单已确认,增加/减少 门店库存 + $storeBranchProduct = StoreBranchProduct::where('store_id', $storeStorage->store_id) + ->where('product_id', $storeStorage->product_id)->find(); + if (!empty($storeBranchProduct)) { + $storeBranchProduct->stock = $type == 'inc' ? $storeBranchProduct->stock + $nums : $storeBranchProduct->stock - $nums; + $storeBranchProduct->save(); + } + } + } diff --git a/app/api/lists/product/ProductLists.php b/app/api/lists/product/ProductLists.php index febedfbd..517c7a5e 100644 --- a/app/api/lists/product/ProductLists.php +++ b/app/api/lists/product/ProductLists.php @@ -10,6 +10,7 @@ use app\common\model\store_product\StoreProduct; use app\common\lists\ListsSearchInterface; use app\common\model\Config; use app\common\model\store_product_group_price\StoreProductGroupPrice; +use app\common\model\system_store\SystemStore; use app\common\model\user\User; //use app\common\model\goods\GoodsLabel; use think\facade\Db; @@ -104,7 +105,7 @@ class ProductLists extends BaseApiDataLists implements ListsSearchInterface, Lis $user_ship=-1; if ($uid > 0) { $user_ship = User::where('id', $uid)->value('user_ship'); - if (in_array($user_ship, [4, 6, 7])) { + if (in_array($user_ship, [4, 6, 7]) && !empty($this->params['store_id']) && !SystemStore::isSelfOperate($this->params['store_id'])) { $fields = 'id,id product_id,top_cate_id,cate_id,store_name,cost,vip_price,purchase,cost price,bar_code,image,sales,store_info,delete_time,unit,batch,top_cate_id,two_cate_id,stock,is_lack'; } } @@ -128,7 +129,7 @@ class ProductLists extends BaseApiDataLists implements ListsSearchInterface, Lis return $item; }) ->toArray(); - $list = StoreProductGroupPrice::resetProductsPrice($list, $user_ship); + $list = StoreProductGroupPrice::resetStoreProductPrice($list, $user_ship, $this->params['store_id'] ?? 0); return $list; } diff --git a/app/common/model/store_product_group_price/StoreProductGroupPrice.php b/app/common/model/store_product_group_price/StoreProductGroupPrice.php index c587e1e8..7807a043 100644 --- a/app/common/model/store_product_group_price/StoreProductGroupPrice.php +++ b/app/common/model/store_product_group_price/StoreProductGroupPrice.php @@ -4,6 +4,7 @@ namespace app\common\model\store_product_group_price; use app\common\model\BaseModel; +use app\common\model\system_store\SystemStore; use think\model\concern\SoftDelete; @@ -40,5 +41,17 @@ class StoreProductGroupPrice extends BaseModel } return $product; } + + public static function resetStoreProductPrice($productList, $userShip, $shopId) + { + if ($shopId > 0 && SystemStore::isSelfOperate($shopId) && $userShip > 0) { + foreach ($productList as &$item) { + $item['price'] = $item['vip_price']; + } + return $productList; + } else { + return self::resetProductsPrice($productList, $userShip); + } + } } \ No newline at end of file diff --git a/app/common/model/system_store/SystemStore.php b/app/common/model/system_store/SystemStore.php index dc456472..d8286fb0 100644 --- a/app/common/model/system_store/SystemStore.php +++ b/app/common/model/system_store/SystemStore.php @@ -48,4 +48,14 @@ class SystemStore extends BaseModel return in_array($storeId, [5]); } + /** + * 是否自营门店 + * @param $storeId + * @return bool + */ + public static function isSelfOperate($storeId): bool + { + return !in_array($storeId, [21, 22, 15, 7]); + } + } \ No newline at end of file