瀏覽代碼

支付宝 与 通知

shish 5 年之前
父節點
當前提交
a199fdca68

+ 9 - 10
app-mall/controllers/BaseController.php

@@ -29,6 +29,14 @@ class BaseController extends PublicController
     {
         //定义平台类型 1花店 2供货商 3商城
         Yii::$app->params['ptStyle'] = dict::getDict('ptStyle', 'mall');
+
+        $shopId = Yii::$app->request->get('account', 0);
+        $this->shopId = $shopId;
+        if (!empty($shopId)) {
+            $shop = ShopClass::getById($shopId, true);
+            $this->shop = $shop;
+        }
+
         if (httpUtil::isMiniProgram()) {
             $userId = jwt::getLoginId();
             if (empty($userId)) {
@@ -42,15 +50,7 @@ class BaseController extends PublicController
             $this->user = $user;
             $this->isWx = util::isWx();
 
-            //$header = httpUtil::getHeader();
-            //$shopId = isset($header['account']) ? $header['account'] : 0;
-            $shopId = Yii::$app->request->get('account', 0);
-            $this->shopId = $shopId;
-            if (!empty($shopId)) {
-                $shop = ShopClass::getById($shopId, true);
-                if (empty($shop)) {
-                    util::fail('没有找到门店');
-                }
+            if (!empty($shop)) {
                 $sjId = $shop->sjId ?? 0;
                 if (empty($sjId)) {
                     util::fail('没有找到商家哦');
@@ -61,7 +61,6 @@ class BaseController extends PublicController
                 }
                 $this->sjId = $sjId;
                 $this->sj = $sj;
-                $this->shop = $shop;
                 $this->sjExtend = MerchantExtendService::getBySjId($sjId);
                 $userInfo = isset($user->attributes) ? $user->attributes : [];
                 $custom = CustomClass::replaceCustom($sjId, $userInfo, $shopId);

+ 0 - 14
app-mall/controllers/WxShareController.php

@@ -2,21 +2,7 @@
 
 namespace mall\controllers;
 
-use common\components\jsSDK;
-use common\components\util;
-use Yii;
-
 class WxShareController extends BaseController
 {
-	
-	//取微信分享的参数 ssh 2020.2.22
-	public function actionGetParams()
-	{
-		$url = Yii::$app->request->post('url');
-		$jsSDK = new jsSDK();//微信分享
-		$sj = $this->sj->attributes;
-		$return = $jsSDK->GetSignPackage($sj, $url);
-		util::success($return);
-	}
 
 }

+ 1 - 1
biz-ghs/custom/services/CustomService.php

@@ -14,7 +14,7 @@ class CustomService extends BaseService
     //分享建立客户和供货商关系 ssh 2021.2.28
     public static function shareBuildTrade($applyData, $newShop)
     {
-        $shopId = $newShop['id'] ?? 0;
+        $shopId = $newShop->id ?? 0;
         $introShopId = $applyData['introShopId'] ?? 0;
         //申请人是花店,介绍人是供货商
         if ($applyData['style'] == SjClass::STYLE_RETAIL) {

+ 2 - 2
biz/shop/classes/ShopClass.php

@@ -88,8 +88,8 @@ class ShopClass extends BaseClass
         if (isset($data['ptStyle']) == false) {
             util::fail('请先择平台类型');
         }
-        $shop = self::add($data);
-        $newShopId = $shop['id'];
+        $shop = self::add($data, true);
+        $newShopId = $shop->id;
         //初始化花材 linqh 2021.5.11
         $adminId = $data['adminId'] ?? 0;
         $shopId = $data['shopId'] ?? 0;

+ 5 - 1
biz/sj/services/MerchantService.php

@@ -3,6 +3,7 @@
 namespace biz\sj\services;
 
 use biz\sj\classes\SjClass;
+use biz\wx\classes\WxMessageClass;
 use bizGhs\custom\services\CustomService;
 use bizHd\agent\classes\AgentAssetClass;
 use bizHd\auth\services\AuthService;
@@ -168,7 +169,7 @@ class MerchantService extends BaseService
             'ptStyle' => $ptStyle,
         ];
         $shopRespond = \biz\shop\classes\ShopClass::addShop($shopData);
-        $shopId = $shopRespond['id'];
+        $shopId = $shopRespond->id;
 
         //员工、角色、商品、分类等等初始化
         MerchantClass::initMore($applyData, $sjId, $shopId);
@@ -191,6 +192,9 @@ class MerchantService extends BaseService
             ]);
         }
 
+        //审核通过微信通知商家
+        WxMessageClass::applyPass($shopRespond);
+
         return $sj;
     }
 

+ 1 - 1
biz/wx/classes/WxMessageClass.php

@@ -162,7 +162,7 @@ class WxMessageClass extends BaseClass
                 "url" => Yii::$app->params['ghsDomain'],
                 "data" => array(
                     "first" => array(
-                        "value" => "恭喜您,开店申请审核通过!",
+                        "value" => "恭喜,您的开店申请审核通过。",
                         "color" => "#173177"
                     ),
                     "keyword1" => array(