You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong/app/api/model/wxapp/Setting.php

56 lines
1.8 KiB

11 months ago
<?php
// +----------------------------------------------------------------------
// | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2023 https://www.yiovo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
// +----------------------------------------------------------------------
// | Author: 萤火科技 <admin@yiovo.com>
// +----------------------------------------------------------------------
declare (strict_types=1);
namespace app\api\model\wxapp;
use app\common\model\wxapp\Setting as SettingModel;
9 months ago
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;
11 months ago
/**
* 微信小程序设置模型
* Class Setting
* @package app\api\model\wxapp
*/
class Setting extends SettingModel
{
/**
* 验证当前是否允许访问
* @return bool
9 months ago
* @throws DataNotFoundException
* @throws DbException
* @throws ModelNotFoundException
11 months ago
*/
public static function checkStatus(): bool
{
return (bool)static::getItem('basic', static::$storeId)['enabled'];
}
9 months ago
/**
* @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;
}
11 months ago
}