|
|
@@ -9,93 +9,114 @@ use biz\base\classes\BaseClass;
|
|
|
|
|
|
class WxOpenClass extends BaseClass
|
|
|
{
|
|
|
-
|
|
|
- public static $baseFile = '\biz\wx\models\WxOpen';
|
|
|
-
|
|
|
- //平台管理员的手机号
|
|
|
- const ADMIN_MOBILE = 15280215347;
|
|
|
- const PLATFORM_ACCOUNT = 12359;
|
|
|
- const ID = 1;
|
|
|
-
|
|
|
- //取平台的帐号
|
|
|
- public static function getPlatformAccount()
|
|
|
- {
|
|
|
- return self::PLATFORM_ACCOUNT;
|
|
|
- }
|
|
|
-
|
|
|
- //获取平台基础信息 shish 2020.2.11
|
|
|
- public static function getOpen()
|
|
|
- {
|
|
|
- return self::getById(self::ID);
|
|
|
- }
|
|
|
-
|
|
|
- //获取平台管理员的手机号 shish 2020.3.4
|
|
|
- public static function getAdminMobile()
|
|
|
- {
|
|
|
- return self::ADMIN_MOBILE;
|
|
|
- }
|
|
|
-
|
|
|
- //获取平台微信信息
|
|
|
- public static function getOpenInfo()
|
|
|
- {
|
|
|
- $open = self::getById(self::ID);
|
|
|
- if (isset($open['merchantId']) && !empty($open['merchantId'])) {
|
|
|
- $merchantId = $open['merchantId'];
|
|
|
- return MerchantClass::getMerchantById($merchantId);
|
|
|
- }
|
|
|
- util::fail('没有找到平台信息');
|
|
|
- }
|
|
|
-
|
|
|
- //更新开放平台信息 shish 2020.4.13
|
|
|
- public static function updateOpen($data)
|
|
|
- {
|
|
|
- self::updateById(self::ID, $data);
|
|
|
- }
|
|
|
-
|
|
|
- //平台小程序信息 shish 2020.4.13
|
|
|
- public static function getWxMiniBase()
|
|
|
- {
|
|
|
- $open = self::getOpen();
|
|
|
- $wx_mini_base_id = isset($open['wx_mini_base_id']) ? $open['wx_mini_base_id'] : 0;
|
|
|
- $base = WxMiniBaseClass::getById($wx_mini_base_id);
|
|
|
- if (empty($base)) {
|
|
|
- util::fail('没有找到平台小程序信息');
|
|
|
- }
|
|
|
- return $base;
|
|
|
- }
|
|
|
-
|
|
|
- //平台小程序信息 shish 2020.4.13
|
|
|
- public static function getGhsWxMiniBase()
|
|
|
- {
|
|
|
- $open = self::getOpen();
|
|
|
- $wxGhsMiniBaseId = isset($open['wxGhsMiniBaseId']) ? $open['wxGhsMiniBaseId'] : 0;
|
|
|
- $base = WxMiniBaseClass::getById($wxGhsMiniBaseId);
|
|
|
- if (empty($base)) {
|
|
|
- util::fail('没有找到平台小程序信息');
|
|
|
- }
|
|
|
- return $base;
|
|
|
- }
|
|
|
-
|
|
|
- //公众号信息 shish 2020.4.14
|
|
|
- public static function getWxBase()
|
|
|
- {
|
|
|
- $open = self::getOpen();
|
|
|
- $wx_base_id = isset($open['wx_base_id']) ? $open['wx_base_id'] : 0;
|
|
|
- $base = WxBaseClass::getById($wx_base_id);
|
|
|
- if (empty($base)) {
|
|
|
- util::fail('没有找到平台公众号信息');
|
|
|
- }
|
|
|
- return $base;
|
|
|
- }
|
|
|
-
|
|
|
- //获取微信和小程序信息 shish 2020.4.14
|
|
|
- public static function getWxInfo()
|
|
|
- {
|
|
|
- $open = self::getOpen();
|
|
|
- $openAppId = isset($open['appIdCreated']) ? $open['appIdCreated'] : '';
|
|
|
- $mini = self::getWxMiniBase();
|
|
|
- $wx = self::getWxBase();
|
|
|
- return array_merge($wx, $mini, ['openAppId' => $openAppId]);
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
+ public static $baseFile = '\biz\wx\models\WxOpen';
|
|
|
+
|
|
|
+ //平台管理员的手机号
|
|
|
+ const ADMIN_MOBILE = 15280215347;
|
|
|
+ const PLATFORM_ACCOUNT = 12359;
|
|
|
+ const ID = 1;
|
|
|
+
|
|
|
+ //取平台的帐号
|
|
|
+ public static function getPlatformAccount()
|
|
|
+ {
|
|
|
+ return self::PLATFORM_ACCOUNT;
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取平台基础信息 shish 2020.2.11
|
|
|
+ public static function getOpen()
|
|
|
+ {
|
|
|
+ return self::getById(self::ID);
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取平台管理员的手机号 shish 2020.3.4
|
|
|
+ public static function getAdminMobile()
|
|
|
+ {
|
|
|
+ return self::ADMIN_MOBILE;
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取平台微信信息
|
|
|
+ public static function getOpenInfo()
|
|
|
+ {
|
|
|
+ $open = self::getById(self::ID);
|
|
|
+ if (isset($open['merchantId']) && !empty($open['merchantId'])) {
|
|
|
+ $merchantId = $open['merchantId'];
|
|
|
+ return MerchantClass::getMerchantById($merchantId);
|
|
|
+ }
|
|
|
+ util::fail('没有找到平台信息');
|
|
|
+ }
|
|
|
+
|
|
|
+ //更新开放平台信息 shish 2020.4.13
|
|
|
+ public static function updateOpen($data)
|
|
|
+ {
|
|
|
+ self::updateById(self::ID, $data);
|
|
|
+ }
|
|
|
+
|
|
|
+ //平台小程序信息 shish 2020.4.13
|
|
|
+ public static function getWxMiniBase()
|
|
|
+ {
|
|
|
+ $open = self::getOpen();
|
|
|
+ $wxMiniBaseId = isset($open['wxMiniBaseId']) ? $open['wxMiniBaseId'] : 0;
|
|
|
+ $base = WxMiniBaseClass::getById($wxMiniBaseId);
|
|
|
+ if (empty($base)) {
|
|
|
+ util::fail('没有找到平台小程序信息');
|
|
|
+ }
|
|
|
+ return $base;
|
|
|
+ }
|
|
|
+
|
|
|
+ //公众号信息 shish 2020.4.14
|
|
|
+ public static function getWxBase()
|
|
|
+ {
|
|
|
+ $open = self::getOpen();
|
|
|
+ $wxBaseId = isset($open['wxBaseId']) ? $open['wxBaseId'] : 0;
|
|
|
+ $base = WxBaseClass::getById($wxBaseId);
|
|
|
+ if (empty($base)) {
|
|
|
+ util::fail('没有找到平台公众号信息');
|
|
|
+ }
|
|
|
+ return $base;
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取微信和小程序信息 shish 2020.4.14
|
|
|
+ public static function getWxInfo()
|
|
|
+ {
|
|
|
+ $open = self::getOpen();
|
|
|
+ $openAppId = isset($open['appIdCreated']) ? $open['appIdCreated'] : '';
|
|
|
+ $mini = self::getWxMiniBase();
|
|
|
+ $wx = self::getWxBase();
|
|
|
+ return array_merge($wx, $mini, ['openAppId' => $openAppId]);
|
|
|
+ }
|
|
|
+
|
|
|
+ //公众号信息 shish 2020.4.14
|
|
|
+ public static function getGhsWxBase()
|
|
|
+ {
|
|
|
+ $open = self::getOpen();
|
|
|
+ $wxGhsBaseId = isset($open['wxGhsBaseId']) ? $open['wxGhsBaseId'] : 0;
|
|
|
+ $base = WxBaseClass::getById($wxGhsBaseId);
|
|
|
+ if (empty($base)) {
|
|
|
+ util::fail('没有找到平台公众号信息');
|
|
|
+ }
|
|
|
+ return $base;
|
|
|
+ }
|
|
|
+
|
|
|
+ //平台小程序信息 shish 2020.4.13
|
|
|
+ public static function getGhsWxMiniBase()
|
|
|
+ {
|
|
|
+ $open = self::getOpen();
|
|
|
+ $wxGhsMiniBaseId = isset($open['wxGhsMiniBaseId']) ? $open['wxGhsMiniBaseId'] : 0;
|
|
|
+ $base = WxMiniBaseClass::getById($wxGhsMiniBaseId);
|
|
|
+ if (empty($base)) {
|
|
|
+ util::fail('没有找到平台小程序信息');
|
|
|
+ }
|
|
|
+ return $base;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static function getGhsWxInfo()
|
|
|
+ {
|
|
|
+ $open = self::getOpen();
|
|
|
+ $openAppId = isset($open['appIdCreated']) ? $open['appIdCreated'] : '';
|
|
|
+ $mini = self::getGhsWxMiniBase();
|
|
|
+ $wx = self::getGhsWxBase();
|
|
|
+ return array_merge($wx, $mini, ['openAppId' => $openAppId]);
|
|
|
+ }
|
|
|
+
|
|
|
}
|