1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace app\common\model;
- class WechatConfig extends Base
- {
- /**
- * 获取微信号配置
- * @param $key
- * @return array|false
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
- */
- public static function getEasyWechatConfig($key)
- {
- $where = [];
- $where[] = ["id|app_id|app_code", "=", $key];
- $wechatConfig = self::where($where)->find();
- if (!$wechatConfig) {
- return false;
- }
- $config = [
- 'app_id' => $wechatConfig->app_id,
- 'secret' => $wechatConfig->secret,
- ];
- return $config;
- }
- }
|