1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace app\common\model;
- class WechatConfig extends Base
- {
-
- public static function getEasyWechatConfig($key)
- {
- $where = [];
- $where[] = ["app_id|app_code", "=", $key];
- $wechatConfig = self::where($where)->find();
- if (!$wechatConfig) {
- return false;
- }
- $config = [
- 'app_id' => $wechatConfig->app_id,
- 'secret' => $wechatConfig->secret,
- 'sign_key'=>$wechatConfig->sign_key,
- 'log' => [
- 'default' => 'dev',
- 'channels' => [
-
- 'dev' => [
- 'driver' => 'daily',
- 'path' => runtime_path().'/tmp/easywechat.log',
- 'level' => 'debug',
- ],
-
- 'prod' => [
- 'driver' => 'daily',
- 'path' =>runtime_path(). '/tmp/easywechat.log',
- 'level' => 'info',
- ],
- ],
- ],
- ];
- return $config;
- }
- }
|