Prechádzať zdrojové kódy

Merge branch 'master' into dev

shish 11 mesiacov pred
rodič
commit
f49224b8c3

+ 3 - 3
app-ghs/controllers/ApplyController.php

@@ -95,6 +95,7 @@ class ApplyController extends BaseController
         $post = Yii::$app->request->post();
         $authCode = $post['authCode'] ?? '';
         $mobile = $post['mobile'] ?? '';
+        $miniOpenId = $post['miniOpenId'] ?? '';
         if (empty($mobile)) {
             util::fail('请填写手机号');
         }
@@ -103,10 +104,10 @@ class ApplyController extends BaseController
         }
 
         $inviteCode = $post['inviteCode'] ?? '';
-        if (empty($inviteCode)) {
+        if (empty($inviteCode) && !empty($miniOpenId)) {
             util::fail('请填写邀请码');
         }
-        if ($inviteCode != 2025) {
+        if ($inviteCode != 2025 && !empty($miniOpenId)) {
             util::fail('邀请码错误');
         }
 
@@ -157,7 +158,6 @@ class ApplyController extends BaseController
                 util::fail('验证码错误');
             }
             $adminName = $post['adminName'] ?? '';
-            $miniOpenId = $post['miniOpenId'] ?? '';
             $adminInfo = ['name' => $adminName, 'mobile' => $mobile, 'style' => $ptStyle, 'ghsMiniOpenId' => $miniOpenId];
             $fromApp = dict::getDict('userSourceGetId', 'app', 'id');
             $admin = AdminClass::replaceAdmin($adminInfo, $fromApp);

+ 73 - 61
app-ghs/controllers/IntraCityController.php

@@ -35,70 +35,69 @@ class IntraCityController extends BaseController
 {
     public $guestAccess = ['callback'];
 
+    //申请开通跑腿 ssh
+    public function actionApply()
+    {
+        IntraCityExpress::applyStore();
+    }
+
     /**
      * 创建门店
      * POST /intra-city/create-store
      */
     public function actionCreateStore()
     {
-        try {
-            $shop = $this->shop;
-            $shopName = $shop->shopName ?? '';
-            $sjName = $shop->merchantName ?? '';
-            $name = $shopName == '首店' ? $sjName : $sjName . ' ' . $shopName;
-
-            $storeData = [
-                'out_store_id' => $this->mainId, //自定义门店编号
-                'store_name' => $name,
-                'address_info' => [
-                    'province' => $shop->province,
-                    'city' => $shop->city,
-                    'area' => $shop->dist,
-                    'street' => '',
-                    'house' => $shop->floor ? $shop->address . $shop->floor : $shop->address,
-                    'lat' => $shop->lat,
-                    'lng' => $shop->long,
-                    'phone' => $shop->telephone
-                ]
-            ];
-
-            // 验证必填参数
-            $requiredFields = ['out_store_id', 'store_name', 'address_info'];
-            foreach ($requiredFields as $field) {
-                if (empty($storeData[$field])) {
-                    util::fail("缺少必填参数:{$field}");
-                }
-            }
-
-            // 创建门店前,检查是否已经 开通门店权限 (有wxStoreId,即说明开通了)
-            $main = MainClass::getById($this->mainId, true, 'id, wxStoreId');
-
-            // 查询是否存在 wx_store_id,不存在则执行apply
-            if ($main->wxStoreId == '') {
-//                $re = IntraCityExpress::applyStore();
-//                if (!is_array($re)) {
-//                    $re = Json::decode($re, true);
-//                }
-//                if ($re['errcode'] != 0) {
-//                    Yii::error("开通门店权限失败:" . $re['errmsg']);
-//                    util::fail('开通门店权限失败');
-//                }
-            }
+        $shop = $this->shop;
+        $shopName = $shop->shopName ?? '';
+        $sjName = $shop->merchantName ?? '';
+        $name = $shopName == '首店' ? $sjName : $sjName . ' ' . $shopName;
+        if (empty($shop->lat) || empty($shop->long)) {
+            util::fail('没有经纬度,请修改地址');
+        }
+        if (empty($shop->address)) {
+            util::fail('地址缺失,请修改');
+        }
 
-            $result = IntraCityExpress::createStore($storeData);
-            if ($result['errcode'] === 0) {
-                // 保存微信门店编号(wx_store_id)
-                $main->wxStoreId = $result['wx_store_id'];
-                $main->save();
+        $adminId = $this->adminId;
+        util::checkRepeatCommit($adminId, 3);
 
-                util::success($result, "门店创建成功");
-            } else {
-                Yii::error("门店创建失败:" . $result['errmsg']);
-                util::fail($result['errmsg']);
+        $storeData = [
+            'out_store_id' => $this->mainId, //自定义门店编号
+            'store_name' => $name,
+            'address_info' => [
+                'province' => $shop->province,
+                'city' => $shop->city,
+                'area' => $shop->dist,
+                'street' => '',
+                'house' => $shop->address . $shop->floor,
+                'lat' => $shop->lat,
+                'lng' => $shop->long,
+                'phone' => $shop->telephone
+            ]
+        ];
+        // 验证必填参数
+        $requiredFields = ['out_store_id', 'store_name', 'address_info'];
+        foreach ($requiredFields as $field) {
+            if (empty($storeData[$field])) {
+                util::fail("缺少必填参数:{$field}");
             }
-        } catch (\Exception $e) {
-            Yii::error("门店创建失败:" . $e->getMessage());
-            util::fail("系统出错");
+        }
+        // 创建门店前,检查是否已经 开通门店权限 (有wxStoreId,即说明开通了)
+        $main = $this->main;
+        if (!empty($main->wxStoreId)) {
+            util::fail('已经创建门店,请刷新');
+        }
+        $result = IntraCityExpress::createStore($storeData);
+        if ($result['errcode'] === 0) {
+            // 保存微信门店编号(wx_store_id)
+            $main->wxStoreId = $result['wx_store_id'];
+            $main->save();
+            util::success($result, "门店创建成功");
+        } else {
+            $errMsg = $result['errmsg'] ?? '';
+            Yii::error("门店创建失败:" . $errMsg);
+            noticeUtil::push("跑腿创建门店报错:" . $errMsg, '15280215347');
+            util::fail('创建失败,请联系客服');
         }
     }
 
@@ -137,8 +136,9 @@ class IntraCityController extends BaseController
     public function actionUpdateStore()
     {
         // 首先从门店扩展表查询是否已经创建
-        $main = MainClass::getById($this->mainId, false, 'id, wxStoreId');
-        if ($main['wxStoreId'] == '') {
+        $main = $this->main;
+        $wxStoreId = $main->wxStoreId;
+        if (empty($wxStoreId)) {
             util::fail('未创建门店,请先创建');
         }
 
@@ -147,8 +147,18 @@ class IntraCityController extends BaseController
         $sjName = $shop->merchantName ?? '';
         $name = $shopName == '首店' ? $sjName : $sjName . ' ' . $shopName;
 
+        $adminId = $this->adminId;
+        util::checkRepeatCommit($adminId, 3);
+
+        if (empty($shop->lat) || empty($shop->long)) {
+            util::fail('没有经纬度,请修改地址');
+        }
+        if (empty($shop->address)) {
+            util::fail('地址缺失,请修改');
+        }
+
         $storeData = [
-            'keys' => ['wx_store_id' => $main['wxStoreId']],
+            'keys' => ['wx_store_id' => $wxStoreId],
             'content' => [
                 'store_name' => $name,
                 'address_info' => [
@@ -156,7 +166,7 @@ class IntraCityController extends BaseController
                     'city' => $shop->city,
                     'area' => $shop->dist,
                     'street' => '',
-                    'house' => $shop->floor ? $shop->address . $shop->floor : $shop->address,
+                    'house' => $shop->address . $shop->floor,
                     'lat' => $shop->lat,
                     'lng' => $shop->long,
                     'phone' => $shop->telephone
@@ -169,8 +179,10 @@ class IntraCityController extends BaseController
         if ($result['errcode'] === 0) {
             util::success($result, "门店更新成功");
         } else {
-            Yii::error("门店更新失败:" . $result['errmsg']);
-            util::fail($result['errmsg']);
+            $errMsg = $result['errmsg'] ?? '';
+            Yii::error("门店更新失败:" . $errMsg);
+            noticeUtil::push("销花宝,跑腿修改门店报错:" . $errMsg, '15280215347');
+            util::fail('更新失败,请联系客服');
         }
     }
 

+ 18 - 15
app-ghs/controllers/PicTextController.php

@@ -1,4 +1,5 @@
 <?php
+
 namespace ghs\controllers;
 
 use Yii;
@@ -23,7 +24,7 @@ class PicTextController extends BaseController
         $where['mainId'] = $this->mainId;
         $where['delStatus'] = 0;
         // $where['type'] = $type; // 需求需要所有都展示,不分类别
-        
+
         $list = PicTextClass::getList('id, title, addTime', $where, 'addTime desc');
         util::success($list);
     }
@@ -35,7 +36,7 @@ class PicTextController extends BaseController
     {
         $post = Yii::$app->request->post();
         $content = $post['content'];
-        
+
         $post['content'] = $content;
         $post['mainId'] = $this->mainId;
         // $post['staffId'] = intval($this->shopAdmin->id);
@@ -71,21 +72,23 @@ class PicTextController extends BaseController
     public function actionSwitch()
     {
         $post = Yii::$app->request->post();
-        $switch = intval($post['switch']);
-        $shopId = intval($this->shopId);
-        if ($shopId <= 0) {
-            util::fail('门店出错');
+        $switch = $post['switch'] ?? 0;
+        $shopId = $this->shopId;
+        $picTextId = intval($post['picTextId']);
+        $ext = ShopExtClass::getByCondition(['shopId' => $shopId], true);
+        if (empty($ext)) {
+            util::fail('门店信息缺失呢');
         }
-        if($switch == 1) {
-            $picTextId = intval($post['picTextId']);
-            $updateCount = ShopExtClass::updateByCondition(['shopId' => $shopId], ['purchaseGuide' => $picTextId]);
-        }else{
-            $updateCount = ShopExtClass::updateByCondition(['shopId' => $shopId], ['purchaseGuide' => 0]);
-        }
-        if ($updateCount <= 0) {
-            util::fail('变更失败');
+        if ($switch == 1) {
+            if (empty($picTextId) || !is_numeric($picTextId)) {
+                util::fail('请选择图文');
+            }
+            $ext->purchaseGuide = $picTextId;
+        } else {
+            $ext->purchaseGuide = 0;
         }
-        util::success('变更成功');
+        $ext->save();
+        util::complete('修改成功');
     }
 
     public function actionDel()

+ 5 - 6
app-ghs/controllers/ShopController.php

@@ -693,11 +693,10 @@ class ShopController extends BaseController
         $shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], false, false, 'id, shopId, purchaseGuide');
         if ($shopExt['purchaseGuide'] > 0) {
             $picText = PicTextClass::getById($shopExt['purchaseGuide'], false, 'id, title');
+            $shopExt['title'] = $picText['title'] ?? '';
         }
-        if ($shopExt) {
-            $shopExt['title'] = isset($picText['title']) ? $picText['title'] : '';
-            util::success(['shopExt' => $shopExt]);
-        }
-        util::fail('获取数据失败');
+        $shop = $this->shop;
+        util::success(['shopExt' => $shopExt, 'shop' => $shop]);
     }
-}
+
+}

+ 81 - 1
app-ghs/controllers/ShopExtController.php

@@ -5,6 +5,7 @@ namespace ghs\controllers;
 use biz\product\classes\XjClass;
 use biz\shop\classes\ShopExtClass;
 use bizGhs\order\classes\PurchaseOrderClass;
+use bizGhs\product\classes\ProductClass;
 use common\components\printUtil;
 use common\components\util;
 use Yii;
@@ -14,6 +15,85 @@ class ShopExtController extends BaseController
 
     public $guestAccess = [];
 
+    //修改拓展信息表 ssh 20251005
+    public function actionModifyExt()
+    {
+        $post = Yii::$app->request->post();
+        $arr = [];
+        if (isset($post['orderFlow'])) {
+            $arr['orderFlow'] = $post['orderFlow'];
+        }
+        if (isset($post['thirdSend'])) {
+            $arr['thirdSend'] = $post['thirdSend'];
+        }
+        if (isset($post['thirdSendFee'])) {
+            $arr['thirdSendFee'] = $post['thirdSendFee'];
+        }
+        if (empty($arr)) {
+            util::fail('没有需要修改');
+        }
+        $shopId = $this->shopId;
+        \bizHd\shop\classes\ShopExtClass::updateByCondition(['shopId' => $shopId], $arr);
+        util::complete('修改成功');
+    }
+
+    //设置处理花材、扫码收款和直接收款使用的花材 ssh 20250905
+    public function actionSetItem()
+    {
+        $post = Yii::$app->request->post();
+        $shopId = $this->shopId;
+        $shop = $this->shop;
+        $lsShopId = $shop->lsShopId ?? 0;
+        $lsExt = null;
+        //零售端需要同步修改
+        if (!empty($lsShopId)) {
+            $lsExt = \bizHd\shop\classes\ShopExtClass::getByCondition(['shopId' => $lsShopId], true);
+        }
+        $ext = \bizHd\shop\classes\ShopExtClass::getByCondition(['shopId' => $shopId], true);
+        $losingItem = $post['losingItem'] ?? 0;
+        if (!empty($losingItem)) {
+            $info = ProductClass::getById($losingItem, true);
+            if ($info->mainId != $this->mainId) {
+                util::fail('不是你的花材呢,编号099323');
+            }
+            $ext->losingItem = $losingItem;
+            $ext->save();
+            if (!empty($lsExt)) {
+                $lsExt->losingItem = $losingItem;
+                $lsExt->save();
+            }
+        }
+        $zjGatheringItem = $post['zjGatheringItem'] ?? 0;
+        if (!empty($zjGatheringItem)) {
+            $info = ProductClass::getById($losingItem, true);
+            if ($info->mainId != $this->mainId) {
+                util::fail('不是你的花材呢,编号099324');
+            }
+            $ext->zjGatheringItem = $zjGatheringItem;
+            $ext->save();
+            if (!empty($lsExt)) {
+                $lsExt->zjGatheringItem = $zjGatheringItem;
+                $lsExt->save();
+            }
+        }
+        util::complete('修改成功');
+    }
+
+    public function actionInfo()
+    {
+        $ext = $this->shopExt;
+        $losingItemId = $ext->losingItem ?? 0;
+        $losingItem = ProductClass::getById($losingItemId, true);
+        $losingItemName = $losingItem->name ?? '';
+        $zjGatheringItemId = $ext->zjGatheringItem ?? 0;
+        $zjGatheringItem = ProductClass::getById($zjGatheringItemId, true);
+        $zjGatheringItemName = $zjGatheringItem->name ?? '';
+        $arr = $ext->attributes ?? [];
+        $arr['losingItemName'] = $losingItemName;
+        $arr['zjGatheringItemName'] = $zjGatheringItemName;
+        util::success($arr);
+    }
+
     //添加外采打印机  ssh 20230618
     public function actionAddWcPrint()
     {
@@ -242,4 +322,4 @@ class ShopExtController extends BaseController
         util::complete();
     }
 
-}
+}

+ 4 - 3
app-ghs/controllers/TestController.php

@@ -398,9 +398,10 @@ class TestController extends BaseController
             //['name' => '济南伟伟鲜花批发', 'merchantNo' => '8224510599200EL', 'wx' => [789073494, 789074603], 'zfb' => '2088670850497224'],
             //['name' => '赣州紫荆鲜花批发', 'merchantNo' => '82242805992004J', 'wx' => [790052021, 790051859], 'zfb' => '2088670969143838'],
             //['name' => '莆田鲜花闪送', 'merchantNo' => '82239405992005W', 'wx' => [808858266, 808858114], 'zfb' => '2088970298325670'],
-            ['name' => '安溪中花花卉', 'merchantNo' => '8223970599200DY', 'wx' => [812909945, 812909506], 'zfb' => '2088970630094026'],
-            ['name' => '水头十里花田鲜花', 'merchantNo' => '8223970599200DX', 'wx' => [812680599, 812680180], 'zfb' => '2088970615112103'],
-            ['name' => '泉州沙丘鲜花批发', 'merchantNo' => '8223970599200DV', 'wx' => [812653846, 812652998], 'zfb' => '2088970612345533'],
+            //['name' => '德惠心愿鲜花批发', 'merchantNo' => '82224105992007Q', 'wx' => [814787456, 814787660], 'zfb' => '2088970763740773'],
+            //['name' => '安溪中花花卉', 'merchantNo' => '8223970599200DY', 'wx' => [812909945, 812909506], 'zfb' => '2088970630094026'],
+            //['name' => '水头十里花田鲜花', 'merchantNo' => '8223970599200DX', 'wx' => [812680599, 812680180], 'zfb' => '2088970615112103'],
+            //['name' => '泉州沙丘鲜花批发', 'merchantNo' => '8223970599200DV', 'wx' => [812653846, 812652998], 'zfb' => '2088970612345533'],
             //['name' => '昆明小向鲜花', 'merchantNo' => '8227310599200UX', 'wx' => [811911098, 811911180], 'zfb' => '2088970555233957'],
             //['name' => '惠安花优美', 'merchantNo' => '8223970599200DP', 'wx' => [811651765, 811651866], 'zfb' => '2088970528927690'],
             //['name' => '小榄淘花里', 'merchantNo' => '8226030599200A2', 'wx' => [809357489, 809358311], 'zfb' => '2088970343842282'],

+ 44 - 41
app-hd/controllers/ApplyController.php

@@ -124,48 +124,49 @@ class ApplyController extends BaseController
     {
         $connection = Yii::$app->db;
         $transaction = $connection->beginTransaction();
-        try {
 
-            $post = Yii::$app->request->post();
+        $post = Yii::$app->request->post();
 
-            //前期限制只有批发店邀请了才能注册
-            $ghsShopAdminId = $post['ghsShopAdminId'] ?? 0;
-            $hdShopAdminId = $post['hdShopAdminId'] ?? 0;
-            if (empty($ghsShopAdminId) && empty($hdShopAdminId)) {
-                //util::fail('批发店推荐才能注册,编号:' . $ghsShopAdminId . ' ' . $hdShopAdminId);
-            }
+        //前期限制只有批发店邀请了才能注册
+        $ghsShopAdminId = $post['ghsShopAdminId'] ?? 0;
+        $hdShopAdminId = $post['hdShopAdminId'] ?? 0;
+        if (empty($ghsShopAdminId) && empty($hdShopAdminId)) {
+            //util::fail('批发店推荐才能注册,编号:' . $ghsShopAdminId . ' ' . $hdShopAdminId);
+        }
 
-            $shopName = $post['name'] ?? '';
-            if (empty($shopName)) {
-                util::fail('名称不能为空');
-            }
-            $mobile = $post['mobile'] ?? '';
-            if (stringUtil::isMobile($mobile) == false) {
-                util::fail('请填写正确手机号');
-            }
-            if (stringUtil::getWordNum($shopName) > 8) {
-                util::fail('名称不能超过8个汉字');
-            }
-            $arr = ['斗南鲜花', '惠雅鲜花', '纯彩花艺', '泉城鲜花', '杭州斗南', '惠雅', '国恋', '花悠星', '勇记', '丰行', '昱成', '问境', '珑松'];
-            foreach ($arr as $it) {
-                if (strstr($shopName, $it) != null) {
-                    util::fail('花店名称已经存在,请换个名称');
-                }
-            }
-            $has = SjClass::getByCondition(['name' => $shopName]);
-            if (!empty($has)) {
-                //util::fail('名称已经被别人使用,请换个名字,或者名字后面加个2');
-            }
-            $has = ApplyClass::getByCondition(['mobile' => $mobile]);
-            if (!empty($has)) {
-                //手机号开了零售店不能再开批发店,开了批发店不能再开零售店!!
-                util::fail('手机号已经申请过了');
-            }
-            $hasShop = ShopClass::getByCondition(['mobile' => $mobile]);
-            if (!empty($hasShop)) {
-                //手机号开了零售店不能再开批发店,开了批发店不能再开零售店!!
-                util::fail('手机号已经被使用');
+        $shopName = $post['name'] ?? '';
+        if (empty($shopName)) {
+            util::fail('名称不能为空');
+        }
+        $mobile = $post['mobile'] ?? '';
+        if (stringUtil::isMobile($mobile) == false) {
+            util::fail('请填写正确手机号');
+        }
+        if (stringUtil::getWordNum($shopName) > 8) {
+            util::fail('名称不能超过8个汉字');
+        }
+        $arr = ['斗南鲜花', '惠雅鲜花', '纯彩花艺', '泉城鲜花', '杭州斗南', '惠雅', '国恋', '花悠星', '勇记', '丰行', '昱成', '问境', '珑松'];
+        foreach ($arr as $it) {
+            if (strstr($shopName, $it) != null) {
+                util::fail('花店名称已经存在,请换个名称');
             }
+        }
+        $has = SjClass::getByCondition(['name' => $shopName]);
+        if (!empty($has)) {
+            //util::fail('名称已经被别人使用,请换个名字,或者名字后面加个2');
+        }
+        $has = ApplyClass::getByCondition(['mobile' => $mobile]);
+        if (!empty($has)) {
+            //手机号开了零售店不能再开批发店,开了批发店不能再开零售店!!
+            util::fail('手机号已经申请过了');
+        }
+        $hasShop = ShopClass::getByCondition(['mobile' => $mobile]);
+        if (!empty($hasShop)) {
+            //手机号开了零售店不能再开批发店,开了批发店不能再开零售店!!
+            util::fail('手机号已经被使用');
+        }
+
+        try {
 
             $post['adminId'] = $this->adminId;
             $authCode = $post['authCode'] ?? '';
@@ -234,10 +235,10 @@ class ApplyController extends BaseController
             $newMainId = $newShop->mainId ?? 0;
             $newShopId = $newShop->id ?? 0;
             $pfShopId = $newShop->pfShopId ?? 0;
-            $onlyCg = isset($newShop->onlyCg) ? $newShop->onlyCg : 1;
+            $onlyCg = $newShop->onlyCg ?? 1;
 
             $shareLogo = imgUtil::groupImg('buy_logo.jpg');
-            if (isset($newShop->shareLogo) && !empty($newShop->shareLogo)) {
+            if (!empty($newShop->shareLogo)) {
                 $shareLogo = imgUtil::groupImg($newShop->shareLogo);
             }
 
@@ -290,7 +291,9 @@ class ApplyController extends BaseController
 
         } catch (\Exception $exception) {
             $transaction->rollBack();
-            Yii::info("申请报错:" . $exception->getMessage());
+            $message = $exception->getMessage() ?? '';
+            Yii::info("申请报错:" . $message);
+            noticeUtil::push("花店注册失败,手机号{$mobile},原因:" . $message, '15280215347');
             util::fail('提交失败');
         }
     }

+ 1 - 1
app-hd/controllers/GhsController.php

@@ -278,7 +278,7 @@ class GhsController extends BaseController
         $info['telephone'] = $ghsShop->telephone ?? '';
 
         $shareLogo = imgUtil::groupImg('buy_logo.jpg');
-        if (isset($ghsShop->shareLogo) && !empty($ghsShop->shareLogo)) {
+        if (!empty($ghsShop->shareLogo)) {
             $shareLogo = imgUtil::groupImg($ghsShop->shareLogo);
         }
         $info['shareLogo'] = $shareLogo;

+ 72 - 69
app-hd/controllers/IntraCityController.php

@@ -32,75 +32,70 @@ class IntraCityController extends BaseController
 
     public $guestAccess = ['callback'];
 
+    public function actionApply()
+    {
+        IntraCityExpress::applyStore();
+    }
+
     /**
      * 创建门店
      * POST /intra-city/create-store
      */
     public function actionCreateStore()
     {
-        try {
-            $shop = $this->shop;
-            $shopName = $shop->shopName ?? '';
-            $sjName = $shop->merchantName ?? '';
-            $name = $shopName == '首店' ? $sjName : $sjName . ' ' . $shopName;
-
-            $adminId = $this->adminId;
-            util::checkRepeatCommit($adminId, 4);
-
-            $storeData = [
-                'out_store_id' => $this->mainId, //自定义门店编号 --  从 shopId 改为 mainId
-                'store_name' => $name,
-                'address_info' => [
-                    'province' => $shop->province,
-                    'city' => $shop->city,
-                    'area' => $shop->dist,
-                    'street' => '',
-                    'house' => $shop->floor ? $shop->address . $shop->floor : $shop->address,
-                    'lat' => $shop->lat,
-                    'lng' => $shop->long,
-                    'phone' => $shop->telephone
-                ]
-            ];
 
-            // 验证必填参数
-            $requiredFields = ['out_store_id', 'store_name', 'address_info'];
-            foreach ($requiredFields as $field) {
-                if (empty($storeData[$field])) {
-                    util::fail("缺少必填参数:{$field}");
-                }
-            }
-            // 创建门店前,检查是否已经 开通门店权限 (有wxStoreId,即说明开通了)
-            //$shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], true, false, 'id, wxStoreId');
-            $shopExt = MainClass::getById($this->mainId, true, 'id, wxStoreId');
-
-            // 查询是否存在 wx_store_id,不存在则执行apply
-            if ($shopExt->wxStoreId == '') {
-//                $re = IntraCityExpress::applyStore();
-//                if (!is_array($re)) {
-//                    $re = Json::decode($re, true);
-//                }
-//                if ($re['errcode'] != 0) {
-//                    Yii::error("开通门店权限失败:" . $re['errmsg']);
-//                    util::fail('开通门店权限失败');
-//                }
-            }
+        $shop = $this->shop;
+        $shopName = $shop->shopName ?? '';
+        $sjName = $shop->merchantName ?? '';
+        $name = $shopName == '首店' ? $sjName : $sjName . ' ' . $shopName;
 
-            $result = IntraCityExpress::createStore($storeData);
-            if ($result['errcode'] === 0) {
-                // 保存微信门店编号(wx_store_id)
-                $shopExt->wxStoreId = $result['wx_store_id'];
-                $shopExt->save();
+        $adminId = $this->adminId;
+        util::checkRepeatCommit($adminId, 3);
 
-                util::success($result, "门店创建成功");
-            } else {
-                Yii::error("门店创建失败:" . $result['errmsg']);
-                $errMsg = $result['errmsg'] ?? '';
-                noticeUtil::push("报错内容:" . $errMsg, '15280215347');
-                util::fail($result['errmsg']);
+        if (empty($shop->lat) || empty($shop->long)) {
+            util::fail('没有经纬度,请修改地址');
+        }
+        if (empty($shop->address)) {
+            util::fail('地址缺失,请修改');
+        }
+        $storeData = [
+            'out_store_id' => $this->mainId, //自定义门店编号 --  从 shopId 改为 mainId
+            'store_name' => $name,
+            'address_info' => [
+                'province' => $shop->province,
+                'city' => $shop->city,
+                'area' => $shop->dist,
+                'street' => '',
+                'house' => $shop->address . $shop->floor,
+                'lat' => $shop->lat,
+                'lng' => $shop->long,
+                'phone' => $shop->telephone
+            ]
+        ];
+        // 验证必填参数
+        $requiredFields = ['out_store_id', 'store_name', 'address_info'];
+        foreach ($requiredFields as $field) {
+            if (empty($storeData[$field])) {
+                util::fail("缺少必填参数:{$field}");
             }
-        } catch (\Exception $e) {
-            Yii::error("门店创建失败:" . $e->getMessage());
-            util::fail("系统出错");
+        }
+        // 创建门店前,检查是否已经 开通门店权限 (有wxStoreId,即说明开通了)
+        $main = $this->main;
+        // 查询是否存在 wx_store_id,不存在则执行apply
+        if (!empty($main->wxStoreId)) {
+            util::fail('已经创建门店,请刷新');
+        }
+        $result = IntraCityExpress::createStore($storeData);
+        if ($result['errcode'] === 0) {
+            // 保存微信门店编号(wx_store_id)
+            $main->wxStoreId = $result['wx_store_id'];
+            $main->save();
+            util::success($result, "门店创建成功");
+        } else {
+            Yii::error("门店创建失败:" . $result['errmsg']);
+            $errMsg = $result['errmsg'] ?? '';
+            noticeUtil::push("跑腿创建门店报错:" . $errMsg, '15280215347');
+            util::fail('创建失败,请联系客服');
         }
     }
 
@@ -140,22 +135,29 @@ class IntraCityController extends BaseController
     public function actionUpdateStore()
     {
         // 首先从门店扩展表查询是否已经创建
-        //$shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], false, false, 'id, wxStoreId');
-        $shopExt = MainClass::getById($this->mainId, false, 'id, wxStoreId');
-        if ($shopExt['wxStoreId'] == '') {
+        $main = $this->main;
+        $wxStoreId = $main->wxStoreId;
+        if (empty($wxStoreId)) {
             util::fail('未创建门店,请先创建');
         }
+        $shop = $this->shop;
 
         $adminId = $this->adminId;
-        util::checkRepeatCommit($adminId, 4);
+        util::checkRepeatCommit($adminId, 3);
+
+        if (empty($shop->lat) || empty($shop->long)) {
+            util::fail('没有经纬度,请修改地址');
+        }
+        if (empty($shop->address)) {
+            util::fail('地址缺失,请修改');
+        }
 
-        $shop = $this->shop;
         $shopName = $shop->shopName ?? '';
         $sjName = $shop->merchantName ?? '';
         $name = $shopName == '首店' ? $sjName : $sjName . ' ' . $shopName;
 
         $storeData = [
-            'keys' => ['wx_store_id' => $shopExt['wxStoreId']],
+            'keys' => ['wx_store_id' => $wxStoreId],
             'content' => [
                 'store_name' => $name,
                 'address_info' => [
@@ -163,7 +165,7 @@ class IntraCityController extends BaseController
                     'city' => $shop->city,
                     'area' => $shop->dist,
                     'street' => '',
-                    'house' => $shop->floor ? $shop->address . $shop->floor : $shop->address,
+                    'house' => $shop->address . $shop->floor,
                     'lat' => $shop->lat,
                     'lng' => $shop->long,
                     'phone' => $shop->telephone
@@ -176,9 +178,10 @@ class IntraCityController extends BaseController
         if ($result['errcode'] === 0) {
             util::success($result, "门店更新成功");
         } else {
-            Yii::error("门店更新失败:" . $result['errmsg']);
-            util::fail($result['errmsg']);
-            //util::fail('门店更新失败');
+            $errMsg = $result['errmsg'] ?? '';
+            Yii::error("门店更新失败:" . $errMsg);
+            noticeUtil::push("花掌柜,跑腿修改门店报错:" . $errMsg, '15280215347');
+            util::fail('更新失败,请联系客服');
         }
     }
 

+ 4 - 12
app-hd/controllers/NoticeController.php

@@ -143,12 +143,8 @@ class NoticeController extends PublicController
                 if (!empty($cg) && !empty($order)) {
                     if (isset($cg->book) && $cg->book == 0) {
                         $ghsShopId = $order->shopId ?? 0;
-                        if (getenv('YII_ENV') == 'production') {
-                            $specialList = [10649, 8042, 16454, 21319, 33668,42345];
-                        } else {
-                            $specialList = [36523];
-                        }
-                        if (!in_array($ghsShopId, $specialList)) {
+                        $ext = ShopExtClass::getByCondition(['shopId' => $ghsShopId], true, null, 'id,shopId,orderFlow');
+                        if ($ext->orderFlow == 0) {
                             PurchaseClass::confirmTake($cg);
                         }
                     }
@@ -366,12 +362,8 @@ class NoticeController extends PublicController
                 if (!empty($cg) && !empty($order)) {
                     if (isset($cg->book) && $cg->book == 0) {
                         $ghsShopId = $order->shopId ?? 0;
-                        if (getenv('YII_ENV') == 'production') {
-                            $specialList = [10649, 8042, 16454, 21319, 33668,42345];
-                        } else {
-                            $specialList = [36523];
-                        }
-                        if (!in_array($ghsShopId, $specialList)) {
+                        $ext = ShopExtClass::getByCondition(['shopId' => $ghsShopId], true, null, 'id,shopId,orderFlow');
+                        if ($ext->orderFlow == 0) {
                             PurchaseClass::confirmTake($cg);
                         }
                     }

+ 2 - 6
app-hd/controllers/PurchaseController.php

@@ -753,12 +753,8 @@ class PurchaseController extends BaseController
             if (!empty($cg)) {
                 if (isset($cg->book) && $cg->book == 0) {
                     $ghsShopId = $ghs['shopId'] ?? 0;
-                    if (getenv('YII_ENV') == 'production') {
-                        $specialList = [10649, 8042, 16454, 21319, 33668, 42345];
-                    } else {
-                        $specialList = [36523];
-                    }
-                    if (!in_array($ghsShopId, $specialList)) {
+                    $ext = ShopExtClass::getByCondition(['shopId' => $ghsShopId], true, null, 'id,shopId,orderFlow');
+                    if ($ext->orderFlow == 0) {
                         PurchaseClass::confirmTake($cg);
                     }
                 }

+ 33 - 36
app-hd/controllers/ShopExtController.php

@@ -18,6 +18,22 @@ class ShopExtController extends BaseController
 
     public $guestAccess = [];
 
+    public function actionMyInfo()
+    {
+        $shopId = $this->shopId;
+        $ext = \bizHd\shop\classes\ShopExtClass::getByCondition(['shopId' => $shopId], true);
+        $losingItemId = $ext->losingItem ?? 0;
+        $losingItem = ProductClass::getById($losingItemId, true);
+        $losingItemName = $losingItem->name ?? '';
+        $zjGatheringItemId = $ext->zjGatheringItem ?? 0;
+        $zjGatheringItem = ProductClass::getById($zjGatheringItemId, true);
+        $zjGatheringItemName = $zjGatheringItem->name ?? '';
+        $arr = $ext->attributes ?? [];
+        $arr['losingItemName'] = $losingItemName;
+        $arr['zjGatheringItemName'] = $zjGatheringItemName;
+        util::success($arr);
+    }
+
     //设置处理花材、扫码收款和直接收款使用的花材 ssh 20250905
     public function actionSetItem()
     {
@@ -33,47 +49,28 @@ class ShopExtController extends BaseController
         $ext = \bizHd\shop\classes\ShopExtClass::getByCondition(['shopId' => $shopId], true);
         $losingItem = $post['losingItem'] ?? 0;
         if (!empty($losingItem)) {
-            if (empty($ext->losingItem)) {
-                $info = ProductClass::getById($losingItem, true);
-                if ($info->mainId != $this->mainId) {
-                    util::fail('不是你的花材呢,编号099323');
-                }
-                $ext->losingItem = $losingItem;
-                $ext->save();
-                if (!empty($pfExt)) {
-                    $pfExt->losingItem = $losingItem;
-                    $pfExt->save();
-                }
+            $info = ProductClass::getById($losingItem, true);
+            if ($info->mainId != $this->mainId) {
+                util::fail('不是你的花材呢,编号099323');
             }
-        }
-        $gatheringItem = $post['gatheringItem'] ?? 0;
-        if (!empty($gatheringItem)) {
-            if (empty($ext->gatheringItem)) {
-                $info = ProductClass::getById($losingItem, true);
-                if ($info->mainId != $this->mainId) {
-                    util::fail('不是你的花材呢,编号099324');
-                }
-                $ext->gatheringItem = $gatheringItem;
-                $ext->save();
-                if (!empty($pfExt)) {
-                    $pfExt->gatheringItem = $gatheringItem;
-                    $pfExt->save();
-                }
+            $ext->losingItem = $losingItem;
+            $ext->save();
+            if (!empty($pfExt)) {
+                $pfExt->losingItem = $losingItem;
+                $pfExt->save();
             }
         }
         $zjGatheringItem = $post['zjGatheringItem'] ?? 0;
         if (!empty($zjGatheringItem)) {
-            if (empty($ext->zjGatheringItem)) {
-                $info = ProductClass::getById($losingItem, true);
-                if ($info->mainId != $this->mainId) {
-                    util::fail('不是你的花材呢,编号099324');
-                }
-                $ext->zjGatheringItem = $zjGatheringItem;
-                $ext->save();
-                if (!empty($pfExt)) {
-                    $pfExt->zjGatheringItem = $zjGatheringItem;
-                    $pfExt->save();
-                }
+            $info = ProductClass::getById($losingItem, true);
+            if ($info->mainId != $this->mainId) {
+                util::fail('不是你的花材呢,编号099324');
+            }
+            $ext->zjGatheringItem = $zjGatheringItem;
+            $ext->save();
+            if (!empty($pfExt)) {
+                $pfExt->zjGatheringItem = $zjGatheringItem;
+                $pfExt->save();
             }
         }
         util::complete('修改成功');

+ 5 - 12
biz-ghs/order/services/OrderService.php

@@ -6,6 +6,7 @@ use biz\ghs\classes\GhsClass;
 use biz\shop\classes\ShopAdminClass;
 use biz\shop\classes\ShopCapitalClass;
 use biz\shop\classes\ShopClass;
+use biz\shop\classes\ShopExtClass;
 use biz\stat\classes\StatKdClass;
 use biz\stat\classes\StatKhCgClass;
 use biz\stat\classes\StatSaleClass;
@@ -134,12 +135,8 @@ class OrderService extends BaseService
         //不是预订单,并且供货商不是源花汇、小明鲜花、淄博花超、云漫梦金鹏、海翔,则订单直接完成掉。是预订单,则确认发货时直接完成掉。有多个地方要修改,请搜索关键词zjFinish
         if (!empty($cg) && !empty($order)) {
             $ghsShopId = $order->shopId ?? 0;
-            if (getenv('YII_ENV') == 'production') {
-                $specialList = [10649, 8042, 16454, 21319, 33668, 42345];
-            } else {
-                $specialList = [36523];
-            }
-            if (!in_array($ghsShopId, $specialList)) {
+            $ext = ShopExtClass::getByCondition(['shopId' => $ghsShopId], true, null, 'id,shopId,orderFlow');
+            if ($ext->orderFlow == 0) {
                 $newCg = PurchaseClass::getById($cgId, true);
                 PurchaseClass::confirmTake($newCg);
             }
@@ -312,12 +309,8 @@ class OrderService extends BaseService
             //不是预订单,并且供货商不是源花汇、小明鲜花、淄博花超、云漫梦金鹏、海翔,则订单直接完成掉。是预订单,则确认发货时直接完成掉。有多个地方要修改,请搜索关键词zjFinish
             if (isset($returnOrder->book) && $returnOrder->book == 0) {
                 $ghsShopId = $ghs['shopId'] ?? 0;
-                if (getenv('YII_ENV') == 'production') {
-                    $specialList = [10649, 8042, 16454, 21319, 33668,42345];
-                } else {
-                    $specialList = [36523];
-                }
-                if (!in_array($ghsShopId, $specialList)) {
+                $ext = ShopExtClass::getByCondition(['shopId' => $ghsShopId], true, null, 'id,shopId,orderFlow');
+                if ($ext->orderFlow == 0) {
                     $returnId = $returnOrder->id;
                     $order = OrderClass::getById($returnId, true);
                     if (!empty($order)) {

+ 2 - 0
biz/pt/classes/AgreementClass.php

@@ -95,6 +95,7 @@ TEXT;
         _@@__BB_我们的订单功能会申请您的拨打电话权限,以方便您在订单详情页直接唤起客户电话进行拨打
         _@@__BB_我们的花材管理需要您的读取存储卡和相机权限,以方便您修改花材图片
         _@@__BB_我们的产品基于DCloud uni-app(5+ App/Wap2App)开发,应用运行期间需要收集您的设备唯一识别码(IMEI/android ID/DEVICE_ID/IDFA、SIM 卡 IMSI 信息、OAID)以提供统计分析服务,并通过应用启动数据及异常错误日志分析改进性能和用户体验,为用户提供更好的服务。详情内容请访问《DCloud用户服务条款》,链接地址 https://ask.dcloud.net.cn/protocol.html
+        _@@__BB_我们使用了移动安全联盟(MSA)提供的移动智能终端补充设备标识体系统一调用 SDK(包名:com.bun.miitmdid),用于获取 OAID(匿名设备标识符),以便进行广告归因和风险控制。该信息为不可变更的匿名标识符,不会用于识别个人身份。您可以通过系统设置或联系我们关闭 OAID 的获取,官网地址:https://www.msa-alliance.cn
 
         _@@_您提供的上述信息,将在您使用本服务期间持续授权我们使用。在您停止使用推送服务时,我们将停止使用并删除上述信息。
         我们保证会依法对收集后的用户信息进行去标识化或匿名化处理,对于无法单独或者与其他信息结合识别自然人个人身份的信息,不属于法律意义上的个人信息。如果我们将非个人信息与其他信息结合识别到您的个人身份时,或者与您的个人信息结合使用时,
@@ -424,6 +425,7 @@ TEXT;
         _@@__BB_我们的订单功能会申请您的拨打电话权限,以方便您在订单详情页直接唤起客户电话进行拨打
         _@@__BB_我们的花材管理需要您的读取存储卡和相机权限,以方便您修改花材图片
         _@@__BB_我们的产品基于DCloud uni-app(5+ App/Wap2App)开发,应用运行期间需要收集您的设备唯一识别码(IMEI/android ID/DEVICE_ID/IDFA、SIM 卡 IMSI 信息、OAID)以提供统计分析服务,并通过应用启动数据及异常错误日志分析改进性能和用户体验,为用户提供更好的服务。详情内容请访问《DCloud用户服务条款》,链接地址 https://ask.dcloud.net.cn/protocol.html
+        _@@__BB_我们使用了移动安全联盟(MSA)提供的移动智能终端补充设备标识体系统一调用 SDK(包名:com.bun.miitmdid),用于获取 OAID(匿名设备标识符),以便进行广告归因和风险控制。该信息为不可变更的匿名标识符,不会用于识别个人身份。您可以通过系统设置或联系我们关闭 OAID 的获取,官网地址:https://www.msa-alliance.cn
 
         _@@_您提供的上述信息,将在您使用本服务期间持续授权我们使用。在您停止使用推送服务时,我们将停止使用并删除上述信息。
         我们保证会依法对收集后的用户信息进行去标识化或匿名化处理,对于无法单独或者与其他信息结合识别自然人个人身份的信息,不属于法律意义上的个人信息。如果我们将非个人信息与其他信息结合识别到您的个人身份时,或者与您的个人信息结合使用时,