其余文件
This commit is contained in:
229
app/admin/controller/setting/Basic.php
Normal file
229
app/admin/controller/setting/Basic.php
Normal file
@ -0,0 +1,229 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeshop开源商城系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee
|
||||
// | github下载:https://github.com/likeshop-github
|
||||
// | 访问官网:https://www.likeshop.cn
|
||||
// | 访问社区:https://home.likeshop.cn
|
||||
// | 访问手册:http://doc.likeshop.cn
|
||||
// | 微信公众号:likeshop技术社区
|
||||
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
|
||||
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
|
||||
// | 禁止对系统程序代码以任何目的,任何形式的再发布
|
||||
// | likeshop团队版权所有并拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeshop.cn.team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\controller\setting;
|
||||
|
||||
use app\common\server\ConfigServer;
|
||||
use app\common\server\UrlServer;
|
||||
use app\common\basics\AdminBase;
|
||||
use app\admin\logic\setting\BasicLogic;
|
||||
use app\common\server\JsonServer;
|
||||
|
||||
/**
|
||||
* 基础设置
|
||||
* Class Basic
|
||||
* @package app\admin\controller\setting
|
||||
*/
|
||||
class Basic extends AdminBase
|
||||
{
|
||||
|
||||
/**
|
||||
* 网站配置
|
||||
* @return mixed
|
||||
*/
|
||||
public function website()
|
||||
{
|
||||
return view('', [
|
||||
'config' => BasicLogic::getBasicConfig()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 网站设置
|
||||
* @author 段誉(2021/6/10 20:32)
|
||||
* @return \think\response\Json
|
||||
*/
|
||||
public function setWebsite()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
if (empty($post['type'])) {
|
||||
return JsonServer::error('参数缺失');
|
||||
}
|
||||
if ($post['type'] == 'base') {
|
||||
BasicLogic::setWebsiteBasic($post);
|
||||
} elseif ($post['type'] == 'platform') {
|
||||
BasicLogic::setPlatform($post);
|
||||
} elseif ($post['type'] == 'shop') {
|
||||
BasicLogic::setShop($post);
|
||||
}
|
||||
return JsonServer::success('修改成功');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Notes: 版权备案
|
||||
* @author 段誉(2021/6/10 23:55)
|
||||
* @return \think\response\View
|
||||
*/
|
||||
public function copyright()
|
||||
{
|
||||
$result = BasicLogic::getCopyright();
|
||||
return view('', $result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Notes: 设置版权备案
|
||||
* @author 段誉(2021/6/10 23:55)
|
||||
* @return \think\response\Json
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function setCopyright()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
$result = BasicLogic::setCopyright($post);
|
||||
if (true !== $result) {
|
||||
return JsonServer::error($result);
|
||||
}
|
||||
return JsonServer::success('修改成功');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Notes: APP设置
|
||||
* @author 段誉(2021/6/11 1:00)
|
||||
* @return \think\response\View
|
||||
*/
|
||||
public function app()
|
||||
{
|
||||
$config = [
|
||||
'line_ios' => ConfigServer::get('app', 'line_ios', ''),
|
||||
'line_android' => ConfigServer::get('app', 'line_android', ''),
|
||||
'download_doc' => ConfigServer::get('app', 'download_doc', ''),
|
||||
'agreement' => ConfigServer::get('app', 'agreement', 0),
|
||||
'wechat_login' => ConfigServer::get('app', 'wechat_login', 0),
|
||||
];
|
||||
return view('', ['config' => $config]);
|
||||
}
|
||||
|
||||
public function setApp()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
$post['agreement'] = isset($post['agreement']) && $post['agreement'] == 'on' ? 1 : 0;
|
||||
$post['wechat_login'] = isset($post['wechat_login']) && $post['wechat_login'] == 'on' ? 1 : 0;
|
||||
ConfigServer::set('app', 'line_ios',$post['line_ios']);
|
||||
ConfigServer::set('app', 'line_android',$post['line_android']);
|
||||
ConfigServer::set('app', 'download_doc',$post['download_doc']);
|
||||
ConfigServer::set('app', 'agreement',$post['agreement']);
|
||||
ConfigServer::set('app', 'wechat_login',$post['wechat_login']);
|
||||
return JsonServer::success('修改成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 分享设置
|
||||
*/
|
||||
public function share()
|
||||
{
|
||||
$config = [
|
||||
'file_url' => UrlServer::getFileUrl(''),
|
||||
'h5' => ConfigServer::get('share', 'h5', [
|
||||
'h5_share_title' => '',
|
||||
'h5_share_intro' => '',
|
||||
'h5_share_image' => ''
|
||||
]),
|
||||
'mnp' => ConfigServer::get('share', 'mnp', [
|
||||
'mnp_share_title' => '',
|
||||
'mnp_share_image' => ''
|
||||
])
|
||||
];
|
||||
return view('', ['config' => $config]);
|
||||
}
|
||||
|
||||
public function setShare()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
$h5 = json_encode([
|
||||
'h5_share_title' => $post['h5_share_title'],
|
||||
'h5_share_intro' => $post['h5_share_intro'],
|
||||
'h5_share_image' => !empty($post['h5_share_image']) ? UrlServer::setFileUrl($post['h5_share_image']) : '',
|
||||
], JSON_UNESCAPED_UNICODE);
|
||||
$mnp = json_encode([
|
||||
'mnp_share_title' => $post['mnp_share_title'],
|
||||
'mnp_share_image' => !empty($post['mnp_share_image']) ? UrlServer::setFileUrl($post['mnp_share_image']) : '',
|
||||
], JSON_UNESCAPED_UNICODE);
|
||||
ConfigServer::set('share', 'h5', $h5);
|
||||
ConfigServer::set('share', 'mnp', $mnp);
|
||||
return JsonServer::success('修改成功');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Notes: 政策协议
|
||||
* @author 段誉(2021/6/11 0:41)
|
||||
* @return mixed
|
||||
*/
|
||||
public function policy()
|
||||
{
|
||||
$config = [
|
||||
'service' => HtmlGetImage(ConfigServer::get('policy', 'service')),
|
||||
'privacy' => HtmlGetImage(ConfigServer::get('policy', 'privacy')),
|
||||
'after_sale' => HtmlGetImage(ConfigServer::get('policy', 'after_sale')),
|
||||
'user_delete' => HtmlGetImage(ConfigServer::get('policy', 'user_delete')),
|
||||
];
|
||||
|
||||
return view('', ['config' => $config]);
|
||||
}
|
||||
|
||||
public function setPolicy()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
if ($post) {
|
||||
ConfigServer::set('policy', 'service', HtmlSetImage($post['service']));
|
||||
ConfigServer::set('policy', 'privacy', HtmlSetImage($post['privacy']));
|
||||
ConfigServer::set('policy', 'after_sale', HtmlSetImage($post['after_sale']));
|
||||
ConfigServer::set('policy', 'user_delete', HtmlSetImage($post['user_delete']));
|
||||
return JsonServer::success('修改成功');
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
* 会员提现设置
|
||||
*/
|
||||
public function withdraw(){
|
||||
$config = [
|
||||
'min_withdraw' => ConfigServer::get('withdraw', 'min_withdraw'),
|
||||
'max_withdraw' => ConfigServer::get('withdraw', 'max_withdraw'),
|
||||
'poundage' => ConfigServer::get('withdraw', 'poundage'),
|
||||
'type' => ConfigServer::get('withdraw', 'type') ? ConfigServer::get('withdraw', 'type') : [],
|
||||
'transfer_way' => ConfigServer::get('withdraw', 'transfer_way',1),
|
||||
];
|
||||
return view('', ['config' => $config]);
|
||||
}
|
||||
|
||||
/***
|
||||
* 会员提现设置提交
|
||||
*/
|
||||
public function setWithdraw()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
if(empty($post['type'])) {
|
||||
return JsonServer::error('至少选择一种提现方式');
|
||||
}
|
||||
if ($post) {
|
||||
ConfigServer::set('withdraw', 'min_withdraw', $post['min_withdraw']);//最低提现
|
||||
ConfigServer::set('withdraw', 'max_withdraw', $post['max_withdraw']);//最高提现
|
||||
ConfigServer::set('withdraw', 'poundage', $post['poundage']);//提现手续费
|
||||
ConfigServer::set('withdraw', 'type', $post['type']);//提现方式
|
||||
ConfigServer::set('withdraw', 'transfer_way', $post['transfer_way']);//微信零钱接口
|
||||
return JsonServer::success('操作成功');
|
||||
}
|
||||
}
|
||||
}
|
||||
39
app/admin/controller/setting/CustomerService.php
Normal file
39
app/admin/controller/setting/CustomerService.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
namespace app\admin\controller\setting;
|
||||
|
||||
use app\common\basics\AdminBase;
|
||||
use app\common\server\ConfigServer;
|
||||
use app\common\server\JsonServer;
|
||||
use app\common\server\UrlServer;
|
||||
|
||||
class CustomerService extends AdminBase
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$image = ConfigServer::get('customer_service', 'image', '');
|
||||
$image = $image ? UrlServer::getFileUrl($image) : '';
|
||||
$config = [
|
||||
'type' => ConfigServer::get('customer_service', 'type', 1),
|
||||
'wechat' => ConfigServer::get('customer_service', 'wechat', ''),
|
||||
'phone' => ConfigServer::get('customer_service', 'phone', ''),
|
||||
'business_time' => ConfigServer::get('customer_service', 'business_time', ''),
|
||||
'image' => $image,
|
||||
];
|
||||
return view('', [
|
||||
'config' => $config
|
||||
]);
|
||||
}
|
||||
|
||||
public function set()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
ConfigServer::set('customer_service', 'type', $post['type']);
|
||||
ConfigServer::set('customer_service', 'wechat', $post['wechat']);
|
||||
ConfigServer::set('customer_service', 'phone', $post['phone']);
|
||||
ConfigServer::set('customer_service', 'business_time', $post['business_time']);
|
||||
if(isset($post['image'])){
|
||||
ConfigServer::set('customer_service', 'image', clearDomain($post['image']));
|
||||
}
|
||||
return JsonServer::success('设置成功');
|
||||
}
|
||||
}
|
||||
86
app/admin/controller/setting/Hfdg.php
Normal file
86
app/admin/controller/setting/Hfdg.php
Normal file
@ -0,0 +1,86 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeshop开源商城系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee
|
||||
// | github下载:https://github.com/likeshop-github
|
||||
// | 访问官网:https://www.likeshop.cn
|
||||
// | 访问社区:https://home.likeshop.cn
|
||||
// | 访问手册:http://doc.likeshop.cn
|
||||
// | 微信公众号:likeshop技术社区
|
||||
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
|
||||
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
|
||||
// | 禁止对系统程序代码以任何目的,任何形式的再发布
|
||||
// | likeshop团队版权所有并拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeshop.cn.team
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\controller\setting;
|
||||
|
||||
use app\admin\validate\setting\HfdgValidate;
|
||||
use app\common\basics\AdminBase;
|
||||
use app\common\server\ConfigServer;
|
||||
use app\common\server\DouGong\pay\MerchantBusinessConfig;
|
||||
use app\common\server\JsonServer;
|
||||
use app\common\server\WeChatServer;
|
||||
use think\response\Json;
|
||||
use think\response\View;
|
||||
|
||||
/**
|
||||
* @notes 汇付斗拱
|
||||
* author lbzy
|
||||
* @datetime 2023-10-20 15:18:33
|
||||
* @class Hfdg
|
||||
* @package app\admin\controller\setting
|
||||
*/
|
||||
class Hfdg extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes 开发设置
|
||||
* @return Json|View
|
||||
* @author lbzy
|
||||
* @datetime 2023-10-20 15:19:41
|
||||
*/
|
||||
function dev_set()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
(new HfdgValidate())->goCheck('DevSet');
|
||||
ConfigServer::set('hfdg_dev_set', 'sys_id', input('sys_id'));
|
||||
ConfigServer::set('hfdg_dev_set', 'product_id', input('product_id'));
|
||||
ConfigServer::set('hfdg_dev_set', 'huifu_id', input('huifu_id'));
|
||||
ConfigServer::set('hfdg_dev_set', 'rsa_merch_private_key', input('rsa_merch_private_key'));
|
||||
ConfigServer::set('hfdg_dev_set', 'rsa_merch_public_key', input('rsa_merch_public_key'));
|
||||
ConfigServer::set('hfdg_dev_set', 'rsa_huifu_public_key', input('rsa_huifu_public_key'));
|
||||
return JsonServer::success('保存成功');
|
||||
}
|
||||
|
||||
return view('', [ 'config' => ConfigServer::get('hfdg_dev_set') ]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 微信商户设置
|
||||
* @return Json|View
|
||||
* @author lbzy
|
||||
* @datetime 2023-10-26 17:18:54
|
||||
*/
|
||||
private function wechat_set()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
if (empty(input('oa_app_id')) || empty(input('mnp_app_id'))) {
|
||||
return JsonServer::error('请先设置微信相关渠道');
|
||||
}
|
||||
$result = (new MerchantBusinessConfig(input()))->request()->getConfigResult();
|
||||
if ($result['code'] == 1) {
|
||||
return JsonServer::success('设置成功');
|
||||
} else {
|
||||
return JsonServer::error($result['msg']);
|
||||
}
|
||||
}
|
||||
|
||||
return view('', [
|
||||
'oa_app_id' => WeChatServer::getOaConfig()['app_id'] ?? '',
|
||||
'mnp_app_id' => WeChatServer::getMnpConfig()['app_id'] ?? '',
|
||||
]);
|
||||
}
|
||||
}
|
||||
29
app/admin/controller/setting/HotSearch.php
Normal file
29
app/admin/controller/setting/HotSearch.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
namespace app\admin\controller\setting;
|
||||
|
||||
use app\common\basics\AdminBase;
|
||||
use app\admin\logic\setting\HotSearchLogic;
|
||||
use app\common\server\JsonServer;
|
||||
|
||||
class HotSearch extends AdminBase
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$info = HotSearchLogic::info();
|
||||
return view('index', ['info' => $info]);
|
||||
}
|
||||
|
||||
public function set()
|
||||
{
|
||||
if($this->request->isPost()) {
|
||||
$post = $this->request->post();
|
||||
$result = HotSearchLogic::set($post);
|
||||
if($result){
|
||||
return JsonServer::success('设置成功');
|
||||
}
|
||||
return JsonServer::error('设置失败');
|
||||
}else{
|
||||
return JsonServer::error('请求方式错误');
|
||||
}
|
||||
}
|
||||
}
|
||||
51
app/admin/controller/setting/Map.php
Normal file
51
app/admin/controller/setting/Map.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeshop开源商城系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee
|
||||
// | github下载:https://github.com/likeshop-github
|
||||
// | 访问官网:https://www.likeshop.cn
|
||||
// | 访问社区:https://home.likeshop.cn
|
||||
// | 访问手册:http://doc.likeshop.cn
|
||||
// | 微信公众号:likeshop技术社区
|
||||
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
|
||||
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
|
||||
// | 禁止对系统程序代码以任何目的,任何形式的再发布
|
||||
// | likeshop团队版权所有并拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeshop.cn.team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\controller\setting;
|
||||
|
||||
use app\admin\logic\setting\MapLogic;
|
||||
use app\common\basics\AdminBase;
|
||||
use app\common\server\JsonServer;
|
||||
|
||||
/**
|
||||
* 地图peizhi
|
||||
* Class Map
|
||||
* @package app\admin\controller\setting
|
||||
*/
|
||||
class Map extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes 地图配置
|
||||
* @return \think\response\Json|\think\response\View
|
||||
* @author 段誉
|
||||
* @date 2022/1/17 10:30
|
||||
*/
|
||||
public function config()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
MapLogic::setConfig($post);
|
||||
return JsonServer::success('操作成功');
|
||||
}
|
||||
return view('', [
|
||||
'config' => MapLogic::getConfig()
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
45
app/admin/controller/setting/MarketingConfig.php
Normal file
45
app/admin/controller/setting/MarketingConfig.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
namespace app\admin\controller\setting;
|
||||
|
||||
use app\admin\logic\setting\MarketingConfigLogic;
|
||||
use app\common\basics\AdminBase;
|
||||
use app\common\enum\OrderEnum;
|
||||
use app\common\server\ConfigServer;
|
||||
use app\common\server\JsonServer;
|
||||
|
||||
/**
|
||||
* 营销设置
|
||||
* Class MarketingConfig
|
||||
* @package app\admin\controller\setting
|
||||
*/
|
||||
class MarketingConfig extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes 消费奖励
|
||||
* @return \think\response\Json|\think\response\View
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author ljj
|
||||
* @date 2022/2/18 4:10 下午
|
||||
*/
|
||||
public function orderAward()
|
||||
{
|
||||
if($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = MarketingConfigLogic::setOrderAward($post);
|
||||
if ($result !== true) {
|
||||
return JsonServer::error($result);
|
||||
}
|
||||
return JsonServer::success('设置成功');
|
||||
}
|
||||
|
||||
return view('', [
|
||||
'award_event_lists' => OrderEnum::getOrderAward(true),
|
||||
'open_award' => ConfigServer::get('order_award','open_award',0),
|
||||
'award_event' => ConfigServer::get('order_award','award_event',0),
|
||||
'award_ratio' => ConfigServer::get('order_award','award_ratio'),
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
109
app/admin/controller/setting/NoticeSetting.php
Normal file
109
app/admin/controller/setting/NoticeSetting.php
Normal file
@ -0,0 +1,109 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeshop开源商城系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee
|
||||
// | github下载:https://github.com/likeshop-github
|
||||
// | 访问官网:https://www.likeshop.cn
|
||||
// | 访问社区:https://home.likeshop.cn
|
||||
// | 访问手册:http://doc.likeshop.cn
|
||||
// | 微信公众号:likeshop技术社区
|
||||
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
|
||||
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
|
||||
// | 禁止对系统程序代码以任何目的,任何形式的再发布
|
||||
// | likeshop团队版权所有并拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeshop.cn.team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace app\admin\controller\setting;
|
||||
|
||||
|
||||
use app\admin\logic\NoticeSettingLogic;
|
||||
use app\common\basics\AdminBase;
|
||||
use app\common\enum\NoticeEnum;
|
||||
use app\common\server\JsonServer;
|
||||
use think\Db;
|
||||
|
||||
/**
|
||||
* 通知设置
|
||||
* Class NoticeSetting
|
||||
* @package app\admin\controller\setting
|
||||
*/
|
||||
class NoticeSetting extends AdminBase
|
||||
{
|
||||
|
||||
/**
|
||||
* Notes: 消息设置列表
|
||||
* @author 段誉(2021/4/27 17:17)
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$type = $get['type'] ?? NoticeEnum::NOTICE_USER;
|
||||
return JsonServer::success('获取成功', NoticeSettingLogic::lists($type));
|
||||
}
|
||||
return view();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Notes: 设置系统通知模板
|
||||
* @author 段誉(2021/4/27 17:18)
|
||||
* @return mixed
|
||||
* @throws \think\Exception
|
||||
* @throws \think\exception\PDOException
|
||||
*/
|
||||
public function set()
|
||||
{
|
||||
$id = $this->request->get('id');
|
||||
$type = $this->request->get('type');
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
NoticeSettingLogic::set($post);
|
||||
return JsonServer::success('操作成功');
|
||||
}
|
||||
return view('set_'.$type, [
|
||||
'info' => NoticeSettingLogic::info($id, $type),
|
||||
'type' => $type
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通知记录
|
||||
*/
|
||||
public function record()
|
||||
{
|
||||
if($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$data = NoticeSettingLogic::record($get);
|
||||
return JsonServer::success('', $data);
|
||||
}
|
||||
$param = $this->request->get();
|
||||
return view('', ['param' => $param]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除记录,直接删除(非软删除)
|
||||
*/
|
||||
public function delRecord()
|
||||
{
|
||||
$id = $this->request->post('id', '', 'intval');
|
||||
if(empty($id)) {
|
||||
return JsonServer::error('参数缺失,删除失败');
|
||||
}
|
||||
$res = Db::name('notice')->delete($id);
|
||||
if(!$res) {
|
||||
return JsonServer::error('删除失败');
|
||||
}
|
||||
return JsonServer::success('删除成功');
|
||||
}
|
||||
}
|
||||
209
app/admin/controller/setting/PayConfig.php
Normal file
209
app/admin/controller/setting/PayConfig.php
Normal file
@ -0,0 +1,209 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeshop开源商城系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee
|
||||
// | github下载:https://github.com/likeshop-github
|
||||
// | 访问官网:https://www.likeshop.cn
|
||||
// | 访问社区:https://home.likeshop.cn
|
||||
// | 访问手册:http://doc.likeshop.cn
|
||||
// | 微信公众号:likeshop技术社区
|
||||
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
|
||||
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
|
||||
// | 禁止对系统程序代码以任何目的,任何形式的再发布
|
||||
// | likeshop团队版权所有并拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeshop.cn.team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\controller\setting;
|
||||
|
||||
use app\admin\logic\PayConfigLogic;
|
||||
use app\common\basics\AdminBase;
|
||||
use app\common\server\ConfigServer;
|
||||
use app\common\server\JsonServer;
|
||||
use think\db\exception\DataNotFoundException;
|
||||
use think\db\exception\DbException;
|
||||
use think\db\exception\ModelNotFoundException;
|
||||
|
||||
/**
|
||||
* Class PayConfig
|
||||
* @package app\admin\controller\setting
|
||||
*/
|
||||
class PayConfig extends AdminBase
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 支付列表
|
||||
* @return \think\response\Json|\think\response\View
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author suny
|
||||
* @date 2021/7/13 7:03 下午
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
|
||||
if ($this->request->isAjax()) {
|
||||
return JsonServer::success('', PayConfigLogic::lists());
|
||||
}
|
||||
return view();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 余额配置
|
||||
* @return \think\response\Json|\think\response\View
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author suny
|
||||
* @date 2021/7/13 7:03 下午
|
||||
*/
|
||||
public function editBalance()
|
||||
{
|
||||
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
if (empty($post['image']) && $post['status'] == 1) {
|
||||
return JsonServer::error('请选择支付图标');
|
||||
}
|
||||
PayConfigLogic::editBalance($post);
|
||||
return JsonServer::success('修改成功');
|
||||
}
|
||||
return view('', ['info' => PayConfigLogic::info('balance')]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 微信配置
|
||||
* @return \think\response\Json|\think\response\View
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author suny
|
||||
* @date 2021/7/13 7:03 下午
|
||||
*/
|
||||
public function editWechat()
|
||||
{
|
||||
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
if ($post['status'] == 1) {
|
||||
if (empty($post['image'])) {
|
||||
return JsonServer::error('请选择支付图标');
|
||||
}
|
||||
if ($post['apiclient_cert'] == '' || $post['apiclient_key'] == '') {
|
||||
return JsonServer::error('apiclient_cert或apiclient_key不能为空');
|
||||
}
|
||||
}
|
||||
PayConfigLogic::editWechat($post);
|
||||
return JsonServer::success('修改成功');
|
||||
}
|
||||
$domain_name = ConfigServer::get('website', 'domain_name', '');
|
||||
return view('', [
|
||||
'domain' => $domain_name ? $domain_name : request()->domain(),
|
||||
'info' => PayConfigLogic::info('wechat')
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 支付宝配置
|
||||
* @return \think\response\Json|\think\response\View
|
||||
* @throws \think\Exception
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\PDOException
|
||||
* @author suny
|
||||
* @date 2021/7/13 7:03 下午
|
||||
*/
|
||||
public function editAlipay()
|
||||
{
|
||||
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
if (empty($post['image']) && $post['status'] == 1) {
|
||||
return JsonServer::error('请选择支付图标');
|
||||
}
|
||||
PayConfigLogic::editAlipay($post);
|
||||
return JsonServer::success('修改成功');
|
||||
}
|
||||
return view('', ['info' => PayConfigLogic::info('alipay')]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 汇付斗拱微信配置
|
||||
* @return \think\response\Json|\think\response\View
|
||||
* @throws DbException
|
||||
* @throws ModelNotFoundException
|
||||
* @throws DataNotFoundException
|
||||
* @author lbzy
|
||||
* @datetime 2023-10-08 14:47:06
|
||||
*/
|
||||
function editHfdgWechat()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
if (empty($post['image']) && $post['status'] == 1) {
|
||||
return JsonServer::error('请选择支付图标');
|
||||
}
|
||||
PayConfigLogic::editHfdgWechat($post);
|
||||
return JsonServer::success('修改成功');
|
||||
}
|
||||
|
||||
return view('', [ 'info' => PayConfigLogic::info('hfdg_wechat') ]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 汇付斗拱支付宝配置
|
||||
* @return \think\response\Json|\think\response\View
|
||||
* @throws DbException
|
||||
* @throws ModelNotFoundException
|
||||
* @throws DataNotFoundException
|
||||
* @author lbzy
|
||||
* @datetime 2023-10-18 14:55:30
|
||||
*/
|
||||
function editHfdgAlipay()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
if (empty($post['image']) && $post['status'] == 1) {
|
||||
return JsonServer::error('请选择支付图标');
|
||||
}
|
||||
PayConfigLogic::editHfdgAlipay($post);
|
||||
return JsonServer::success('修改成功');
|
||||
}
|
||||
|
||||
return view('', [ 'info' => PayConfigLogic::info('hfdg_alipay') ]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 线下支付
|
||||
* @return \think\response\Json|\think\response\View
|
||||
* @throws DataNotFoundException
|
||||
* @throws DbException
|
||||
* @throws ModelNotFoundException
|
||||
* @author ljj
|
||||
* @date 2024/7/19 下午3:16
|
||||
*/
|
||||
public function editOffline()
|
||||
{
|
||||
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
if (empty($post['image']) && $post['status'] == 1) {
|
||||
return JsonServer::error('请选择支付图标');
|
||||
}
|
||||
PayConfigLogic::editOffline($post);
|
||||
return JsonServer::success('修改成功');
|
||||
}
|
||||
return view('', ['info' => PayConfigLogic::info('offline')]);
|
||||
}
|
||||
|
||||
}
|
||||
30
app/admin/controller/setting/Register.php
Normal file
30
app/admin/controller/setting/Register.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
namespace app\admin\controller\setting;
|
||||
|
||||
use app\common\basics\AdminBase;
|
||||
use app\common\server\ConfigServer;
|
||||
use app\common\server\JsonServer;
|
||||
|
||||
class Register extends AdminBase
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$config = [
|
||||
// 'wechat_h5' => ConfigServer::get('login', 'wechat_h5', 0),
|
||||
'captcha' => ConfigServer::get('register', 'captcha', 0),
|
||||
'growth' => ConfigServer::get('register', 'growth', 0)
|
||||
];
|
||||
return view('', [
|
||||
'config' => $config
|
||||
]);
|
||||
}
|
||||
|
||||
public function set()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
// ConfigServer::set('login','wechat_h5', $post['wechat_h5']);
|
||||
ConfigServer::set('register','captcha', $post['captcha']);
|
||||
ConfigServer::set('register','growth', $post['growth']);
|
||||
return JsonServer::success('设置成功');
|
||||
}
|
||||
}
|
||||
45
app/admin/controller/setting/ShopWithdrawal.php
Normal file
45
app/admin/controller/setting/ShopWithdrawal.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\admin\controller\setting;
|
||||
|
||||
|
||||
use app\common\basics\AdminBase;
|
||||
use app\common\enum\ShopWithdrawEnum;
|
||||
use app\common\logic\SettingLogic;
|
||||
use app\common\server\ConfigServer;
|
||||
use app\common\server\JsonServer;
|
||||
use think\facade\View;
|
||||
|
||||
class ShopWithdrawal extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @Notes: 商家提现配置页
|
||||
* @Author: 张无忌
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('', [
|
||||
'detail' => SettingLogic::getShopWithdraw(),
|
||||
'type_list' => ShopWithdrawEnum::TYPE_TEXT_ARR2,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Notes: 设置商家提现
|
||||
* @Author: 张无忌
|
||||
*/
|
||||
public function set()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
|
||||
$withdrawal_type = $post['withdrawal_type'] ?? [];
|
||||
if (empty($withdrawal_type)) {
|
||||
return JsonServer::error('提现方式至少选择一种');
|
||||
}
|
||||
|
||||
SettingLogic::setShopWithdraw($post);
|
||||
|
||||
return JsonServer::success('设置成功');
|
||||
}
|
||||
}
|
||||
60
app/admin/controller/setting/SiteStatistic.php
Normal file
60
app/admin/controller/setting/SiteStatistic.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeshop开源商城系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee
|
||||
// | github下载:https://github.com/likeshop-github
|
||||
// | 访问官网:https://www.likeshop.cn
|
||||
// | 访问社区:https://home.likeshop.cn
|
||||
// | 访问手册:http://doc.likeshop.cn
|
||||
// | 微信公众号:likeshop技术社区
|
||||
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
|
||||
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
|
||||
// | 禁止对系统程序代码以任何目的,任何形式的再发布
|
||||
// | likeshop团队版权所有并拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeshop.cn.team
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\controller\setting;
|
||||
|
||||
use app\common\basics\AdminBase;
|
||||
use app\common\server\ConfigServer;
|
||||
use app\common\server\JsonServer;
|
||||
use think\db\exception\DataNotFoundException;
|
||||
use think\db\exception\DbException;
|
||||
use think\db\exception\ModelNotFoundException;
|
||||
use think\response\Json;
|
||||
use think\response\View;
|
||||
|
||||
/**
|
||||
* @notes 站点统计
|
||||
* author lbzy
|
||||
* @datetime 2024-10-30 09:45:49
|
||||
* @class Clarity
|
||||
* @package app\admin\controller\setting
|
||||
*/
|
||||
class SiteStatistic extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes 设置
|
||||
* @return Json|View
|
||||
* @throws DbException
|
||||
* @throws ModelNotFoundException
|
||||
* @throws DataNotFoundException
|
||||
* @author lbzy
|
||||
* @datetime 2024-10-30 09:46:08
|
||||
*/
|
||||
function set()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
|
||||
// 微软站点统计 https://clarity.microsoft.com
|
||||
ConfigServer::set('site_statistic', 'clarity_app_id', input('clarity_app_id'));
|
||||
|
||||
return JsonServer::success('保存成功');
|
||||
}
|
||||
|
||||
return view('', [ 'site_statistic' => ConfigServer::get('site_statistic') ]);
|
||||
}
|
||||
}
|
||||
104
app/admin/controller/setting/Sms.php
Normal file
104
app/admin/controller/setting/Sms.php
Normal file
@ -0,0 +1,104 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeshop开源商城系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee
|
||||
// | github下载:https://github.com/likeshop-github
|
||||
// | 访问官网:https://www.likeshop.cn
|
||||
// | 访问社区:https://home.likeshop.cn
|
||||
// | 访问手册:http://doc.likeshop.cn
|
||||
// | 微信公众号:likeshop技术社区
|
||||
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
|
||||
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
|
||||
// | 禁止对系统程序代码以任何目的,任何形式的再发布
|
||||
// | likeshop团队版权所有并拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeshop.cn.team
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\controller\setting;
|
||||
|
||||
|
||||
use app\admin\logic\setting\SmsLogic;
|
||||
use app\common\basics\AdminBase;
|
||||
use app\common\enum\SmsEnum;
|
||||
use app\common\server\ConfigServer;
|
||||
use app\common\server\JsonServer;
|
||||
|
||||
/**
|
||||
* 短信设置
|
||||
* Class Sms
|
||||
* @package app\admin\controller\setting
|
||||
*/
|
||||
class Sms extends AdminBase
|
||||
{
|
||||
|
||||
/**
|
||||
* Notes: 列表
|
||||
* @author 段誉(2021/6/7 14:46)
|
||||
* @return \think\response\Json|\think\response\View
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$lists = SmsLogic::configLists();
|
||||
return JsonServer::success('获取成功', $lists);
|
||||
}
|
||||
return view('', ['status_list' => SmsEnum::getSendStatusDesc(true)]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 短信配置
|
||||
* @author 段誉(2021/6/7 14:46)
|
||||
* @return \think\response\Json|\think\response\View
|
||||
*/
|
||||
public function config()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$res = SmsLogic::setConfig($post);
|
||||
if (false === $res) {
|
||||
return JsonServer::error(SmsLogic::getError());
|
||||
}
|
||||
return JsonServer::success('设置成功');
|
||||
}
|
||||
$engine = $this->request->get('engine');
|
||||
$info = SmsLogic::getConfigInfo($engine);
|
||||
if (false === $info) {
|
||||
return JsonServer::error('数据错误');
|
||||
}
|
||||
return view('', [
|
||||
'engine' => $engine,
|
||||
'info' => $info
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Notes: 短信记录->列表
|
||||
* @author 段誉(2021/6/7 14:46)
|
||||
* @return \think\response\Json
|
||||
*/
|
||||
public function logLists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = SmsLogic::logLists($get);
|
||||
return JsonServer::success('', $lists);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 短信记录->详情
|
||||
* @author 段誉(2021/6/7 14:46)
|
||||
* @return \think\response\View
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$id = $this->request->get('id');
|
||||
$info = SmsLogic::detail($id);
|
||||
return view('', ['info' => $info]);
|
||||
}
|
||||
}
|
||||
185
app/admin/controller/setting/StorageConfig.php
Normal file
185
app/admin/controller/setting/StorageConfig.php
Normal file
@ -0,0 +1,185 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeshop开源商城系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee
|
||||
// | github下载:https://github.com/likeshop-github
|
||||
// | 访问官网:https://www.likeshop.cn
|
||||
// | 访问社区:https://home.likeshop.cn
|
||||
// | 访问手册:http://doc.likeshop.cn
|
||||
// | 微信公众号:likeshop技术社区
|
||||
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
|
||||
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
|
||||
// | 禁止对系统程序代码以任何目的,任何形式的再发布
|
||||
// | likeshop团队版权所有并拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeshop.cn.team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace app\admin\controller\setting;
|
||||
|
||||
|
||||
use app\admin\validate\setting\StorageValidate;
|
||||
use app\common\basics\AdminBase;
|
||||
use app\common\server\ConfigServer;
|
||||
use app\common\server\JsonServer;
|
||||
|
||||
/**
|
||||
* 上传设置
|
||||
* Class StorageConfig
|
||||
* @package app\admin\controller
|
||||
*/
|
||||
class StorageConfig extends AdminBase
|
||||
{
|
||||
/**
|
||||
* Notes: 存储引擎列表
|
||||
* @author 张无忌(2021/2/22 11:43)
|
||||
* @return mixed
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$default = ConfigServer::get('storage', 'default', '');
|
||||
$data = [
|
||||
[
|
||||
'name' => '本地存储',
|
||||
'path' => '存储在本地服务器',
|
||||
'engine' => 'local',
|
||||
'status' => $default == 'local' ? 1 : 0
|
||||
],
|
||||
[
|
||||
'name' => '七牛云存储',
|
||||
'path' => '存储在七牛云,请前往七牛云开通存储服务',
|
||||
'engine' => 'qiniu',
|
||||
'status' => $default == 'qiniu' ? 1 : 0
|
||||
],
|
||||
[
|
||||
'name' => '阿里云OSS',
|
||||
'path' => '存储在阿里云,请前往阿里云开通存储服务',
|
||||
'engine' => 'aliyun',
|
||||
'status' => $default == 'aliyun' ? 1 : 0
|
||||
],
|
||||
[
|
||||
'name' => '腾讯云OSS',
|
||||
'path' => '存储在腾讯云,请前往腾讯云开通存储服务',
|
||||
'engine' => 'qcloud',
|
||||
'status' => $default == 'qcloud' ? 1 : 0
|
||||
]
|
||||
];
|
||||
return JsonServer::success('获取成功', ['lists' => $data]);
|
||||
}
|
||||
return view();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 编辑存储引擎
|
||||
* @author 张无忌(2021/2/22 11:43)
|
||||
* @return mixed
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$engine= $this->request->post('engine');
|
||||
$post = $this->request->post();
|
||||
|
||||
if ($engine != 'local') {
|
||||
$post['domain'] = $post[$engine . '_domain'] ?? '';
|
||||
$validate = new StorageValidate();
|
||||
if (! $validate->scene('edit')->check($post)) {
|
||||
return JsonServer::error('设置失败:' . $validate->getError());
|
||||
}
|
||||
}
|
||||
|
||||
if ($engine === 'qiniu') {
|
||||
|
||||
try {
|
||||
ConfigServer::set('storage_engine', 'qiniu', [
|
||||
'bucket' => $post['qiniu_bucket'],
|
||||
'access_key' => $post['qiniu_ak'],
|
||||
'secret_key' => $post['qiniu_sk'],
|
||||
'domain' => $post['qiniu_domain']
|
||||
]);
|
||||
} catch (\Exception $e) {
|
||||
return JsonServer::error('设置失败:'.$e->getMessage());
|
||||
}
|
||||
return JsonServer::success('设置成功');
|
||||
|
||||
} elseif ($engine === 'aliyun') {
|
||||
|
||||
try {
|
||||
ConfigServer::set('storage_engine', 'aliyun', [
|
||||
'bucket' => $post['aliyun_bucket'],
|
||||
'access_key_id' => $post['aliyun_ak'],
|
||||
'access_key_secret' => $post['aliyun_sk'],
|
||||
'domain' => $post['aliyun_domain']
|
||||
]);
|
||||
} catch (\Exception $e) {
|
||||
return JsonServer::error('设置失败:'.$e->getMessage());
|
||||
}
|
||||
return JsonServer::success('设置成功');
|
||||
|
||||
} elseif ($engine === 'qcloud') {
|
||||
|
||||
try {
|
||||
ConfigServer::set('storage_engine', 'qcloud', [
|
||||
'bucket' => $post['qcloud_bucket'],
|
||||
'region' => $post['qcloud_region'],
|
||||
'secret_id' => $post['qcloud_ak'],
|
||||
'secret_key' => $post['qcloud_sk'],
|
||||
'domain' => $post['qcloud_domain']
|
||||
]);
|
||||
} catch (\Exception $e) {
|
||||
return JsonServer::error('设置失败:'.$e->getMessage());
|
||||
}
|
||||
return JsonServer::success('设置成功');
|
||||
}
|
||||
return JsonServer::error('您设置的存储引擎不存在');
|
||||
}
|
||||
|
||||
$engine = $this->request->get('engine');
|
||||
$storage = [
|
||||
'qiniu' => ConfigServer::get('storage_engine', 'qiniu', [
|
||||
'bucket' => '',
|
||||
'access_key' => '',
|
||||
'secret_key' => '',
|
||||
'domain' => 'http://'
|
||||
]),
|
||||
'aliyun' => ConfigServer::get('storage_engine', 'aliyun', [
|
||||
'bucket' => '',
|
||||
'access_key_id' => '',
|
||||
'access_key_secret' => '',
|
||||
'domain' => 'http://'
|
||||
]),
|
||||
'qcloud' => ConfigServer::get('storage_engine', 'qcloud', [
|
||||
'bucket' => '',
|
||||
'region' => '',
|
||||
'secret_id' => '',
|
||||
'secret_key' => '',
|
||||
'domain' => 'http://'
|
||||
])
|
||||
];
|
||||
return view('', [
|
||||
'engine' => $engine,
|
||||
'storage' => $storage,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 切换存储引擎
|
||||
* @author 张无忌(2021/2/22 11:43)
|
||||
*/
|
||||
public function changeEngine()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
try {
|
||||
ConfigServer::set('storage', 'default', $post['engine']);
|
||||
} catch (\Exception $e) {
|
||||
return JsonServer::error('切换失败:'.$e->getMessage());
|
||||
}
|
||||
return JsonServer::success('切换成功');
|
||||
}
|
||||
}
|
||||
}
|
||||
40
app/admin/controller/setting/Transaction.php
Normal file
40
app/admin/controller/setting/Transaction.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
namespace app\admin\controller\setting;
|
||||
|
||||
use app\common\basics\AdminBase;
|
||||
use app\common\server\ConfigServer;
|
||||
use app\common\server\JsonServer;
|
||||
|
||||
/**
|
||||
* 交易设置
|
||||
*/
|
||||
class Transaction extends AdminBase
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$config = [
|
||||
'is_show_stock' => ConfigServer::get('transaction', 'is_show_stock', 0),
|
||||
'money_to_growth' => ConfigServer::get('transaction', 'money_to_growth', 0),
|
||||
'unpaid_order_cancel_time' => ConfigServer::get('transaction', 'unpaid_order_cancel_time', 60),
|
||||
'paid_order_cancel_time' => ConfigServer::get('transaction', 'paid_order_cancel_time', 60),
|
||||
'order_auto_receipt_days' => ConfigServer::get('transaction', 'order_auto_receipt_days', 7),
|
||||
'order_after_sale_days' => ConfigServer::get('transaction', 'order_after_sale_days', 7)
|
||||
];
|
||||
return view('', [
|
||||
'config' => $config
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function set()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
ConfigServer::set('transaction', 'is_show_stock', $post['is_show_stock']); //是否显示库存
|
||||
ConfigServer::set('transaction', 'money_to_growth', $post['money_to_growth']); //下单赠送成长值比例
|
||||
ConfigServer::set('transaction', 'unpaid_order_cancel_time', $post['unpaid_order_cancel_time']); //未付款自动取消时长(分钟)
|
||||
ConfigServer::set('transaction', 'paid_order_cancel_time', $post['paid_order_cancel_time']); //已支付允许取消时长(分钟)
|
||||
ConfigServer::set('transaction', 'order_auto_receipt_days', $post['order_auto_receipt_days']); //已发货订单自动完成时长(天)
|
||||
ConfigServer::set('transaction', 'order_after_sale_days', $post['order_after_sale_days']); //已完成订单售后退款时长(天)
|
||||
return JsonServer::success('设置成功');
|
||||
}
|
||||
}
|
||||
60
app/admin/controller/setting/User.php
Normal file
60
app/admin/controller/setting/User.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeshop开源商城系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee
|
||||
// | github下载:https://github.com/likeshop-github
|
||||
// | 访问官网:https://www.likeshop.cn
|
||||
// | 访问社区:https://home.likeshop.cn
|
||||
// | 访问手册:http://doc.likeshop.cn
|
||||
// | 微信公众号:likeshop技术社区
|
||||
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
|
||||
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
|
||||
// | 禁止对系统程序代码以任何目的,任何形式的再发布
|
||||
// | likeshop团队版权所有并拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeshop.cn.team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\controller\setting;
|
||||
|
||||
use app\admin\logic\setting\UserLogic;
|
||||
use app\common\basics\AdminBase;
|
||||
use app\common\server\JsonServer;
|
||||
|
||||
/**
|
||||
* 用户设置
|
||||
* Class User
|
||||
* @package app\admin\controller\setting
|
||||
*/
|
||||
class User extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes 用户设置
|
||||
* @return \think\response\View
|
||||
* @author Tab
|
||||
* @date 2021/9/1 10:07
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$config = UserLogic::getConfig();
|
||||
return view('', ['config' => $config,'user_level'=>UserLogic::getUserLevel()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 用户设置
|
||||
* @return \think\response\Json
|
||||
* @author Tab
|
||||
* @date 2021/9/1 10:33
|
||||
*/
|
||||
public function set()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$result = UserLogic::set($params);
|
||||
if($result) {
|
||||
return JsonServer::success('保存成功');
|
||||
}
|
||||
return JsonServer::error(UserLogic::getError());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user