| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- namespace biz\wx\classes;
- use biz\sj\classes\MerchantClass;
- use common\components\util;
- use Yii;
- use biz\base\classes\BaseClass;
- class WxOpenClass extends BaseClass
- {
-
- public static $baseFile = '\biz\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['hd']['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]);
- }
-
- }
|