<?php
/**
* 开店星新零售管理系统
* @description 基于Yii2+Vue2.0+uniapp研发,H5+小程序+公众号全渠道覆盖,功能完善开箱即用,框架成熟易扩展二开
* @author 青岛开店星信息技术有限公司
* @link https://www.kaidianxing.com
* @copyright Copyright (c) 2020-2022 Qingdao ShopStar Information Technology Co., Ltd.
* @copyright 版权归青岛开店星信息技术有限公司所有
* @warning Unauthorized deletion of copyright information is prohibited.
* @warning 未经许可禁止私自删除版权信息
*/
namespace shopstar\models\shop;
use shopstar\bases\model\BaseSettings;
use shopstar\components\storage\bases\StorageDriverConstant;
use shopstar\constants\components\notice\NoticeTypeConstant;
use shopstar\constants\notice\MailerConstant;
use shopstar\models\core\attachment\CoreAttachmentModel;
use shopstar\models\core\CoreSettings;
/**
* This is the model class for table "{{%shop_settings}}".
*
* @property string $key 设置名
* @property string|null $value 设置值
*/
class ShopSettings extends BaseSettings
{
/**
* 公众号的类型 前端要求格式如此
* @var array
*/
public static $wechatTypeMap = [
[
'key' => 10,
'value' => '未认证订阅号'
],
[
'key' => 20,
'value' => '认证订阅号'
],
[
'key' => 30,
'value' => '未认证服务号'
],
[
'key' => 40,
'value' => '认证服务号'
],
];
/**
* {@inheritdoc}
*/
public static function tableName()
{
return '{{%config}}';
}
/**
* {@inheritdoc}
*/
public function rules()
{
return [
[['key'], 'required'],
[['value'], 'string'],
[['key'], 'string', 'max' => 50],
[['key'], 'unique', 'targetAttribute' => ['key']],
];
}
/**
* {@inheritdoc}
*/
public function attributeLabels()
{
return [
'key' => '设置名',
'value' => '设置值',
];
}
/**
* 读取设置
* @param string $key
* @param string $defaultValue
* @return array|mixed|string
* @author likexin
*/
public static function get($key = '', $defaultValue = '')
{
// 设置缓存前缀
static::setCachePrefix('shop_');
return parent::baseGet($key, $defaultValue, []);
}
/**
* 保存设置
* @param string $key
* @param string $value
* @param bool $mergeOriginalData
* @return bool
* @author likexin
*/
public static function set($key = '', $value = '', $mergeOriginalData = true)
{
// 设置缓存前缀
static::setCachePrefix('shop_');
return parent::baseSet($key, $value, $mergeOriginalData, []);
}
/**
* 删除设置项
* @param string $key
* @return array|mixed
* @author likexin
*/
public static function remove($key = '')
{
static::setCachePrefix('shop_');
// 设置缓存前缀
return parent::baseRemove($key, []);
}
/**
* 获取店铺支付方式
* @param $clientType
* @return array|mixed
*/
public static function getOpenPayType($clientType)
{
if (empty($clientType)) {
return error('客户端类型不能为空');
}
$settings = ShopSettings::get('sysset.payment.typeset')[$clientType];
if (!empty($settings)) {
foreach ($settings as &$setting) {
if (!(isset($setting['enabled']) && $setting['enabled'] == 1)) {
unset($setting);
}
}
unset($setting);
}
return $settings;
}
/**
* 获取压缩规则和储存方式
* @return mixed
* @author 青岛开店星信息技术有限公司
*/
public static function getImageCompressionRule()
{
$storage = self::get('service_storage');
// TODO likexin
$result = [
'storage_model' => $storage['storage_model'],
'type' => CoreSettings::get('storage.type'),
];
return $result;
}
/**
* 默认设置
* @return array
* @author likexin
*/
public static function defaultSettings()
{
return [
/**
* @var array 联系方式
*/
'contact' => [
'amap_key' => '', // 前端sdk调用高德key
'contact' => '', //联系人
'tel1' => '', //联系电话1
'tel2' => '', //联系电话2
'address' => [
'province' => '', // 省份
'province_code' => '', // 省份
'city' => '', // 城市
'city_code' => '', // 城市
'area' => '', // 区域
'area_code' => '', // 区域
'detail' => '', // 详细地址 全部文字 例如: 山东省青岛市市北区龙城路31号
'lng' => '', // 经度
'lat' => '', // 纬度
],
],
'goods_category' => [ //商品分类设置
'level' => 0,
'style' => 0,
'adv_url' => '',
'template_type' => 0, //模板类型 0默认模板 1快速购买模板
'title' => '商品分类', // 分类页面title
],
'member' => [
'rank' => [ // 排行榜设置
'credit_state' => 1,
'credit_num' => 50,
'money_state' => 1,
'money_num' => 50,
],
'level' => [ // 升级方式 1 订单完成后 2 付款后
'update_type' => "1"
]
],
'channel' => [ //渠道开启状态
'h5' => '0',
'wechat' => '0',
'wxapp' => '0',
'byte_dance' => '0',
],
'channel_setting' => [
'wxapp' => [
'appid' => '',
'app_secret' => '',
'maintain' => '0',//是否维护
'maintain_explain' => '',//维护说明
'show_commission' => '1',//显示分销
'navigate_appid_list' => [], // 跳转小程序列表
],
'wechat' => [
'name' => '', // 公众号名称
'type' => '', // 公众号类型
'app_id' => '',
'secret' => '',
'logo' => '',
'qr_code' => '', // 二维码
'bases' => [
'url' => '', // url 必须以http://或https://开头,分别支持80端口和443端口
'token' => '', // token 必须为英文或数字,长度为3-32字符
'encoding_aes_key' => '', // 消息加密密钥 由43位字符组成,可随机修改,字符范围为A-Z,a-z,0-9
'encryption_type' => 3 // 加密方式 1明文模式 2兼容模式 3安全模式
]
],
'registry_settings' => [
'coerce_auth' => 0,// 强制授权 0关闭 1开启
'coerce_auth_channel' => [ //强制授权渠道
'h5' => 0,
'wechat' => 0,
'byte_dance' => 0,
],// 强制授权 0关闭 1开启
'h5_login_method' => 0,// h5默认登录方式 0账号�
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
微信公众号+微信小程序+PC商城+H5商城+头条抖小程序多端覆盖,线上线下全场景支持 经典分销、虚拟卡密、视频号交易组件、秒杀、拼团、一键发圈、积分商城等等20+热门营销插件,轻松拓客引流 基于Yii2+Vue2.0+uniapp 前沿技术研发,易学易用,前后端分离,多端开发,负载均衡,性能优越架构稳定;商城商品、订单、用户精细化管理;涵盖秒杀、消费奖励、超级海报等20+营销插件;H5+小程序+公众号+PC,全渠道覆盖,线上线下全场景支持,框架成熟稳定便于扩展,高效二开,低成本快速搭建个性化商城。 **账号:admin 密码:admin**
资源推荐
资源详情
资源评论

























收起资源包目录





































































































共 2667 条
- 1
- 2
- 3
- 4
- 5
- 6
- 27
资源评论


办公模板库素材蛙
- 粉丝: 1747
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- 自动驾驶规划控制常用算法c++代码实现
- C++ 实现自动驾驶规划与控制常用算法代码
- Delphi算法与数据结构精要
- 基于树莓派的自动驾驶小车,利用树莓派和tensorflow实现小车在赛道的自动驾驶 (Self-driving car based on raspberry pi(tensorflow))
- 自动驾驶Apollo源码注释.(annotated Apollo 1.0 source code)
- 基于树莓派与 TensorFlow 的赛道自动驾驶小车实现
- Udacity 自动驾驶系列课程第一期学习内容
- 轻量级LMS 2.0:基于博客的在线评估新方法
- 自动驾驶领域各类算法的实现方式及原理深度分析 自动驾驶相关各类算法的具体实现路径与原理解析 自动驾驶领域各类算法实现方法及核心原理分析 自动驾驶相关各类算法的实现流程与原理深度剖析 自动驾驶领域各类算
- Udacity 自动驾驶培训课程首期班
- 基于 carla-ros-bridge 在 carla 实现自动驾驶规划与控制
- Android studio 打包uniapp
- 机器学习(预测模型):犯罪新闻标题二元分类任务的数据集
- 基于 carla-ros-bridge 在 carla 实现自动驾驶规划与控制
- 使用 TensorFlow 与 OpenCV 模拟自动驾驶系统 基于 TensorFlow 和 OpenCV 的自动驾驶模拟实现 借助 TensorFlow 与 OpenCV 进行自动驾驶模拟 采用
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制
