getAddonInfo( )获取应用配置信息 * * * * * >[warning]获取当前的应用一般不需要传参 ~~~ /** * 获取应用配置信息 * @author geeson myrhzq@qq.com * $param $addonName string // 当前应用插件名称 * @param string mid 当前公众号标识ID * @return array|bool|mixed */ function getAddonInfo($addonName = '', $mid = '') { if ($addonName == '' || $mid == '') { $addonName = session('addonName'); $mid = session('mid')?session('mid'):input('mid'); } if ($addonName == '' || $mid == '') { exit('参数不完整:应用名称或者公众号标识不存在'); } $addon = \think\Db::name('addons')->where(['addon' => $addonName])->find(); $addonInfo = \think\Db::name('addon_info')->where(['addon' => $addonName, 'mpid' => input('mid')])->find(); $addon['path'] = ADDON_PATH . $addonName . '/'; $addon['mp_config'] = json_decode($addonInfo['infos'], true); $addon['common_config'] = json_decode($addon['config'], true); unset($addon['config']); return $addon; } ~~~