// +---------------------------------------------------------------------- declare (strict_types=1); namespace app\api\model\wxapp; use app\common\model\wxapp\Setting as SettingModel; use think\db\exception\DataNotFoundException; use think\db\exception\DbException; use think\db\exception\ModelNotFoundException; /** * 微信小程序设置模型 * Class Setting * @package app\api\model\wxapp */ class Setting extends SettingModel { /** * 验证当前是否允许访问 * @return bool * @throws DataNotFoundException * @throws DbException * @throws ModelNotFoundException */ public static function checkStatus(): bool { return (bool)static::getItem('basic', static::$storeId)['enabled']; } /** * @notes:获取小程序配置 * @return array * @throws DataNotFoundException * @throws DbException * @throws ModelNotFoundException * @author: wanghousheng */ public function info(): array { $data = static::getItem('basic', static::$storeId); if (!empty($data['app_secret'])) { unset($data['app_secret']); } return $data; } }