|
|
@@ -0,0 +1,46 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace bizTy\wx\classes;
|
|
|
+
|
|
|
+use bizTy\sj\classes\MerchantClass;
|
|
|
+use common\components\util;
|
|
|
+use Yii;
|
|
|
+use bizTy\base\classes\BaseClass;
|
|
|
+
|
|
|
+class WxOpenClass extends BaseClass
|
|
|
+{
|
|
|
+
|
|
|
+ public static $baseFile = '\bizTy\wx\models\WxOpen';
|
|
|
+
|
|
|
+ const OPEN_STYLE_RETAIL = 1;
|
|
|
+ const OPEN_STYLE_GHS = 2;
|
|
|
+
|
|
|
+ //获取所有的小程序信息 shish 2021.2.25
|
|
|
+ public static function getMiniInfo()
|
|
|
+ {
|
|
|
+ $ghsOpen = self::getGhsOpen();
|
|
|
+ $wxGhsMiniBaseId = $ghsOpen['wxGhsMiniBaseId'] ?? 0;
|
|
|
+ $arr = [];
|
|
|
+ $ghsMini = WxMiniBaseClass::getById($wxGhsMiniBaseId);
|
|
|
+ $arr['ghs']['miniAppId'] = $ghsMini['miniAppId'] ?? '';
|
|
|
+ $retailOpen = self::getRetailOpen();
|
|
|
+ $wxMiniBaseId = $retailOpen['wxMiniBaseId'] ?? 0;
|
|
|
+ $wxMini = WxMiniBaseClass::getById($wxGhsMiniBaseId);
|
|
|
+ $arr['retail']['miniAppId'] = $wxMini['miniAppId'] ?? '';
|
|
|
+ return $arr;
|
|
|
+ }
|
|
|
+
|
|
|
+ //取供货商平台信息 shish 2021.2.25
|
|
|
+ public static function getGhsOpen()
|
|
|
+ {
|
|
|
+ //暂时只有一个平台,取一个平台
|
|
|
+ return self::getByCondition(['style' => self::OPEN_STYLE_RETAIL]);
|
|
|
+ }
|
|
|
+
|
|
|
+ //取零售平台信息 shish 2021.2.25
|
|
|
+ public static function getRetailOpen()
|
|
|
+ {
|
|
|
+ return self::getByCondition(['style' => self::OPEN_STYLE_RETAIL]);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|