first commit
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?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\behavior;
|
||||
|
||||
|
||||
use app\admin\cache\RoleMenuCache;
|
||||
use app\admin\cache\RoleNoneAuthCacheUris;
|
||||
|
||||
class ClearMenuAuthCache
|
||||
{
|
||||
|
||||
/**
|
||||
* 清除菜单权限缓存
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
(new RoleMenuCache())->delAll();
|
||||
(new RoleNoneAuthCacheUris())->delAll();
|
||||
}
|
||||
}
|
||||
@@ -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\behavior;
|
||||
|
||||
|
||||
use think\Db;
|
||||
use think\Request;
|
||||
|
||||
class SystemLog
|
||||
{
|
||||
/**
|
||||
* 记录后台操作日志
|
||||
* @param Request $request
|
||||
*/
|
||||
public function run(Request $request)
|
||||
{
|
||||
$admin_info = session('admin_info');
|
||||
if (!session('admin_info')) {
|
||||
return;
|
||||
}
|
||||
$data = [
|
||||
'admin_id' => $admin_info['id'],
|
||||
'account' => $admin_info['account'],
|
||||
'name' => $admin_info['name'],
|
||||
'create_time' => time(),
|
||||
'uri' => url(),
|
||||
'type' => $request->isPost() ? 'POST' : 'GET',
|
||||
'param' => json_encode($request->param(),JSON_UNESCAPED_UNICODE),
|
||||
'ip' => $request->ip(),
|
||||
];
|
||||
Db::name('system_log')->insert($data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?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\cache;
|
||||
|
||||
use app\admin\server\MenuServer;
|
||||
use app\common\cache\CacheBase;
|
||||
|
||||
/**
|
||||
* 登录控制
|
||||
* Class LoginCtrlCache
|
||||
* @package app\admin\cache
|
||||
*/
|
||||
class LoginStateCache extends CacheBase
|
||||
{
|
||||
|
||||
public function setTag()
|
||||
{
|
||||
return 'login_state';
|
||||
}
|
||||
|
||||
public function setData()
|
||||
{
|
||||
return time();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?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\cache;
|
||||
|
||||
use app\admin\server\MenuServer;
|
||||
use app\common\cache\CacheBase;
|
||||
|
||||
class RoleMenuCache extends CacheBase
|
||||
{
|
||||
|
||||
public function setTag()
|
||||
{
|
||||
return 'role_menu';
|
||||
}
|
||||
|
||||
public function setData()
|
||||
{
|
||||
return MenuServer::getMenuHtml($this->extend['role_id']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?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\cache;
|
||||
|
||||
use app\admin\server\AuthServer;
|
||||
use app\common\cache\CacheBase;
|
||||
|
||||
class RoleNoneAuthCacheIds extends CacheBase
|
||||
{
|
||||
|
||||
public function setTag()
|
||||
{
|
||||
|
||||
return 'role_none_auth_ids';
|
||||
}
|
||||
|
||||
public function setData()
|
||||
{
|
||||
return AuthServer::getRoleNoneAuthIds($this->extend['role_id']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?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\cache;
|
||||
|
||||
use app\admin\server\AuthServer;
|
||||
use app\common\cache\CacheBase;
|
||||
|
||||
class RoleNoneAuthCacheUris extends CacheBase
|
||||
{
|
||||
|
||||
public function setTag()
|
||||
{
|
||||
|
||||
return 'role_none_auth_uris';
|
||||
}
|
||||
|
||||
public function setData()
|
||||
{
|
||||
return AuthServer::getRoleNoneAuthUris($this->extend['role_id']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?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
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
use think\facade\Env;
|
||||
|
||||
return [
|
||||
|
||||
//默认错误跳转对应的模板文件
|
||||
'dispatch_error_tmpl' => '../application/admin/view/dispatch/error.html',
|
||||
//默认成功跳转对应的模板文件
|
||||
'dispatch_success_tmpl' => '../application/admin/view/dispatch/success.html',
|
||||
];
|
||||
@@ -0,0 +1,31 @@
|
||||
<?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
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
use think\facade\Env;
|
||||
|
||||
return [
|
||||
//免登录页面
|
||||
'free_login' => ['account_login'],
|
||||
|
||||
//样式显示
|
||||
'env_name' => Env::get('project.env_name', '本地环境-'),
|
||||
'admin_name' => Env::get('project.admin_name', 'LikeShop管理后台'),
|
||||
'theme_color' => 'layui-bg-blue',
|
||||
'theme_button' => 'layui-btn-normal',
|
||||
];
|
||||
@@ -0,0 +1,36 @@
|
||||
<?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
|
||||
// +----------------------------------------------------------------------
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | 模板设置
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
//'layout_on' => true,
|
||||
//'layout_name' => 'layout',
|
||||
];
|
||||
@@ -0,0 +1,64 @@
|
||||
<?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;
|
||||
|
||||
|
||||
use app\admin\logic\LoginLogic;
|
||||
use app\admin\validate\Login;
|
||||
use think\facade\Url;
|
||||
|
||||
class Account extends AdminBase
|
||||
{
|
||||
|
||||
public $like_not_need_login = ['login'];
|
||||
|
||||
/**
|
||||
* 登录
|
||||
* @return mixed
|
||||
*/
|
||||
public function login()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = input('post.');
|
||||
$result = $this->validate($post, 'app\admin\validate\Login');
|
||||
if ($result === true) {
|
||||
LoginLogic::login($post);
|
||||
$this->_success('登录成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->assign('account', cookie('account'));
|
||||
|
||||
//首页配置
|
||||
$this->assign('config', LoginLogic::config());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出登录
|
||||
*/
|
||||
public function logout()
|
||||
{
|
||||
LoginLogic::logout(session('admin_info.id'));
|
||||
$url = Url::build('account/login');
|
||||
$this->redirect($url);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
use app\admin\logic\AccountLogLogic;
|
||||
use think\helper\Time;
|
||||
|
||||
class AccountLog extends AdminBase{
|
||||
/**
|
||||
* note 资金记录
|
||||
* create_time 2020/11/20 17:36
|
||||
*/
|
||||
public function capitalList(){
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$list = AccountLogLogic::lists($get);
|
||||
$this->_success('',$list);
|
||||
}
|
||||
$this->assign('order_source',AccountLogLogic::orderSourceList(1));
|
||||
$this->assign('time',AccountLogLogic::getTime());
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* note 积分记录
|
||||
* create_time 2020/11/20 17:36
|
||||
*/
|
||||
public function integralList(){
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$list = AccountLogLogic::lists($get);
|
||||
$this->_success('',$list);
|
||||
}
|
||||
$this->assign('order_source',AccountLogLogic::orderSourceList(2));
|
||||
$this->assign('time',AccountLogLogic::getTime());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 成长值记录
|
||||
* create_time 2020/11/20 17:36
|
||||
*/
|
||||
public function growthList(){
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$list = AccountLogLogic::lists($get);
|
||||
$this->_success('',$list);
|
||||
}
|
||||
$this->assign('order_source',AccountLogLogic::orderSourceList(3));
|
||||
$this->assign('time',AccountLogLogic::getTime());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Notes: 佣金记录
|
||||
* @author 段誉(2021/5/15 11:36)
|
||||
* @return mixed
|
||||
*/
|
||||
public function withdrawList()
|
||||
{
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$list = [];
|
||||
switch ($get['type']) {
|
||||
case 'distribution':
|
||||
$list = AccountLogLogic::getDistributionLog($get);
|
||||
break;
|
||||
}
|
||||
$this->_success('',$list);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Notes: 佣金统计
|
||||
* @author 段誉(2021/5/15 11:36)
|
||||
*/
|
||||
public function withdrawTotalCount()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$result = AccountLogLogic::withdrawTotalCount($get);
|
||||
$this->_success('OK', $result);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
<?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;
|
||||
use app\admin\logic\ActivityAreaLogic;
|
||||
class Activity extends AdminBase{
|
||||
public function lists(){
|
||||
$this->assign('activity_list',ActivityAreaLogic::getActivityList());
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* note 活动专区列表
|
||||
* create_time 2020/11/25 10:36
|
||||
*/
|
||||
public function areaLists(){
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$list = ActivityAreaLogic::areaLists($get);
|
||||
$this->_success('',$list);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* note 活动商品列表
|
||||
* create_time 2020/11/25 10:36
|
||||
*/
|
||||
public function goodsLists(){
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$list = ActivityAreaLogic::goodsLists($get);
|
||||
$this->_success('',$list);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* note 添加活动专区
|
||||
* create_time 2020/11/25 10:37
|
||||
*/
|
||||
public function addActivity(){
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post,'app\admin\validate\ActivityArea.add');
|
||||
if($result === true){
|
||||
ActivityAreaLogic::addActivity($post);
|
||||
$this->_success('新增成功',[]);
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 编辑活动专区
|
||||
* create_time 2020/11/25 10:37
|
||||
*/
|
||||
public function editActivity($id){
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post,'app\admin\validate\ActivityArea');
|
||||
if($result === true){
|
||||
ActivityAreaLogic::editActivity($post);
|
||||
$this->_success('编辑成功',[]);
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->assign('info',ActivityAreaLogic::getActivity($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 删除活动专区
|
||||
* create_time 2020/11/25 10:37
|
||||
*/
|
||||
public function delActivity(){
|
||||
$id = $this->request->post('id');
|
||||
ActivityAreaLogic::delActivity($id);
|
||||
$this->_success('删除成功',[]);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* note 添加活动商品
|
||||
* create_time 2020/11/25 10:37
|
||||
*/
|
||||
public function addGoods(){
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['goods_list'] = form_to_linear($post);
|
||||
$result = $this->validate($post,'app\admin\validate\ActivityGoods.add');
|
||||
if($result === true){
|
||||
ActivityAreaLogic::addGoods($post);
|
||||
$this->_success('新增成功',[]);
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->assign('activity_list',ActivityAreaLogic::getActivityList());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 编辑活动商品
|
||||
* create_time 2020/11/25 10:37
|
||||
*/
|
||||
public function editGoods(){
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post,'app\admin\validate\ActivityGoods');
|
||||
|
||||
if($result === true){
|
||||
ActivityAreaLogic::editGoods($post);
|
||||
$this->_success('新增成功',[]);
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$goods_id = $this->request->get('goods_id');
|
||||
$activity_id = $this->request->get('activity_id');
|
||||
$this->assign('activity_list',ActivityAreaLogic::getActivityList());
|
||||
$this->assign('info',ActivityAreaLogic::getActivityGoods($goods_id,$activity_id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 删除活动商品
|
||||
* create_time 2020/11/25 10:38
|
||||
*/
|
||||
public function delGoods(){
|
||||
$goods_id = $this->request->post('goods_id');
|
||||
$activity_id = $this->request->post('activity_id');
|
||||
$result = ActivityAreaLogic::delGoods($goods_id,$activity_id);
|
||||
if($result == true){
|
||||
$this->_success('删除成功','');
|
||||
}
|
||||
return $this->_error('删除失败','');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
<?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;
|
||||
|
||||
use app\admin\logic\AdLogic;
|
||||
|
||||
class Ad extends AdminBase
|
||||
{
|
||||
|
||||
/**
|
||||
* 广告管理列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$this->_success('获取成功', AdLogic::lists($get));
|
||||
}
|
||||
$type = \app\common\model\Ad::getAdTypeDesc(true);
|
||||
$this->assign('type', $type);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @return mixed
|
||||
*/
|
||||
public function add($client = '')
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\Ad.add');
|
||||
if ($result === true) {
|
||||
$result = AdLogic::add($post);
|
||||
if ($result) {
|
||||
$this->_success('添加成功!');
|
||||
} else {
|
||||
$this->_error('添加失败');
|
||||
}
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->assign('category_list',AdLogic::getGoodsCategory());
|
||||
$this->assign('link_page', \app\common\model\Ad::getLinkPage($client));
|
||||
$this->assign('position_list', AdLogic::infoPosition($client));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param string $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function edit($id = '')
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\Ad');
|
||||
if ($result === true) {
|
||||
$result = AdLogic::edit($post);
|
||||
if ($result) {
|
||||
$this->_success('编辑成功!');
|
||||
} else {
|
||||
$this->_error('编辑失败');
|
||||
}
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$info = AdLogic::info($id);
|
||||
$this->assign('position_list', AdLogic::infoPosition($info['client']));
|
||||
$this->assign('category_list',AdLogic::getGoodsCategory());
|
||||
$this->assign('link_page', \app\common\model\Ad::getLinkPage($info['client']));
|
||||
$this->assign('info', $info);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param $delData
|
||||
*/
|
||||
public function del($id, $client)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$result = AdLogic::del($id, $client);
|
||||
if ($result) {
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error('删除失败');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
*/
|
||||
public function switchStatus()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
$result = AdLogic::switchStatus($post);
|
||||
if ($result) {
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error('修改失败');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取相应广告位置尺寸
|
||||
*/
|
||||
public function imgSize()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$result = AdLogic::imgSize($get);
|
||||
if ($result) {
|
||||
$this->_success('', $result);
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取对应终端的广告位置列表
|
||||
*/
|
||||
public function getPosition()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$client = $this->request->get('client');
|
||||
$result = AdLogic::infoPosition($client);
|
||||
if ($result) {
|
||||
$this->_success('', $result);
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
<?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;
|
||||
|
||||
|
||||
use app\admin\logic\AdPositionLogic;
|
||||
use app\common\model\Ad;
|
||||
|
||||
class AdPosition extends AdminBase
|
||||
{
|
||||
|
||||
/**
|
||||
* 广告管理列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$result = AdPositionLogic::lists($get);
|
||||
$this->_success('获取成功', $result);
|
||||
}
|
||||
$type = \app\common\model\Ad::getAdTypeDesc(true);
|
||||
$this->assign('type', $type);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @return mixed
|
||||
*/
|
||||
public function add($client = '')
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\AdPosition.add');
|
||||
if ($result === true) {
|
||||
$result = AdPositionLogic::addAdPosition($post);
|
||||
if ($result) {
|
||||
$this->_success('添加成功!');
|
||||
} else {
|
||||
$this->_error('添加失败');
|
||||
}
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param string $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function edit($id = '')
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\AdPosition.edit');
|
||||
if ($result === true) {
|
||||
$result = AdPositionLogic::editAdPosition($post);
|
||||
if ($result) {
|
||||
$this->_success('编辑成功!');
|
||||
} else {
|
||||
$this->_error('编辑失败');
|
||||
}
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
$this->assign('info', AdPositionLogic::info($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param $delData
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$delData = $this->request->post('delData');
|
||||
$attr = $this->request->post('attr');
|
||||
$client = $this->request->post('client');
|
||||
$result = $this->validate($post, 'app\admin\validate\AdPosition.del');
|
||||
|
||||
if ($result === true) {
|
||||
$result = AdPositionLogic::del($delData, $client, $attr);
|
||||
if ($result) {
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error('删除失败');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
*/
|
||||
public function switchStatus()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
$result = AdPositionLogic::switchStatus($post);
|
||||
if ($result) {
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error('修改失败');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
<?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;
|
||||
|
||||
|
||||
use app\admin\logic\AdminLogic;
|
||||
|
||||
class Admin extends AdminBase
|
||||
{
|
||||
|
||||
/**
|
||||
* 管理员列表
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$this->_success('', AdminLogic::lists($get));
|
||||
}
|
||||
|
||||
$this->assign('role_lists', AdminLogic::roleLists());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加管理员
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['disable'] = isset($post['disable']) && $post['disable'] == 'on' ? 0 : 1;
|
||||
$result = $this->validate($post, 'app\admin\validate\Admin.add');
|
||||
if ($result === true) {
|
||||
AdminLogic::addAdmin($post);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->assign('role_lists', AdminLogic::roleLists());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑管理员
|
||||
* @param string $admin_id
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function edit($admin_id = '')
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['disable'] = isset($post['disable']) && $post['disable'] == 'on' ? 0 : 1;
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\Admin.edit');
|
||||
if ($result === true) {
|
||||
AdminLogic::editAdmin($post);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
$this->assign('info', AdminLogic::info($admin_id));
|
||||
$this->assign('role_lists', AdminLogic::roleLists());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除管理员
|
||||
* @param $admin_id
|
||||
* @throws \think\Exception
|
||||
* @throws \think\exception\PDOException
|
||||
*/
|
||||
public function del($admin_id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$result = AdminLogic::delAdmin($admin_id);
|
||||
if ($result) {
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error('删除失败');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,181 @@
|
||||
<?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;
|
||||
|
||||
|
||||
use app\admin\server\AuthServer;
|
||||
use app\BaseController;
|
||||
use app\common\server\UrlServer;
|
||||
use think\Controller;
|
||||
use think\exception\HttpResponseException;
|
||||
use think\facade\Config;
|
||||
use think\facade\Debug;
|
||||
use think\facade\Url;
|
||||
use think\Response;
|
||||
|
||||
class AdminBase extends Controller
|
||||
{
|
||||
|
||||
public $like_not_need_login = [];
|
||||
|
||||
protected $js_data = [];
|
||||
|
||||
public $admin_info = [];
|
||||
public $admin_id;
|
||||
public $view_theme_color = '';
|
||||
|
||||
public $page_no = 1;
|
||||
public $page_size = 15;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->setValue();
|
||||
self::setViewValue();
|
||||
}
|
||||
|
||||
public function setValue()
|
||||
{
|
||||
$this->admin_info = session('admin_info');
|
||||
$this->admin_id = session('admin_info.id');
|
||||
|
||||
//分页参数
|
||||
$page_no = (int)$this->request->get('page_no');
|
||||
$this->page_no = $page_no && is_numeric($page_no) ? $page_no : $this->page_no;
|
||||
$page_size = (int)$this->request->get('page_size');
|
||||
$this->page_size = $page_size && is_numeric($page_size) ? $page_size : $this->page_size;
|
||||
$this->page_size = min($this->page_size, 100);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置视图全局变量
|
||||
*/
|
||||
private function setViewValue()
|
||||
{
|
||||
$app = Config::get('project.');
|
||||
$this->assign('view_env_name', $app['env_name']);
|
||||
$this->assign('view_admin_name', $app['admin_name']);
|
||||
$this->assign('view_theme_color', $app['theme_color']);
|
||||
$this->assign('view_theme_button', $app['theme_button']);
|
||||
$this->assign('version', $app['version']);
|
||||
$this->assign('front_version', $app['front_version']);
|
||||
$this->assign('storageUrl', UrlServer::getFileUrl('/'));
|
||||
|
||||
$this->assignJs('image_upload_url', Url::build('file/image'));
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 lr
|
||||
* Desc: 请求成功
|
||||
* @param string $msg
|
||||
* @param array $data
|
||||
* @param int $code
|
||||
* @param int $show
|
||||
* @param array $header
|
||||
*/
|
||||
protected function _success($msg = '', $data = [], $code = 1, $show = 0, $wait = 3, $url = '', array $header = [])
|
||||
{
|
||||
$type = $this->getResponseType();
|
||||
$time = Debug::getUseTime();
|
||||
$result = [
|
||||
'code' => $code,
|
||||
'msg' => $msg,
|
||||
'data' => $data,
|
||||
'show' => $show,
|
||||
'time' => $time,
|
||||
'wait' => $wait,
|
||||
'url' => $url,
|
||||
];
|
||||
$type = $this->getResponseType();
|
||||
// 把跳转模板的渲染下沉,这样在 response_send 行为里通过getData()获得的数据是一致性的格式
|
||||
if ('html' == strtolower($type)) {
|
||||
$type = 'jump';
|
||||
}
|
||||
|
||||
$response = Response::create($result, $type)->header($header)->options(['jump_template' => $this->app['config']->get('dispatch_success_tmpl')]);
|
||||
|
||||
throw new HttpResponseException($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 lr
|
||||
* Desc: 请求失败
|
||||
* @param string $msg
|
||||
* @param array $data
|
||||
* @param int $code
|
||||
* @param int $show
|
||||
* @param array $header
|
||||
*/
|
||||
protected function _error($msg = '', $data = [], $code = 0, $show = 1, $wait = 3, $url = '', array $header = [])
|
||||
{
|
||||
$type = $this->getResponseType();
|
||||
$time = Debug::getUseTime();
|
||||
$result = [
|
||||
'code' => $code,
|
||||
'msg' => $msg,
|
||||
'data' => $data,
|
||||
'show' => $show,
|
||||
'time' => $time,
|
||||
'wait' => $wait,
|
||||
'url' => $url,
|
||||
|
||||
];
|
||||
if ('html' == strtolower($type)) {
|
||||
$type = 'jump';
|
||||
}
|
||||
|
||||
$response = Response::create($result, $type)->header($header)->options(['jump_template' => $this->app['config']->get('dispatch_error_tmpl')]);
|
||||
|
||||
throw new HttpResponseException($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 lr
|
||||
* Desc: 通过返回
|
||||
* @param $data
|
||||
*/
|
||||
protected function successOrError($data)
|
||||
{
|
||||
if ($data['code'] == 1) {
|
||||
$this->_success($data['msg'], $data['data'], $data['code'], $data['show']);
|
||||
}
|
||||
$this->_error($data['msg'], $data['data'], $data['code'], $data['show']);
|
||||
}
|
||||
|
||||
|
||||
protected function assignJs($name, $value)
|
||||
{
|
||||
$this->js_data[$name] = $value;
|
||||
$js_code = "<script>";
|
||||
foreach ($this->js_data as $name => $value) {
|
||||
if (is_array($value)) {
|
||||
$value = json_encode($value);
|
||||
} elseif (!is_integer($value)) {
|
||||
$value = '"' . $value . '"';
|
||||
}
|
||||
$js_code .= $name . '=' . $value . ';';
|
||||
}
|
||||
$js_code .= "</script>";
|
||||
$this->assign('js_code', $js_code);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
<?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;
|
||||
|
||||
use app\admin\logic\AfterSaleLogic;
|
||||
use app\common\model\AfterSale as CommonAfterSale;
|
||||
|
||||
class AfterSale extends AdminBase
|
||||
{
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 列表
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
|
||||
// 添加输入验证
|
||||
$rules = [
|
||||
'type|订单类型' => 'number',
|
||||
'status|状态' => 'number',
|
||||
'search_key|搜索类型' => 'in:sn,order_sn,goods_name,user_sn,nickname,user_mobile',
|
||||
'keyword|关键词' => 'length:1,50',
|
||||
'start_time|开始时间' => 'date',
|
||||
'end_time|结束时间' => 'date',
|
||||
'page|页码' => 'require|number',
|
||||
'limit|每页数量' => 'require|number'
|
||||
];
|
||||
|
||||
$validate = new \think\Validate($rules);
|
||||
if (!$validate->check($get)) {
|
||||
$this->_error($validate->getError());
|
||||
}
|
||||
|
||||
$this->_success('', AfterSaleLogic::lists($get));
|
||||
}
|
||||
$this->assign('status', CommonAfterSale::getStatusDesc(true));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 详情
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$id = $this->request->get('id');
|
||||
$detail = AfterSaleLogic::getDetail($id);
|
||||
$this->assign('detail', $detail);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 同意
|
||||
*/
|
||||
public function agree()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post('');
|
||||
$check = $this->validate($post, 'app\admin\validate\AfterSale.agree');
|
||||
if (true !== $check) {
|
||||
$this->_error($check);
|
||||
}
|
||||
AfterSaleLogic::agree($post['id'],$this->admin_id);
|
||||
$this->_success('操作成功');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 拒绝
|
||||
*/
|
||||
public function refuse()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post('');
|
||||
$check = $this->validate($post, 'app\admin\validate\AfterSale.refuse');
|
||||
if (true !== $check) {
|
||||
$this->_error($check);
|
||||
}
|
||||
AfterSaleLogic::refuse($post,$this->admin_id);
|
||||
$this->_success('操作成功');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 收货
|
||||
*/
|
||||
public function take()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post('');
|
||||
$check = $this->validate($post, 'app\admin\validate\AfterSale.take');
|
||||
if (true !== $check) {
|
||||
$this->_error($check);
|
||||
}
|
||||
AfterSaleLogic::takeGoods($post,$this->admin_id);
|
||||
$this->_success('操作成功');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 拒绝收货
|
||||
*/
|
||||
public function refuseGoods()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post('');
|
||||
$check = $this->validate($post, 'app\admin\validate\AfterSale.refuse_goods');
|
||||
if (true !== $check) {
|
||||
$this->_error($check);
|
||||
}
|
||||
AfterSaleLogic::refuseGoods($post,$this->admin_id);
|
||||
$this->_success('操作成功');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 确认退款
|
||||
*/
|
||||
public function confirm()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post('');
|
||||
$check = $this->validate($post, 'app\admin\validate\AfterSale.confirm');
|
||||
if (true !== $check) {
|
||||
$this->_error($check);
|
||||
}
|
||||
$res = AfterSaleLogic::confirm($post,$this->admin_id);
|
||||
if ($res === true){
|
||||
$this->_success('操作成功');
|
||||
}
|
||||
$this->_error($res);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
<?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;
|
||||
|
||||
use app\admin\logic\{
|
||||
ArticleLogic,
|
||||
ArticleCategoryLogic
|
||||
};
|
||||
|
||||
class Article extends AdminBase
|
||||
{
|
||||
/**
|
||||
* 文章列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
$category = ArticleCategoryLogic::getArticleCategory();
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$this->_success('', ArticleLogic::lists($get, $category));
|
||||
}
|
||||
$this->assign('category_list', $category);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加文章
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\Article.add');
|
||||
if ($result === true) {
|
||||
ArticleLogic::addArticle($post);
|
||||
$this->_success('添加成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
|
||||
}
|
||||
$acticle_category = ArticleCategoryLogic::getArticleCategory();
|
||||
$this->assign('category_list', $acticle_category);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑文章
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\Article.edit');
|
||||
|
||||
if ($result === true) {
|
||||
ArticleLogic::editArticle($post);
|
||||
$this->_success('编辑成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
|
||||
}
|
||||
$article = ArticleLogic::getArticle($id);
|
||||
$category_list = ArticleCategoryLogic::getArticleCategory();
|
||||
$this->assign('article', $article);
|
||||
$this->assign('category_list', $category_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文章
|
||||
*/
|
||||
public function del($id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$result = $this->validate(['id' => $id], 'app\admin\validate\Article.del');
|
||||
if ($result === true) {
|
||||
ArticleLogic::delArticle($id);
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
*/
|
||||
public function switchStatus()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
ArticleLogic::switchStatus($post);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
<?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;
|
||||
use app\admin\logic\{
|
||||
ArticleCategoryLogic
|
||||
};
|
||||
class ArticleCategory extends AdminBase {
|
||||
/**
|
||||
* 文章分类列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function lists(){
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$this->_success('', ArticleCategoryLogic::lists($get));
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* 添加文章分类
|
||||
* @return mixed
|
||||
*/
|
||||
public function add(){
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\ArticleCategory');
|
||||
if($result === true){
|
||||
ArticleCategoryLogic::addArticleCategory($post);
|
||||
$this->_success('添加成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑文章分类
|
||||
* @return mixed
|
||||
*/
|
||||
public function edit($id){
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\ArticleCategory.edit');
|
||||
if($result === true){
|
||||
ArticleCategoryLogic::editArticleCategory($post);
|
||||
$this->_success('编辑成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$category= ArticleCategoryLogic::getArticleCategory($id);
|
||||
$this->assign('category',array_values($category)[0]);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文章分类
|
||||
* @return mixed
|
||||
*/
|
||||
public function del($id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$result = $this->validate(['id' => $id], 'app\admin\validate\ArticleCategory.del');
|
||||
if ($result === true) {
|
||||
ArticleCategoryLogic::delArticleCategory($id);
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
*/
|
||||
public function switchStatus(){
|
||||
$post = $this->request->post();
|
||||
ArticleCategoryLogic::switchStatus($post);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
<?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;
|
||||
|
||||
|
||||
use app\admin\logic\AuthLogic;
|
||||
use think\facade\Hook;
|
||||
use think\facade\Url;
|
||||
|
||||
class Auth extends AdminBase
|
||||
{
|
||||
/**
|
||||
* 菜单列表
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
$lists = json_encode(AuthLogic::lists());
|
||||
$this->assign('lists', $lists);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加菜单
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['disable'] = isset($post['disable']) && $post['disable'] == 'on' ? 0 : 1;
|
||||
$result = $this->validate($post, 'app\admin\validate\Auth');
|
||||
if ($result === true) {
|
||||
$result = AuthLogic::addMenu($post);
|
||||
if (!is_string($result)) {
|
||||
$this->_success('添加成功');
|
||||
} else {
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->assign('menu_lists', AuthLogic::chooseMenu());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑菜单
|
||||
* @param $id
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['disable'] = isset($post['disable']) && $post['disable'] == 'on' ? 0 : 1;
|
||||
$result = $this->validate($post, 'app\admin\validate\Auth');
|
||||
if ($result === true) {
|
||||
$result = AuthLogic::updateMenu($post);
|
||||
if (!is_string($result)) {
|
||||
$this->_success('修改成功');
|
||||
} else {
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->assign('info', AuthLogic::info($id));
|
||||
$this->assign('menu_lists', AuthLogic::chooseMenu($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置状态
|
||||
* @throws \think\Exception
|
||||
* @throws \think\exception\PDOException
|
||||
*/
|
||||
public function status()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
AuthLogic::setStatus($post);
|
||||
Hook::listen('menu_auth');
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除菜单
|
||||
* @throws \think\Exception
|
||||
* @throws \think\exception\PDOException
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
if (empty($post['ids'])) {
|
||||
$this->_error('删除失败');
|
||||
}
|
||||
AuthLogic::delMenu($post['ids']);
|
||||
Hook::listen('menu_auth');
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,204 @@
|
||||
<?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;
|
||||
|
||||
|
||||
use app\admin\logic\BargainLogic;
|
||||
use app\common\model\BargainLaunch;
|
||||
use app\common\server\ConfigServer;
|
||||
|
||||
class Bargain extends AdminBase
|
||||
{
|
||||
/**
|
||||
* Notes: 砍价活动 商品列表
|
||||
* @author 张无忌(2021/1/30 15:06)
|
||||
* @return mixed
|
||||
*/
|
||||
public function activity()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = BargainLogic::activity($get);
|
||||
$this->_success('获取成功', $lists);
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 新增活动 商品
|
||||
* @author 张无忌(2021/1/30 15:21)
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$check = $this->validate($post, 'app\admin\validate\Bargain.add');
|
||||
if ($check !== true) {
|
||||
$this->_error($check);
|
||||
}
|
||||
if (BargainLogic::add($post)) {
|
||||
$this->_success('新增成功');
|
||||
} else {
|
||||
$error = BargainLogic::getError() ?? '新增失败';
|
||||
$this->_error($error);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 编辑活动 商品
|
||||
* @author 张无忌(2021/1/30 15:21)
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$check = $this->validate($post, 'app\admin\validate\Bargain');
|
||||
if ($check !== true) {
|
||||
$this->_error($check);
|
||||
}
|
||||
if (BargainLogic::edit($post)) {
|
||||
$this->_success('编辑成功');
|
||||
} else {
|
||||
$error = BargainLogic::getError() ?? '编辑失败';
|
||||
$this->_error($error);
|
||||
}
|
||||
}
|
||||
|
||||
$id = $this->request->get('id');
|
||||
$detail = BargainLogic::getDetail($id);
|
||||
$this->assign('detail', $detail);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 删除
|
||||
* @author 张无忌(2021/1/12 15:52)
|
||||
* @return mixed
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$id = $this->request->post('id');
|
||||
if (BargainLogic::softDelete($id)) {
|
||||
$this->_success('删除成功');
|
||||
} else {
|
||||
$error = BargainLogic::getError() ?? '删除失败';
|
||||
$this->_error($error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 切换状态
|
||||
* @author 张无忌(2021/1/13 18:01)
|
||||
*/
|
||||
public function switchStatus()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
if (BargainLogic::switchStatus($post)) {
|
||||
$this->_success('更新成功');
|
||||
} else {
|
||||
$error = BargainLogic::getError() ?? '更新失败';
|
||||
$this->_error($error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 发起砍价列表
|
||||
* @author 张无忌(2021/1/30 16:51)
|
||||
*/
|
||||
public function launch()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = BargainLogic::getLaunch($get);
|
||||
$this->_success('Ok', $lists);
|
||||
}
|
||||
|
||||
$bargain_id = $this->request->get('bargain_id', 0);
|
||||
$this->assign('bargain_id', $bargain_id);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 砍价详细
|
||||
* @author 张无忌(2021/1/30 17:13)
|
||||
* @return mixed
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$id = $this->request->get('id');
|
||||
$detail = BargainLogic::getLaunchDetail($id);
|
||||
$this->assign('detail', $detail);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 砍价订单记录
|
||||
* @author 张无忌(2021/2/24 15:59)
|
||||
*/
|
||||
public function knifeOrderRecord() {
|
||||
$launch_id = $this->request->get('launch_id');
|
||||
$get = $this->request->get();
|
||||
$lists = BargainLogic::getKnifeOrderRecord($launch_id, $get);
|
||||
$this->_success('获取成功', $lists);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 砍价助力记录
|
||||
* @author 张无忌(2021/2/24 15:58)
|
||||
*/
|
||||
public function knifeRecord()
|
||||
{
|
||||
$launch_id = $this->request->get('launch_id');
|
||||
$get = $this->request->get();
|
||||
$lists = BargainLogic::getKnifeRecord($launch_id, $get);
|
||||
$this->_success('获取成功', $lists);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 砍价设置
|
||||
* @author 张无忌(2021/2/24 18:16)
|
||||
* @return mixed
|
||||
*/
|
||||
public function set()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$payment_limit_time = $this->request->post('payment_limit_time', 0);
|
||||
try {
|
||||
ConfigServer::set('bargain', 'payment_limit_time', $payment_limit_time);
|
||||
} catch (\Exception $e) {
|
||||
$this->_error('设置失败');
|
||||
}
|
||||
$this->_success('设置成功');
|
||||
}
|
||||
|
||||
$payment_limit_time = ConfigServer::get('bargain', 'payment_limit_time', 0);
|
||||
$this->assign('payment_limit_time', $payment_limit_time);
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,279 @@
|
||||
<?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;
|
||||
|
||||
use app\common\server\ConfigServer;
|
||||
use app\common\server\UrlServer;
|
||||
|
||||
class Basic extends AdminBase
|
||||
{
|
||||
|
||||
/**
|
||||
* 网站配置
|
||||
* @return mixed
|
||||
*/
|
||||
public function website()
|
||||
{
|
||||
$config = [
|
||||
'file_url' => UrlServer::getFileUrl('/'),
|
||||
'name' => ConfigServer::get('website', 'name'),
|
||||
'login_logo' => UrlServer::getFileUrl(ConfigServer::get('website', 'login_logo')),
|
||||
'keyword' => ConfigServer::get('website', 'keyword'),
|
||||
'slogan_status' => ConfigServer::get('website', 'slogan_status'),
|
||||
'slogan' => UrlServer::getFileUrl(ConfigServer::get('website', 'slogan')),
|
||||
'backstage_logo' => UrlServer::getFileUrl(ConfigServer::get('website', 'backstage_logo')),
|
||||
'admin_image' => UrlServer::getFileUrl(ConfigServer::get('website', 'admin_image')),
|
||||
'admin_title' => ConfigServer::get('website', 'admin_title'),
|
||||
'partner_image' => UrlServer::getFileUrl(ConfigServer::get('website', 'partner_image')),
|
||||
'partner_title' => ConfigServer::get('website', 'partner_title'),
|
||||
'shop_logo' => UrlServer::getFileUrl(ConfigServer::get('website', 'shop_logo')),
|
||||
'shop_login_logo' => UrlServer::getFileUrl(ConfigServer::get('website', 'shop_login_logo')),
|
||||
'pc_logo' => UrlServer::getFileUrl(ConfigServer::get('website', 'pc_logo')),
|
||||
'user_image' => UrlServer::getFileUrl(ConfigServer::get('website', 'user_image')),
|
||||
'goods_image' => UrlServer::getFileUrl(ConfigServer::get('website', 'goods_image')),
|
||||
'web_favicon' => UrlServer::getFileUrl(ConfigServer::get('website', 'web_favicon')),
|
||||
];
|
||||
|
||||
$this->assign('config', $config);
|
||||
|
||||
return $this->fetch('');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置网站
|
||||
* @throws \think\Exception
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
* @throws \think\exception\PDOException
|
||||
*/
|
||||
public function setWebsite()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post, 'app\admin\validate\Basic');
|
||||
if ($result === true) {
|
||||
|
||||
ConfigServer::set('website', 'name', $post['name']);
|
||||
ConfigServer::set('website', 'login_logo', UrlServer::setFileUrl($post['login_logo']));
|
||||
ConfigServer::set('website', 'web_favicon', UrlServer::setFileUrl($post['web_favicon']));
|
||||
|
||||
ConfigServer::set('website', 'backstage_logo', UrlServer::setFileUrl($post['backstage_logo']));
|
||||
ConfigServer::set('website', 'admin_image', UrlServer::setFileUrl($post['admin_image']));
|
||||
ConfigServer::set('website', 'admin_title', $post['admin_title']);
|
||||
ConfigServer::set('website', 'shop_logo', UrlServer::setFileUrl($post['shop_logo']));
|
||||
ConfigServer::set('website', 'shop_login_logo', UrlServer::setFileUrl($post['shop_login_logo']));
|
||||
ConfigServer::set('website', 'pc_logo', UrlServer::setFileUrl($post['pc_logo']));
|
||||
ConfigServer::set('website', 'user_image', UrlServer::setFileUrl($post['user_image']));
|
||||
ConfigServer::set('website', 'goods_image', UrlServer::setFileUrl($post['goods_image']));
|
||||
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 版权备案
|
||||
* @return mixed
|
||||
*/
|
||||
public function copyright()
|
||||
{
|
||||
$config = [
|
||||
'company_name' => ConfigServer::get('copyright', 'company_name'),
|
||||
'number' => ConfigServer::get('copyright', 'number'),
|
||||
'link' => ConfigServer::get('copyright', 'link'),
|
||||
'business_license' => ConfigServer::get('copyright', 'business_license'),
|
||||
'other_qualifications' => ConfigServer::get('copyright', 'other_qualifications',[]),
|
||||
];
|
||||
$config['business_license'] = $config['business_license'] ? UrlServer::getFileUrl($config['business_license']) : '';
|
||||
if (!empty($config['other_qualifications'])) {
|
||||
foreach ($config['other_qualifications'] as &$val) {
|
||||
$val = UrlServer::getFileUrl($val);
|
||||
}
|
||||
}
|
||||
|
||||
$this->assign('config', $config);
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置版权备案
|
||||
* @throws \think\Exception
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
* @throws \think\exception\PDOException
|
||||
*/
|
||||
public function setCopyright()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
|
||||
ConfigServer::set('copyright', 'company_name', $post['company_name']);
|
||||
// ConfigServer::set('copyright', 'logo',$post['logo']);
|
||||
ConfigServer::set('copyright', 'number', $post['number']);
|
||||
ConfigServer::set('copyright', 'link', $post['link']);
|
||||
ConfigServer::set('copyright', 'business_license', UrlServer::setFileUrl($post['business_license'] ?? ''));
|
||||
$other_qualifications = [];
|
||||
if (!empty($post['other_qualifications'])) {
|
||||
foreach ($post['other_qualifications'] as &$val) {
|
||||
$val = UrlServer::setFileUrl($val);
|
||||
}
|
||||
$other_qualifications = json_encode($post['other_qualifications']);
|
||||
}
|
||||
ConfigServer::set('copyright', 'other_qualifications', $other_qualifications);
|
||||
return $this->_success('修改成功');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 上传设置
|
||||
*/
|
||||
public function upload()
|
||||
{
|
||||
$config = [
|
||||
'way' => ConfigServer::get('upload', 'way'),
|
||||
'size' => ConfigServer::get('upload', 'size'),
|
||||
'type' => ConfigServer::get('upload', 'type'),
|
||||
'mime_type' => ConfigServer::get('upload', 'mime_type'),
|
||||
'status' => ConfigServer::get('watermark', 'status'),
|
||||
'mark_type' => ConfigServer::get('watermark', 'mark_type'),
|
||||
'mark' => ConfigServer::get('watermark', 'mark'),
|
||||
'location' => ConfigServer::get('watermark', 'location'),
|
||||
'transparency' => ConfigServer::get('watermark', 'transparency'),
|
||||
'slope' => ConfigServer::get('watermark', 'slope'),
|
||||
'offset_x' => ConfigServer::get('watermark', 'offset_x'),
|
||||
'offset_y' => ConfigServer::get('watermark', 'offset_y'),
|
||||
];
|
||||
|
||||
$this->assign('config', $config);
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function setUpload()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
if ($post) {
|
||||
ConfigServer::set('upload', 'way', $post['way']);
|
||||
ConfigServer::set('upload', 'size', $post['size']);
|
||||
ConfigServer::set('upload', 'type', $post['type']);
|
||||
ConfigServer::set('upload', 'mime_type', $post['mime_type']);
|
||||
|
||||
ConfigServer::set('watermark', 'status', $post['status']);
|
||||
ConfigServer::set('watermark', 'mark_type', $post['mark_type']);
|
||||
ConfigServer::set('watermark', 'mark', $post['mark']);
|
||||
ConfigServer::set('watermark', 'location', $post['location']);
|
||||
ConfigServer::set('watermark', 'transparency', $post['transparency']);
|
||||
ConfigServer::set('watermark', 'slope', $post['slope']);
|
||||
ConfigServer::set('watermark', 'offset_x', $post['offset_x']);
|
||||
ConfigServer::set('watermark', 'offset_y', $post['offset_y']);
|
||||
return $this->_success('修改成功');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* APP设置页面
|
||||
* @return mixed
|
||||
*/
|
||||
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),
|
||||
];
|
||||
$this->assign('config',$config);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 设置APP
|
||||
* @throws @\think\Exception
|
||||
* @throws @\think\db\exception\ModelNotFoundException
|
||||
* @throws @\think\exception\DbException
|
||||
* @throws @\think\exception\PDOException
|
||||
* @date 2021/9/24 14:08
|
||||
*/
|
||||
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']);
|
||||
$this->_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' => ''
|
||||
])
|
||||
];
|
||||
$this->assign('config', $config);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 设置分享
|
||||
* @throws @\think\Exception
|
||||
* @throws @\think\db\exception\DataNotFoundException
|
||||
* @throws @\think\db\exception\ModelNotFoundException
|
||||
* @throws @\think\exception\DbException
|
||||
* @throws @\think\exception\PDOException
|
||||
* @author 张无忌
|
||||
* @date 2021/9/24 14:08
|
||||
*/
|
||||
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' => $post['h5_share_image'],
|
||||
], JSON_UNESCAPED_UNICODE);
|
||||
$mnp = json_encode([
|
||||
'mnp_share_title' => $post['mnp_share_title'],
|
||||
'mnp_share_image' => $post['mnp_share_image'],
|
||||
], JSON_UNESCAPED_UNICODE);
|
||||
ConfigServer::set('share', 'h5', $h5);
|
||||
ConfigServer::set('share', 'mnp', $mnp);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* 系统缓存
|
||||
* Class Cache
|
||||
* @package app\admin\controller
|
||||
*/
|
||||
class Cache extends AdminBase
|
||||
{
|
||||
|
||||
public function cache()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
\think\facade\Cache::clear();
|
||||
$this->_success('清除成功');
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
<?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;
|
||||
|
||||
use app\admin\logic\CommentHelperLogic;
|
||||
use app\admin\logic\GoodsCategoryLogic;
|
||||
use app\admin\logic\UserLogic;
|
||||
use app\common\model\Goods;
|
||||
|
||||
/**
|
||||
* 评价助手
|
||||
* Class CommentHelper
|
||||
* @package app\admin\controller
|
||||
*/
|
||||
class CommentHelper extends AdminBase
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 商品列表
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
* @author 段誉
|
||||
* @date 2022/1/12 11:01
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$this->_success('', CommentHelperLogic::lists($get));
|
||||
}
|
||||
$this->assign('category_list', GoodsCategoryLogic::categoryTreeeTree());
|
||||
$this->assign('status_list', Goods::getStatusDesc(true));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加虚拟评论
|
||||
* @return mixed
|
||||
* @author 段誉
|
||||
* @date 2022/1/12 11:00
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$goods_id = $this->request->get('id');
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$check = $this->validate($post, 'app\admin\validate\CommentHelper');
|
||||
if ($check !== true) {
|
||||
$this->_error($check);
|
||||
}
|
||||
$result = CommentHelperLogic::addComment($post);
|
||||
if (true === $result) {
|
||||
$this->_success('操作成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->assign('user_level', UserLogic::getLevelList());
|
||||
$this->assign('goods_id', $goods_id);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?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;
|
||||
use app\admin\logic\GoodsCategoryLogic;
|
||||
use app\admin\logic\CommonLogic;
|
||||
|
||||
class Common extends AdminBase{
|
||||
public function selectGoods(){
|
||||
if ($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$goods_list = CommonLogic::getGoodsList($get,true);
|
||||
$this->_success('',$goods_list);
|
||||
}
|
||||
$category_list = GoodsCategoryLogic::categoryTreeeTree();
|
||||
$this->assign('category_list', $category_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
<?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;
|
||||
use app\admin\logic\CouponLogic;
|
||||
class Coupon extends AdminBase{
|
||||
/**
|
||||
* note 优惠券列表
|
||||
* create_time 2020/10/22 10:14
|
||||
*/
|
||||
public function lists(){
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$lists = CouponLogic::lists($get);
|
||||
$this->_success('',$lists);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* note 添加优惠券
|
||||
* create_time 2020/10/22 10:14
|
||||
*/
|
||||
public function add(){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post,'app\admin\validate\Coupon');
|
||||
if($result === true){
|
||||
$result = CouponLogic::add($post);
|
||||
if($result == true){
|
||||
$this->_success('新增成功','');
|
||||
}
|
||||
$result = '新增失败';
|
||||
}
|
||||
return $this->_error($result,'');
|
||||
|
||||
}
|
||||
return $this->fetch();
|
||||
|
||||
}
|
||||
/**
|
||||
* note 编辑优惠券
|
||||
* create_time 2020/10/22 10:15
|
||||
*/
|
||||
public function edit($id){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post,'app\admin\validate\Coupon');
|
||||
if($result === true){
|
||||
$result = CouponLogic::edit($post);
|
||||
|
||||
if($result == true){
|
||||
$this->_success('编辑成功','');
|
||||
}
|
||||
$result = '编辑失败';
|
||||
}
|
||||
return $this->_error($result,'');
|
||||
|
||||
}
|
||||
$detail = CouponLogic::getCoupon($id,true);
|
||||
$this->assign('detail',json_encode($detail,JSON_UNESCAPED_UNICODE));
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* note 删除优惠券
|
||||
* create_time 2020/10/22 10:15
|
||||
*/
|
||||
public function del($id){
|
||||
if($this->request->isAjax()){
|
||||
$result = CouponLogic::del($id);
|
||||
|
||||
if($result == true){
|
||||
$this->_success('删除成功','');
|
||||
}
|
||||
return $this->_error('删除失败','');
|
||||
}
|
||||
}
|
||||
/**
|
||||
* note 优惠券发放记录
|
||||
* create_time 2020/10/22 10:18
|
||||
*/
|
||||
public function log($id){
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$lists = CouponLogic::log($get);
|
||||
$this->_success('',$lists);
|
||||
}
|
||||
$this->assign('id',$id);
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* note 优惠券详情
|
||||
* create_time 2020/10/22 10:18
|
||||
*/
|
||||
public function detail($id){
|
||||
$detail = CouponLogic::getCoupon($id,true);
|
||||
$this->assign('detail',json_encode($detail,JSON_UNESCAPED_UNICODE));
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* note 关闭优惠券
|
||||
* create_time 2020/10/22 10:19
|
||||
*/
|
||||
public function close($id){
|
||||
if($this->request->isAjax()){
|
||||
$result = CouponLogic::close($id);
|
||||
if($result == true){
|
||||
$this->_success('优惠券关闭成功','');
|
||||
}
|
||||
return $this->_error('优惠券关闭失败,请重新关闭','');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
public function sendCouponList(){
|
||||
if($this->request->isAjax()){
|
||||
$list = CouponLogic::sendCouponList();
|
||||
$this->_success('',$list);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
public function sendCoupon(){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post,'app\admin\validate\SendCoupon');
|
||||
if($result === true){
|
||||
CouponLogic::sendCoupon($post);
|
||||
return $this->_success('发放成功',[]);
|
||||
}
|
||||
return $this->_error($result,'');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
use app\admin\logic\CrontabLogic;
|
||||
|
||||
class Crontab extends AdminBase
|
||||
{
|
||||
/**
|
||||
* 定时任务列表
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$this->_success('', CrontabLogic::lists());
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加定时任务
|
||||
* @return mixed
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['status'] = isset($post['status']) && $post['status'] == 'on' ? 1 : 2;
|
||||
$result = $this->validate($post, 'app\admin\validate\Crontab.add');
|
||||
if ($result === true) {
|
||||
CrontabLogic::add($post);
|
||||
$this->_success('添加成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑定时任务
|
||||
* @return mixed
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['status'] = isset($post['status']) && $post['status'] == 'on' ? 1 : 2;
|
||||
$result = $this->validate($post, 'app\admin\validate\Crontab');
|
||||
if ($result === true) {
|
||||
CrontabLogic::edit($post);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$id = $this->request->get('id');
|
||||
$this->assign('info',CrontabLogic::info($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$id = $this->request->post('id');
|
||||
if (CrontabLogic::del($id) !== true) {
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
}
|
||||
$this->_error('删除失败');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取接下来执行时间
|
||||
*/
|
||||
public function expression()
|
||||
{
|
||||
$get = $this->request->get();
|
||||
$this->_success('', CrontabLogic::expression($get));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?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;
|
||||
|
||||
|
||||
|
||||
|
||||
class Dispatch extends AdminBase
|
||||
{
|
||||
public function dispatch_error($msg)
|
||||
{
|
||||
return $this->_error($msg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\logic\DistributionApplyLogic;
|
||||
use think\facade\View;
|
||||
|
||||
class DistributionApply extends AdminBase
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = DistributionApplyLogic::lists($get);
|
||||
return $this->_success('获取成功', $lists);
|
||||
}
|
||||
|
||||
return view();
|
||||
}
|
||||
|
||||
public function detail()
|
||||
{
|
||||
$id = $this->request->get('id');
|
||||
View::assign('detail', DistributionApplyLogic::detail($id));
|
||||
return view();
|
||||
}
|
||||
|
||||
public function audit()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$res = DistributionApplyLogic::audit($post);
|
||||
if ($res === false) {
|
||||
return $this->_error(DistributionApplyLogic::getError());
|
||||
}
|
||||
return $this->_success('操作成功');
|
||||
}
|
||||
|
||||
return view();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\logic\DistributionCenterLogic;
|
||||
use app\common\model\Distribution;
|
||||
|
||||
class DistributionCenter extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes 数据概览
|
||||
* @return \think\response\Json
|
||||
* @author Tab
|
||||
*/
|
||||
public function center()
|
||||
{
|
||||
$data = DistributionCenterLogic::center();
|
||||
return view('', ['data' => $data]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 分销初始化数据
|
||||
* @return \think\response\Json
|
||||
* @author Tab
|
||||
*/
|
||||
public function updateTable()
|
||||
{
|
||||
try {
|
||||
$defaultLevel = \app\common\model\DistributionLevel::where('is_default', 1)->findOrEmpty()->toArray();
|
||||
if (empty($defaultLevel)) {
|
||||
// 没有默认等级,初始化
|
||||
\app\common\model\DistributionLevel::create([
|
||||
'name' => '默认等级',
|
||||
'weights' => '1',
|
||||
'is_default' => '1',
|
||||
'remark' => '默认等级',
|
||||
'update_relation' => '1'
|
||||
]);
|
||||
}
|
||||
// 默认分销会员等级
|
||||
$defaultLevelId = \app\common\model\DistributionLevel::where('is_default', 1)->value('id');
|
||||
// 生成分销基础信息表
|
||||
$users = \app\common\model\User::field('id,is_distribution')
|
||||
->where(['del' => 0])
|
||||
->select()
|
||||
->toArray();
|
||||
$distribution = Distribution::column('user_id');
|
||||
$addData = [];
|
||||
foreach($users as $item) {
|
||||
if (in_array($item['id'], $distribution)) {
|
||||
// 已有基础分销记录,跳过
|
||||
continue;
|
||||
}
|
||||
$data = [
|
||||
'user_id' => $item['id'],
|
||||
'level_id' => $defaultLevelId,
|
||||
'is_distribution' => $item['is_distribution'],
|
||||
'is_freeze' => 0,
|
||||
'remark' => '',
|
||||
];
|
||||
$addData[] = $data;
|
||||
}
|
||||
$distributionModel = new Distribution();
|
||||
$distributionModel->saveAll($addData);
|
||||
|
||||
return '初始化数据完成';
|
||||
} catch(\Exception $e) {
|
||||
return $e->getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\controller\AdminBase;
|
||||
use app\admin\logic\DistributionGoodsLogic;
|
||||
|
||||
class DistributionGoods extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes 分销商品列表页
|
||||
* @return \think\response\View
|
||||
* @author Tab
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$lists = DistributionGoodsLogic::lists($params);
|
||||
return $this->_success('', $lists);
|
||||
}
|
||||
|
||||
return view();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 设置佣金
|
||||
* @return \think\response\View
|
||||
* @author Tab
|
||||
*/
|
||||
public function set()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$result = DistributionGoodsLogic::set($params);
|
||||
if ($result) {
|
||||
return $this->_success('设置成功');
|
||||
}
|
||||
return $this->_error(DistributionGoodsLogic::getError());
|
||||
}
|
||||
$params = $this->request->get();
|
||||
$detail = DistributionGoodsLogic::detail($params);
|
||||
return view('', ['detail' => $detail]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 参与分销/取消分销
|
||||
* @return \think\response\Json
|
||||
* @author Tab
|
||||
*/
|
||||
public function isDistribution()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$result = DistributionGoodsLogic::isDistribution($params);
|
||||
if ($result) {
|
||||
return $this->_success('操作成功');
|
||||
}
|
||||
return $this->_error(DistributionGoodsLogic::getError());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\logic\DistributionLevelLogic;
|
||||
use app\admin\validate\DistributionLevelValidate;
|
||||
use think\Validate;
|
||||
|
||||
class DistributionLevel extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes 分销等级列表
|
||||
* @return \think\response\View
|
||||
* @author Tab
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$result = DistributionLevelLogic::index();
|
||||
return $this->_success('', $result);
|
||||
}
|
||||
return view();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 添加分销等级
|
||||
* @return \think\response\View
|
||||
* @author Tab
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$validate = new DistributionLevelValidate();
|
||||
if (!$validate->scene('add')->check($params)) {
|
||||
return $this->_error($validate->getError());
|
||||
}
|
||||
|
||||
$result = DistributionLevelLogic::add($params);
|
||||
if($result) {
|
||||
return $this->_success('添加成功');
|
||||
}
|
||||
return $this->_error(DistributionLevelLogic::getError());
|
||||
}
|
||||
// 显示添加页面
|
||||
return view();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 编辑分销等级
|
||||
* @return \think\response\View
|
||||
* @author Tab
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$validate = new DistributionLevelValidate();
|
||||
if (!$validate->scene('edit')->check($params)) {
|
||||
return $this->_error($validate->getError());
|
||||
}
|
||||
$result = DistributionLevelLogic::edit($params);
|
||||
if($result) {
|
||||
return $this->_success('编辑成功');
|
||||
}
|
||||
return $this->_error(DistributionLevelLogic::getError());
|
||||
}
|
||||
|
||||
$params = $this->request->get();
|
||||
$detail = DistributionLevelLogic::detail($params);
|
||||
$template = $detail['is_default'] ? 'edit_default' : 'edit';
|
||||
return view($template, ['detail' => $detail]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 删除分销等级
|
||||
* @return \think\response\Json
|
||||
* @author Tab
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$result = DistributionLevelLogic::delete($params);
|
||||
if($result) {
|
||||
return $this->_success('删除成功');
|
||||
}
|
||||
return $this->_error(DistributionLevelLogic::getError());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\logic\DistributionLevelLogic;
|
||||
use app\admin\logic\DistributionMemberLogic;
|
||||
|
||||
/**
|
||||
* 分销会员
|
||||
* Class DistributionMember
|
||||
* @package app\admin\controller\distribution
|
||||
*/
|
||||
class DistributionMember extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes 分销会员列表
|
||||
* @return \think\response\View
|
||||
* @author Tab
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$result = DistributionMemberLogic::lists($params);
|
||||
return $this->_success('', $result);
|
||||
}
|
||||
$levels = DistributionLevelLogic::getLevels();
|
||||
return view('', ['levels' => $levels]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 开通分销会员
|
||||
* @return \think\response\View
|
||||
* @author Tab
|
||||
*/
|
||||
public function open()
|
||||
{
|
||||
if($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$result = DistributionMemberLogic::open($params);
|
||||
if($result) {
|
||||
return $this->_success('开通成功');
|
||||
}
|
||||
return $this->_error(DistributionMemberLogic::getError());
|
||||
}
|
||||
$levels = DistributionLevelLogic::getLevels();
|
||||
return view('', ['levels' => $levels]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 用户列表
|
||||
* @return \think\response\Json|\think\response\View
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author Tab
|
||||
*/
|
||||
public function userLists()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$lists = DistributionMemberLogic::getUserLists($params);
|
||||
return $this->_success('', $lists);
|
||||
}
|
||||
return view();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 分销会员等级调整
|
||||
* @return \think\response\Json|\think\response\View
|
||||
* @author Tab
|
||||
*/
|
||||
public function adjust()
|
||||
{
|
||||
if($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$result = DistributionMemberLogic::adjust($params);
|
||||
if($result) {
|
||||
return $this->_success('调整成功');
|
||||
}
|
||||
return $this->_error(DistributionMemberLogic::getError());
|
||||
}
|
||||
$params = $this->request->get();
|
||||
$user = DistributionMemberLogic::getUser($params);
|
||||
$levels = DistributionLevelLogic::getLevels();
|
||||
return view('', [
|
||||
'user' => $user,
|
||||
'levels' => $levels
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 冻结资格/恢复资格
|
||||
* @return \think\response\Json
|
||||
* @author Tab
|
||||
*/
|
||||
public function isFreeze()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$result = DistributionMemberLogic::isFreeze($params);
|
||||
if($result) {
|
||||
return $this->_success('操作成功');
|
||||
}
|
||||
return $this->_error(DistributionMemberLogic::getError());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\logic\DistributionOrderGoodsLogic;
|
||||
use app\common\model\OrderGoods;
|
||||
|
||||
class DistributionOrderGoods extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes 分销订单列表
|
||||
* @return \think\response\View
|
||||
* @author Tab
|
||||
* @date 2021/9/3 14:38
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$result = DistributionOrderGoodsLogic::lists($params);
|
||||
return $this->_success('', $result);
|
||||
}
|
||||
return view();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 处理旧数据
|
||||
* @author Tab
|
||||
* @date 2021/10/16 15:03
|
||||
*/
|
||||
public function processOldData()
|
||||
{
|
||||
// 查询order_id为0的数据
|
||||
$lists = \app\common\model\DistributionOrderGoods::where('order_id', 0)->select()->toArray();
|
||||
// 默认分销等级
|
||||
$defaultId = \app\common\model\DistributionLevel::where('is_default', 1)->value('id');
|
||||
$updateData = [];
|
||||
foreach($lists as $item) {
|
||||
$temp['id'] = $item['id'];
|
||||
$temp['level_id'] = $defaultId;
|
||||
$temp['level'] = 1;
|
||||
$temp['order_id'] = OrderGoods::where('id', $item['order_goods_id'])->value('order_id');
|
||||
$updateData[] = $temp;
|
||||
}
|
||||
if (count($updateData) > 0) {
|
||||
$model = new \app\common\model\DistributionOrderGoods();
|
||||
$model->saveAll($updateData);
|
||||
|
||||
return '旧数据处理完成';
|
||||
}
|
||||
return '无旧数据需要处理';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\logic\DistributionSettingLogic;
|
||||
|
||||
class DistributionSetting extends AdminBase
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$config = DistributionSettingLogic::getConfig();
|
||||
return view('', ['config' => $config]);
|
||||
}
|
||||
|
||||
public function set()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$result = DistributionSettingLogic::set($params);
|
||||
if ($result) {
|
||||
return $this->_success('设置成功');
|
||||
}
|
||||
return $this->_error(DistributionSettingLogic::getError());
|
||||
}
|
||||
|
||||
public function settlement()
|
||||
{
|
||||
$config = DistributionSettingLogic::getConfig();
|
||||
return view('', ['config' => $config]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
<?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;
|
||||
|
||||
use app\common\server\ConfigServer;
|
||||
use app\admin\logic\ExpressLogic;
|
||||
use think\db;
|
||||
|
||||
class Express extends AdminBase
|
||||
{
|
||||
/**
|
||||
* lists
|
||||
* @return mixed
|
||||
* @throws @\think\exception\DbException
|
||||
* @throws @db\exception\DataNotFoundException
|
||||
* @throws @db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$this->_success('', ExpressLogic::lists($get));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @return mixed
|
||||
* @throws @\think\exception\DbException
|
||||
* @throws @db\exception\DataNotFoundException
|
||||
* @throws @db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\Express.add');
|
||||
if ($result === true) {
|
||||
$result = ExpressLogic::addExpress($post);
|
||||
if ($result) {
|
||||
$this->_success('添加成功');
|
||||
}
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param $id
|
||||
* @return mixed
|
||||
* @throws @\think\Exception
|
||||
* @throws @\think\exception\DbException
|
||||
* @throws @\think\exception\PDOException
|
||||
* @throws @db\exception\DataNotFoundException
|
||||
* @throws @db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\Express.edit');
|
||||
if ($result === true) {
|
||||
$result = ExpressLogic::editExpress($post);
|
||||
if ($result) {
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->assign('info', ExpressLogic::info($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param $delData
|
||||
* @throws @\think\Exception
|
||||
* @throws @\think\exception\PDOException
|
||||
*/
|
||||
public function del($delData)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$result = ExpressLogic::delExpress($delData);
|
||||
if ($result) {
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error('删除失败');
|
||||
}
|
||||
}
|
||||
|
||||
//查询配置
|
||||
public function setExpress()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
if($post){
|
||||
ConfigServer::set('express', 'way', $post['way']);
|
||||
|
||||
ConfigServer::set('kd100', 'appkey', $post['kd100_appkey']);
|
||||
ConfigServer::set('kd100', 'appsecret', $post['kd100_customer']);
|
||||
|
||||
ConfigServer::set('kdniao', 'appkey', $post['kdniao_appkey']);
|
||||
ConfigServer::set('kdniao', 'appsecret', $post['kdniao_ebussinessid']);
|
||||
ConfigServer::set('kdniao', 'type', $post['kdniao_type']);
|
||||
}
|
||||
$this->_success('操作成功');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeshop100%开源免费商用商城系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,保留版权即可
|
||||
// | 商业版本务必购买商业授权,以免引起法律纠纷
|
||||
// | 禁止对系统程序代码以任何目的,任何形式的再发布
|
||||
// | 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团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeshopTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
|
||||
use app\admin\logic\ExpressLogic;
|
||||
use app\admin\logic\FaceSheetLogic;
|
||||
use app\common\server\ConfigServer;
|
||||
|
||||
class FaceSheet extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes 面单设置
|
||||
* @return mixed
|
||||
* @throws @\think\Exception
|
||||
* @throws @\think\db\exception\DataNotFoundException
|
||||
* @throws @\think\db\exception\ModelNotFoundException
|
||||
* @throws @\think\exception\DbException
|
||||
* @throws @\think\exception\PDOException
|
||||
* @author 张无忌
|
||||
* @date 2021/9/24 17:32
|
||||
*/
|
||||
public function setting()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
ConfigServer::set('faceSheet', 'type', $post['type']);
|
||||
ConfigServer::set('kd100', 'kd100_key', $post['kd100_key']);
|
||||
ConfigServer::set('kd100', 'kd100_secret', $post['kd100_secret']);
|
||||
ConfigServer::set('kd100', 'kd100_siid', $post['kd100_siid']);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
|
||||
$faceSheet = ConfigServer::get('faceSheet');
|
||||
|
||||
$detail = [
|
||||
'kd100_key' => ConfigServer::get('kd100', 'kd100_key'),
|
||||
'kd100_secret' => ConfigServer::get('kd100', 'kd100_secret'),
|
||||
'kd100_siid' => ConfigServer::get('kd100', 'kd100_siid'),
|
||||
];
|
||||
|
||||
$this->assign('detail', $detail);
|
||||
$this->assign('faceSheet', $faceSheet);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 电子面单模板列表
|
||||
* @author 张无忌
|
||||
* @date 2021/9/24 17:35
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$list = FaceSheetLogic::lists($get);
|
||||
$this->_success('获取成功', $list);
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 新增电子面单模板
|
||||
* @author 张无忌
|
||||
* @date 2021/9/24 18:35
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = FaceSheetLogic::add($post);
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->_success('新增成功');
|
||||
}
|
||||
|
||||
$this->assign('express', ExpressLogic::all());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 编辑电子面单模板
|
||||
* @author 张无忌
|
||||
* @date 2021/9/24 18:35
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = FaceSheetLogic::edit($post);
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->_success('编辑成功');
|
||||
}
|
||||
|
||||
$id = $this->request->get('id');
|
||||
$this->assign('detail', FaceSheetLogic::detail($id));
|
||||
$this->assign('express', ExpressLogic::all());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 删除电子面单模板
|
||||
* @author 张无忌
|
||||
* @date 2021/9/28 15:45
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$id = $this->request->post('id');
|
||||
$result = FaceSheetLogic::del($id);
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeshop100%开源免费商用商城系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,保留版权即可
|
||||
// | 商业版本务必购买商业授权,以免引起法律纠纷
|
||||
// | 禁止对系统程序代码以任何目的,任何形式的再发布
|
||||
// | 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团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeshopTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
|
||||
use app\admin\logic\FaceSheetOrderLogic;
|
||||
use app\admin\logic\FaceSheetSenderLogic;
|
||||
use app\admin\logic\FaceSheetLogic;
|
||||
|
||||
class FaceSheetOrder extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes 获取待发货订单列表
|
||||
* @return mixed
|
||||
* @author 张无忌
|
||||
* @date 2021/9/27 9:39
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = FaceSheetOrderLogic::lists($get);
|
||||
$this->_success('获取成功', $lists);
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 选择打印模板
|
||||
* @return mixed
|
||||
* @author 张无忌
|
||||
* @date 2021/9/27 15:59
|
||||
*/
|
||||
public function select()
|
||||
{
|
||||
$this->assign('template', FaceSheetLogic::all());
|
||||
$this->assign('sender', FaceSheetSenderLogic::all());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 批量打印
|
||||
* @author 张无忌
|
||||
* @date 2021/9/27 14:49
|
||||
*/
|
||||
public function print()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$order_id = $this->request->post('order_id', 0, 'intval');
|
||||
$tempid = $this->request->post('tempid', 0, 'intval');
|
||||
$sender_id = $this->request->post('sender_id', 0, 'intval');
|
||||
$result = FaceSheetOrderLogic::print($order_id, $tempid, $sender_id, $this->admin_id);
|
||||
if ($result !== true) {
|
||||
return $this->_error($result);
|
||||
}
|
||||
return $this->_success('打印成功');
|
||||
}
|
||||
|
||||
return $this->_error('请求异常');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeshop100%开源免费商用商城系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,保留版权即可
|
||||
// | 商业版本务必购买商业授权,以免引起法律纠纷
|
||||
// | 禁止对系统程序代码以任何目的,任何形式的再发布
|
||||
// | 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团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeshopTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
|
||||
use app\admin\logic\FaceSheetSenderLogic;
|
||||
|
||||
class FaceSheetSender extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes 发件人列表
|
||||
* @author 张无忌
|
||||
* @date 2021/9/26 14:26
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$list = FaceSheetSenderLogic::lists($get);
|
||||
$this->_success('获取成功', $list);
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 新增发件人模板
|
||||
* @author 张无忌
|
||||
* @date 2021/9/26 14:27
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = FaceSheetSenderLogic::add($post);
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->_success('新增成功');
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 编辑发件人
|
||||
* @author 张无忌
|
||||
* @date 2021/9/26 14:27
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = FaceSheetSenderLogic::edit($post);
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->_success('编辑成功');
|
||||
}
|
||||
|
||||
$id = $this->request->get('id');
|
||||
$this->assign('detail', FaceSheetSenderLogic::detail($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 删除发件人
|
||||
* @author 张无忌
|
||||
* @date 2021/9/26 14:27
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$id = $this->request->post('id');
|
||||
$result = FaceSheetSenderLogic::del($id);
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
<?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;
|
||||
|
||||
|
||||
use app\common\logic\FileCateLogic;
|
||||
use app\common\server\FileServer;
|
||||
|
||||
|
||||
class File extends AdminBase
|
||||
{
|
||||
/**
|
||||
* 图片列表
|
||||
* @param string $type
|
||||
*/
|
||||
public function lists($type = '')
|
||||
{
|
||||
$cate_id = $this->request->get('cate', 0);
|
||||
$this->_success('', FileServer::lists($this->page_no, $this->page_size, $cate_id, $type));
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 删除图片
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
$ids = $this->request->post('ids');
|
||||
FileServer::del($ids);
|
||||
$this->_success('操作成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 上传图片
|
||||
* @author 张无忌(2021/2/19 16:39)
|
||||
* @return mixed
|
||||
*/
|
||||
public function image()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$cate_id = $this->request->post('cate',0);
|
||||
$result = FileServer::image($cate_id);
|
||||
$this->successOrError($result);
|
||||
}
|
||||
|
||||
$auth_tree = FileCateLogic::cateTree();
|
||||
$this->assign('list', json_encode($auth_tree));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 视频上传
|
||||
*/
|
||||
public function video(){
|
||||
if ($this->request->isPost()) {
|
||||
$result = FileServer::video('uploads/video');
|
||||
$this->successOrError($result);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 其他文件上传
|
||||
*/
|
||||
public function other()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$local = $this->request->get('local',0);
|
||||
$sub_dir = $this->request->get('sub_dir','');
|
||||
$local = $local == 0 ? false : true;
|
||||
$save_path = 'uploads/other';
|
||||
|
||||
if ($local && $local !== '') {
|
||||
$save_path = 'uploads/other/'.$sub_dir;
|
||||
}
|
||||
|
||||
$result = FileServer::other($save_path, $local);
|
||||
$this->successOrError($result);
|
||||
}
|
||||
$this->_success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
<?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;
|
||||
|
||||
use app\common\logic\FileCateLogic;
|
||||
|
||||
/**
|
||||
* 图片分类
|
||||
* Class FileCate
|
||||
* @package app\admin\controller
|
||||
*/
|
||||
class FileCate extends AdminBase
|
||||
{
|
||||
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post, 'app\admin\validate\FileCate.add');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
$result = FileCateLogic::add($post);
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->_success('添加成功');
|
||||
}
|
||||
$tree = FileCateLogic::categoryToSelect();
|
||||
$this->assign('cate_tree', $tree);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
public function edit($id = '')
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post, 'app\admin\validate\FileCate.edit');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
$result = FileCateLogic::edit($post);
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->_success('编辑成功');
|
||||
}
|
||||
$tree = FileCateLogic::categoryToSelect();
|
||||
$this->assign('cate_tree', $tree);
|
||||
$this->assign('detail', FileCateLogic::info($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post, 'app\admin\validate\FileCate.del');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
FileCateLogic::del($post['id']);
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
<?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;
|
||||
|
||||
use app\admin\controller\AdminBase;
|
||||
use app\admin\logic\FileNewLogic;
|
||||
use app\common\model\FileCate;
|
||||
use app\admin\validate\FileCateNew as FileCateNewValidate;
|
||||
use app\common\server\FileServer;
|
||||
|
||||
class FileNew extends AdminBase
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
$get = $this->request->get();
|
||||
$get['type'] = $get['type'] ?? 'image';
|
||||
$get['partner_id'] = $get['partner_id'] ?? 0;
|
||||
$get['page_no'] = $get['page_no'] ?? 1;
|
||||
$get['page_size'] = $get['page_size'] ?? 20;
|
||||
$get['cate_id'] = $get['cate_id'] ?? 0;
|
||||
switch($get['type']) {
|
||||
case 'video':
|
||||
$title = '上传视频';
|
||||
break;
|
||||
case 'image':
|
||||
$title = '上传图片';
|
||||
break;
|
||||
case 'other':
|
||||
$title = '上传';
|
||||
break;
|
||||
}
|
||||
$menu = FileCate::getTreeMenu($get);
|
||||
$data = FileNewLogic::lists($get);
|
||||
$this->assign('type', $get['type']);
|
||||
$this->assign('title', $title);
|
||||
$this->assign('menu', json_encode($menu));
|
||||
$this->assign('data', $data);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function pagelists()
|
||||
{
|
||||
$get = $this->request->get();
|
||||
$get['type'] = $get['type'] ?? 'image';
|
||||
$get['partner_id'] = $get['partner_id'] ?? 0;
|
||||
$get['page_no'] = $get['page_no'] ?? 1;
|
||||
$get['page_size'] = $get['page_size'] ?? 20;
|
||||
$get['cate_id'] = $get['cate_id'] ?? 0;
|
||||
$data = FileNewLogic::pagelists($get);
|
||||
return $this->_success('', $data);
|
||||
}
|
||||
|
||||
public function addCate()
|
||||
{
|
||||
if($this->request->isPost()) {
|
||||
$post = $this->request->post();
|
||||
$validate = new FileCateNewValidate;
|
||||
if(!$validate->check($post)) {
|
||||
return $this->_error($validate->getError());
|
||||
}
|
||||
$result = FileNewLogic::addCate($post);
|
||||
if($result['flag']) {
|
||||
return $this->_success($result['msg']);
|
||||
}
|
||||
return $this->_error($result['msg']);
|
||||
}
|
||||
$get = $this->request->get();
|
||||
$get['type'] = $get['type'] ?? 'image';
|
||||
$get['partner_id'] = $get['partner_id'] ?? 0;
|
||||
$menu = FileCate::getMenu($get);
|
||||
$this->assign('menu', $menu);
|
||||
$this->assign('type', $get['type']);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function editCate()
|
||||
{
|
||||
if($this->request->isPost()) {
|
||||
$post = $this->request->post();
|
||||
$validate = new FileCateNewValidate;
|
||||
if(!$validate->check($post)) {
|
||||
return $this->_error($validate->getError());
|
||||
}
|
||||
$result = FileNewLogic::editCate($post);
|
||||
if($result['flag']) {
|
||||
return $this->_success($result['msg']);
|
||||
}
|
||||
return $this->_error($result['msg']);
|
||||
}
|
||||
|
||||
$get = $this->request->get();
|
||||
$get['type'] = $get['type'] ?? 'image';
|
||||
$get['partner_id'] = $get['partner_id'] ?? 0;
|
||||
$cate = FileCate::getCateById($get['id']);
|
||||
$menu = FileCate::getMenu($get);
|
||||
$this->assign('menu', $menu);
|
||||
$this->assign('type', $get['type']);
|
||||
$this->assign('cate', $cate);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function delCate()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
$result = FileNewLogic::delCate($post);
|
||||
if($result['flag']) {
|
||||
return $this->_success($result['msg']);
|
||||
}
|
||||
return $this->_error($result['msg']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新视频上传
|
||||
*/
|
||||
public function videoNew(){
|
||||
if ($this->request->isPost()) {
|
||||
$post = $this->request->post();
|
||||
$result = FileServer::videoNew($post['cate_id']);
|
||||
$this->successOrError($result);
|
||||
}
|
||||
}
|
||||
|
||||
public function showVideo()
|
||||
{
|
||||
$uri = $this->request->get('uri');
|
||||
$this->assign('uri', $uri);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function delFile()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
$result = FileNewLogic::delFile($post);
|
||||
if($result) {
|
||||
return $this->_success('删除成功');
|
||||
}
|
||||
return $this->_error('删除失败');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\logic\FinanceLogic;
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | 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
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
class Finance extends AdminBase
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
$data = FinanceLogic::lists();
|
||||
$this->assign('data', $data);
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
<?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;
|
||||
|
||||
use app\admin\logic\FootprintLogic;
|
||||
use app\common\server\ConfigServer;
|
||||
|
||||
/**
|
||||
* 访问足迹(气泡足迹)
|
||||
* Class Footprint
|
||||
* @package app\admin\controller
|
||||
*/
|
||||
class Footprint extends AdminBase
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$set['footprint_duration'] = ConfigServer::get('footprint','footprint_duration',60);
|
||||
$set['footprint_status'] = ConfigServer::get('footprint','footprint_status',0);
|
||||
$this->assign('set', $set);
|
||||
$this->assign('footprint', FootprintLogic::lists());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function edit()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = FootprintLogic::edit($post);
|
||||
if ($result) {
|
||||
$this->_success('编辑成功');
|
||||
}
|
||||
$this->_error('编辑失败');
|
||||
}
|
||||
|
||||
$id = $this->request->get('id', 0, 'intval');
|
||||
$this->assign('info', FootprintLogic::info($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function set()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = FootprintLogic::set($post);
|
||||
if ($result) {
|
||||
$this->_success('更新成功');
|
||||
}
|
||||
$this->_error('更新失败');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
<?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;
|
||||
|
||||
use app\admin\logic\ExpressLogic;
|
||||
use app\common\server\ConfigServer;
|
||||
use app\admin\logic\FreightLogic;
|
||||
use app\admin\model\Freight as FreightModel;
|
||||
|
||||
class Freight extends AdminBase
|
||||
{
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 设置快递方式
|
||||
*/
|
||||
public function set()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['is_express'] = isset($post['is_express']) && $post['is_express'] == 'on' ? 1 : 0;
|
||||
$post['is_selffetch'] = isset($post['is_selffetch']) && $post['is_selffetch'] == 'on' ? 1 : 0;
|
||||
if ($post['is_express'] === 0 && $post['is_selffetch'] === 0) {
|
||||
$this->_error('至少保留一种配送方式');
|
||||
}
|
||||
ConfigServer::set('delivery_type', 'is_express', $post['is_express']);
|
||||
ConfigServer::set('delivery_type', 'is_selffetch', $post['is_selffetch']);
|
||||
$this->_success('操作成功');
|
||||
}
|
||||
$is_express = ConfigServer::get('delivery_type', 'is_express', 1);
|
||||
$is_selffetch = ConfigServer::get('delivery_type', 'is_selffetch', 0);
|
||||
$this->assign('is_express', $is_express);
|
||||
$this->assign('is_selffetch', $is_selffetch);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 运费模板列表
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$this->_success('获取成功', FreightLogic::lists($get));//运费模板页
|
||||
}
|
||||
$this->assign('charge_way_lists', FreightModel::getChargeWay(true));
|
||||
$this->assign('config', ExpressLogic::getExpress());
|
||||
return $this->fetch('index');
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 添加运费模板
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post, 'app\admin\validate\Freight.add');
|
||||
if ($result === true) {
|
||||
FreightLogic::add($post);
|
||||
$this->_success('添加成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 删除运费模板
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post, 'app\admin\validate\Freight.del');
|
||||
if ($result === true) {
|
||||
FreightLogic::del($post);
|
||||
$this->_success('删除成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 运费模板详情
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$id = $this->request->get('id');
|
||||
$detail = FreightLogic::detail($id);
|
||||
$this->assign('detail', $detail);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 运费模板编辑
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post, 'app\admin\validate\Freight.edit');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
FreightLogic::edit($post);
|
||||
$this->_success('编辑成功!');
|
||||
}
|
||||
$id = $this->request->get('id');
|
||||
$detail = FreightLogic::detail($id);
|
||||
$this->assign('detail', $detail);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function area()
|
||||
{
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//编辑页的地区选择
|
||||
public function areaEdit()
|
||||
{
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,329 @@
|
||||
<?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;
|
||||
use app\common\model\Order as CommonOrder;
|
||||
use app\admin\logic\{GoodsBrandLogic, GoodsCategoryLogic, GoodsLogic, SupplierLogic,FreightLogic,CommonLogic};
|
||||
use think\Db;
|
||||
use think\facade\Hook;
|
||||
|
||||
class Goods extends AdminBase
|
||||
{
|
||||
// TODO 商品发布
|
||||
// TODO 编辑
|
||||
// TODO 复制
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$this->_success('', GoodsLogic::lists($get));
|
||||
}
|
||||
$this->assign('statistics',GoodsLogic::statistics());
|
||||
$this->assign('category_list', GoodsCategoryLogic::categoryTreeeTree());
|
||||
$this->assign('supplier_list',SupplierLogic::getSupplierList());
|
||||
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表导出
|
||||
*/
|
||||
public function exportFile()
|
||||
{
|
||||
$get = $this->request->get();
|
||||
$this->_success('', GoodsLogic::exportFile($get));
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 获取Tab统计数据
|
||||
* @author 张无忌(2021/1/19 18:49)
|
||||
*/
|
||||
public function totalCount()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$this->_success('获取成功', GoodsLogic::statistics());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax() && $this->request->isPost()) {
|
||||
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
|
||||
//主表验证
|
||||
$result = $this->validate($post, 'app\admin\validate\Goods.add');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
//单规格验证
|
||||
if ($post['spec_type'] == 1) {
|
||||
$result = $this->validate($post, 'app\admin\validate\GoodsOneSpec');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
|
||||
//多规格验证
|
||||
$spec_lists = [];
|
||||
if ($post['spec_type'] == 2) {
|
||||
$spec_lists = $post;
|
||||
|
||||
// 规格值验证长度验证
|
||||
foreach($spec_lists['spec_value_str'] as $key => $item) {
|
||||
$itemArr = explode(',', $item);
|
||||
foreach($itemArr as $subItem) {
|
||||
if(mb_strlen($subItem) > 64) {
|
||||
return $this->_error('第'. ($key+1) .'个SKU规格值超过了64个字符');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unset($spec_lists['goods_image']);
|
||||
unset($spec_lists['spec_name']);
|
||||
unset($spec_lists['spec_values']);
|
||||
unset($spec_lists['spec_id']);
|
||||
unset($spec_lists['spec_value_ids']);
|
||||
$spec_lists = form_to_linear($spec_lists);
|
||||
|
||||
//规格验证
|
||||
if (empty($spec_lists)) {
|
||||
$this->_error('至少添加一个规格');
|
||||
}
|
||||
$result = $this->validate($post, 'app\admin\validate\GoodsMoreSpec');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
//规格商品列表验证
|
||||
foreach ($spec_lists as $v) {
|
||||
$result = $this->validate($v, 'app\admin\validate\GoodsMoreSpecLists');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
// 校验规格
|
||||
$total_stock = array_sum(array_column($spec_lists, 'stock'));
|
||||
if ($total_stock <= 0) {
|
||||
$this->_error('至少有一个规格的库存大于0');
|
||||
}
|
||||
}
|
||||
|
||||
//添加商品
|
||||
$result = GoodsLogic::add($post, $spec_lists);
|
||||
|
||||
if ($result !== true) {
|
||||
$this->_error('添加失败:' . $result);
|
||||
}
|
||||
$this->_success('添加成功');
|
||||
}
|
||||
$this->assign('category_lists', json_encode(GoodsCategoryLogic::getAllTree(), JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('brand_lists',json_encode(GoodsBrandLogic::getGoodsBrandList(),JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('supplier_lists',json_encode(SupplierLogic::getSupplierList(),JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('freight_lists',json_encode(FreightLogic::getFreightList(),JSON_UNESCAPED_UNICODE));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:编辑商品
|
||||
* @param $goods_id int 商品id
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function edit($goods_id)
|
||||
{
|
||||
if ($this->request->isAjax() && $this->request->isPost()) {
|
||||
|
||||
$post = $this->request->post();
|
||||
|
||||
$post['del'] = 0;
|
||||
$post['id'] = $post['goods_id'];
|
||||
|
||||
|
||||
//主表验证
|
||||
$result = $this->validate($post, 'app\admin\validate\Goods');
|
||||
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
//单规格验证
|
||||
if ($post['spec_type'] == 1) {
|
||||
$result = $this->validate($post, 'app\admin\validate\GoodsOneSpec');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
|
||||
//多规格验证
|
||||
$spec_lists = [];
|
||||
if ($post['spec_type'] == 2) {
|
||||
$spec_lists = $post;
|
||||
unset($spec_lists['goods_image']);
|
||||
unset($spec_lists['spec_name']);
|
||||
unset($spec_lists['spec_values']);
|
||||
unset($spec_lists['spec_id']);
|
||||
unset($spec_lists['spec_value_ids']);
|
||||
$spec_lists = form_to_linear($spec_lists);
|
||||
|
||||
//规格验证
|
||||
if (empty($spec_lists)) {
|
||||
$this->_error('至少添加一个规格');
|
||||
}
|
||||
$result = $this->validate($post, 'app\admin\validate\GoodsMoreSpec');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
//规格商品列表验证
|
||||
foreach ($spec_lists as $v) {
|
||||
$result = $this->validate($v, 'app\admin\validate\GoodsMoreSpecLists');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
// 校验规格
|
||||
$total_stock = array_sum(array_column($spec_lists, 'stock'));
|
||||
if ($total_stock <= 0) {
|
||||
$this->_error('至少有一个规格的库存大于0');
|
||||
}
|
||||
}
|
||||
|
||||
if ($post['status'] == 0) {
|
||||
$status = Db::name('goods')
|
||||
->where(['id' => $post['goods_id']])
|
||||
->value('status');
|
||||
if ($status == 1) {
|
||||
$res = Db::name('team_activity')
|
||||
->where(['status' => 1, 'goods_id'=> $post['goods_id']])
|
||||
->find();
|
||||
if ($res) {
|
||||
$this->_error('该商品正在参与拼团,请先关闭后才允许下架');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//添加商品
|
||||
$result = GoodsLogic::edit($post, $spec_lists);
|
||||
if ($result !== true) {
|
||||
$this->_error('添加失败:' . $result);
|
||||
}
|
||||
$this->_success(GoodsLogic::$error ? : '修改成功');
|
||||
}
|
||||
|
||||
$this->assign('category_lists', json_encode(GoodsCategoryLogic::getAllTree(), JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('info', json_encode(GoodsLogic::info($goods_id),JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('brand_lists',json_encode(GoodsBrandLogic::getGoodsBrandList(),JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('supplier_lists',json_encode(SupplierLogic::getSupplierList(),JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('freight_lists',json_encode(FreightLogic::getFreightList(),JSON_UNESCAPED_UNICODE));
|
||||
return $this->fetch('goods/add');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:删除商品
|
||||
* @param $id int 商品id
|
||||
*/
|
||||
public function del($id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
//todo 商品删除验证
|
||||
$result = GoodsLogic::del($id); //逻辑层处理删除信息
|
||||
if ($result) {
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error('删除失败');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:修改商品字段(上下架、新品推荐、好物优选、猜你喜欢)
|
||||
* @throws \think\Exception
|
||||
* @throws \think\exception\PDOException
|
||||
*/
|
||||
public function changeFields(){
|
||||
$table = $this->request->controller();
|
||||
|
||||
$pk_name = 'id';
|
||||
$pk_value = $this->request->post('id');
|
||||
|
||||
$field = $this->request->post('field');
|
||||
$field_value = $this->request->post('value');
|
||||
$result = CommonLogic::changeTableValue($table,$pk_name,$pk_value,$field,$field_value);
|
||||
if($result === true){
|
||||
// 下架或删除商品,更新商品收藏
|
||||
Hook::listen('update_collect', ['goods_id' => $pk_value]);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 下架商品
|
||||
* @author 张无忌(2021/1/11 14:33)
|
||||
*/
|
||||
public function lowerStatus()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$ids = $this->request->post('ids', []);
|
||||
$result = GoodsLogic::upperOrLower($ids, 0);
|
||||
if ($result === true) {
|
||||
$this->_success('下架成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 上架商品
|
||||
* @author 张无忌(2021/1/11 14:33)
|
||||
*/
|
||||
public function upperStatus()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$ids = $this->request->post('ids', []);
|
||||
$result = GoodsLogic::upperOrLower($ids, 1);
|
||||
if ($result === true) {
|
||||
$this->_success('上架成功');
|
||||
}
|
||||
$this->_error('上架失败');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?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;
|
||||
use app\admin\logic\GoodsBrandLogic;
|
||||
use app\common\model\Capital_;
|
||||
|
||||
class GoodsBrand extends AdminBase {
|
||||
|
||||
/**
|
||||
* note 品牌列表
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax())
|
||||
{
|
||||
$get = $this->request->get();
|
||||
$list = GoodsBrandLogic::lists($get);
|
||||
$this->_success('',$list);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 添加品牌
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post,'app\admin\validate\GoodsBrand.add');
|
||||
if ($result === true){
|
||||
GoodsBrandLogic::add($post);
|
||||
$this->_success('添加成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
|
||||
}
|
||||
|
||||
$capital = Capital_::getData();
|
||||
$this->assign('capital',$capital);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 编辑品牌
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
if ($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post,'app\admin\validate\GoodsBrand.edit');
|
||||
if ($result === true){
|
||||
GoodsBrandLogic::edit($post,$id);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
$info = GoodsBrandLogic::getGoodsBrand($id);
|
||||
$capital = Capital_::getData();
|
||||
$this->assign('info',$info);
|
||||
$this->assign('capital',$capital);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 删除品牌
|
||||
*/
|
||||
public function del($delData)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$result = GoodsBrandLogic::del($delData);
|
||||
if ($result) {
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error('删除失败');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* note 修改品牌的显示状态
|
||||
*/
|
||||
public function switchStatus(){
|
||||
$post = $this->request->post();
|
||||
$result =GoodsBrandLogic::switchStatus($post);
|
||||
if ($result) {
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_success('修改失败');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
<?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;
|
||||
use app\admin\logic\{
|
||||
GoodsCategoryLogic
|
||||
};
|
||||
use app\common\logic\CommonLogic;
|
||||
|
||||
class GoodsCategory extends AdminBase
|
||||
{
|
||||
/**
|
||||
* 商品分类列表
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function lists(){
|
||||
$category_tree = GoodsCategoryLogic::categoryThirdTree();
|
||||
$this->assign('category_tree', json_encode($category_tree));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品分类
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function add(){
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\GoodsCategory.add');
|
||||
if ($result === true) {
|
||||
GoodsCategoryLogic::add($post);
|
||||
$this->_success('添加成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$category_list = GoodsCategoryLogic::categoryTwoTree();
|
||||
$this->assign('category_list', $category_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑商品分类
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function edit($id){
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\GoodsCategory.edit');
|
||||
if ($result === true) {
|
||||
GoodsCategoryLogic::edit($post);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$category_info = GoodsCategoryLogic::getCategory($id);
|
||||
$category_list = GoodsCategoryLogic::categoryTwoTree();
|
||||
|
||||
$this->assign('info',$category_info);
|
||||
$this->assign('category_list', $category_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* 删除商品分类
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function del(){
|
||||
$id = $this->request->post('ids');
|
||||
$result = $this->validate(['id'=>[$id]], 'app\admin\validate\GoodsCategory.del');
|
||||
if ($result === true) {
|
||||
GoodsCategoryLogic::del($id);
|
||||
$this->_success('删除成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
/**
|
||||
* note 修改品牌的显示状态
|
||||
*/
|
||||
public function switchStatus(){
|
||||
$post = $this->request->post();
|
||||
$result =GoodsCategoryLogic::switchStatus($post);
|
||||
if ($result) {
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_success('修改失败');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
<?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;
|
||||
use app\admin\logic\GoodsCommentLogic;
|
||||
|
||||
class GoodsComment extends AdminBase{
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
public function lists(){
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$this->_success('', GoodsCommentLogic::lists($get));
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del($delData)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$result = GoodsCommentLogic::del($delData); //逻辑层处理删除信息
|
||||
if ($result) {
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error('删除失败');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
*/
|
||||
public function switchStatus(){
|
||||
$get = $this->request->get();
|
||||
GoodsCommentLogic::switchStatus($get);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
|
||||
//回复
|
||||
public function reply($id){
|
||||
if ($this->request->isAjax()) {
|
||||
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post, 'app\admin\validate\GoodsComment');
|
||||
if($result === true){
|
||||
GoodsCommentLogic::reply($post);
|
||||
$this->_success('回复成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
|
||||
}
|
||||
$this->assign('res',GoodsCommentLogic::info($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
<?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;
|
||||
|
||||
use app\admin\logic\{
|
||||
HelpLogic,
|
||||
HelpCategoryLogic
|
||||
};
|
||||
|
||||
class Help extends AdminBase
|
||||
{
|
||||
/**
|
||||
* 帮助列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
$category = HelpCategoryLogic::getHelpCategory();
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$this->_success('', HelpLogic::lists($get, $category));
|
||||
}
|
||||
$this->assign('category_list', $category);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加帮助
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post, 'app\admin\validate\Help.add');
|
||||
if ($result === true) {
|
||||
HelpLogic::addHelp($post);
|
||||
$this->_success('添加成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$acticle_category = HelpCategoryLogic::getHelpCategory();
|
||||
$this->assign('category_list', $acticle_category);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑帮助
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post, 'app\admin\validate\Help.edit');
|
||||
if ($result === true) {
|
||||
HelpLogic::editHelp($post);
|
||||
$this->_success('编辑成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$help = HelpLogic::getHelp($id);
|
||||
$category_list = HelpCategoryLogic::getHelpCategory();
|
||||
$this->assign('help', $help);
|
||||
$this->assign('category_list', $category_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除帮助
|
||||
*/
|
||||
public function del($id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$result = $this->validate(['id' => $id], 'app\admin\validate\Help.del');
|
||||
if ($result === true) {
|
||||
HelpLogic::delHelp($id);
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
*/
|
||||
public function switchStatus()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
HelpLogic::switchStatus($post);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
use app\admin\logic\{HelpCategoryLogic};
|
||||
|
||||
class HelpCategory extends AdminBase
|
||||
{
|
||||
/**
|
||||
* 帮助分类列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$this->_success('', HelpCategoryLogic::lists($get));
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加帮助分类
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\HelpCategory');
|
||||
if ($result === true) {
|
||||
HelpCategoryLogic::addHelpCategory($post);
|
||||
$this->_success('添加成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑帮助分类
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\HelpCategory.edit');
|
||||
if ($result === true) {
|
||||
HelpCategoryLogic::editHelpCategory($post);
|
||||
$this->_success('编辑成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
$category = HelpCategoryLogic::getHelpCategory($id);
|
||||
$this->assign('category', array_values($category)[0]);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除帮助分类
|
||||
*/
|
||||
public function del($id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$result = $this->validate(['id' => $id], 'app\admin\validate\HelpCategory.del');
|
||||
if ($result === true) {
|
||||
HelpCategoryLogic::delHelpCategory($id);
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
*/
|
||||
public function switchStatus()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
HelpCategoryLogic::switchStatus($post);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* H5商城控制器
|
||||
* Class Hfive
|
||||
* @package app\admin\controller
|
||||
*/
|
||||
class Hfive extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes H5商城设置
|
||||
* @return \think\response\View|void
|
||||
* @author Tab
|
||||
* @date 2021/8/14 14:55
|
||||
*/
|
||||
public function set()
|
||||
{
|
||||
if($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
\app\admin\logic\Hfive::set($params);
|
||||
return $this->_success('设置成功');
|
||||
}
|
||||
$config = \app\admin\logic\Hfive::getConfig();
|
||||
$this->assign('config', $config);
|
||||
return view();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?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;
|
||||
|
||||
|
||||
use app\admin\logic\HotSearchLogic;
|
||||
use app\common\server\ConfigServer;
|
||||
|
||||
class HotSearch extends AdminBase
|
||||
{
|
||||
|
||||
public function index() {
|
||||
|
||||
$info = HotSearchLogic::info();
|
||||
$this->assign('info',$info);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function set(){
|
||||
$post = $this->request->post();
|
||||
|
||||
$result = HotSearchLogic::set($post);
|
||||
if($result == true){
|
||||
$this->_success('操作成功');
|
||||
}
|
||||
$this->_error('操作失败');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
<?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;
|
||||
|
||||
|
||||
use app\admin\cache\RoleMenuCache;
|
||||
use app\admin\logic\StatLogic;
|
||||
use app\admin\server\MenuServer;
|
||||
use app\common\server\ConfigServer;
|
||||
use think\Db;
|
||||
use think\facade\Config;
|
||||
|
||||
class Index extends AdminBase
|
||||
{
|
||||
/**
|
||||
* 后台前端全局界面
|
||||
* @return mixed
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
// 菜单渲染
|
||||
$menu = MenuServer::getMenuTree($this->admin_info['role_id']);
|
||||
$this->assign('menu', $menu);
|
||||
|
||||
//开启右上角前端示例
|
||||
$app_trace = Config::get('app.app_trace');
|
||||
$this->assign('view_app_trace', $app_trace);
|
||||
|
||||
//管理员名称
|
||||
$this->assign('admin_name', $this->admin_info['name']);
|
||||
|
||||
//角色名称
|
||||
$role_name = Db::name('role')
|
||||
->where(['id' => $this->admin_info['role_id']])
|
||||
->value('name');
|
||||
$role_name = empty($role_name) ? '系统管理员' : $role_name;
|
||||
$this->assign('role_name', $role_name);
|
||||
|
||||
// 网站配置
|
||||
$config = [
|
||||
'name' => ConfigServer::get('website', 'name'),
|
||||
'backstage_logo' => ConfigServer::get('website', 'backstage_logo'),
|
||||
'web_favicon' => ConfigServer::get('website', 'web_favicon'),
|
||||
];
|
||||
$this->assign('config', $config);
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 工作台
|
||||
* @return mixed
|
||||
*/
|
||||
public function stat()
|
||||
{
|
||||
if($this->request->isAjax()){
|
||||
$this->_success('', StatLogic::graphData());
|
||||
}
|
||||
$this->assign('res', StatLogic::stat());
|
||||
$this->assign('company_name',ConfigServer::get('copyright', 'company_name'));
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeshop100%开源免费商用商城系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,保留版权即可
|
||||
// | 商业版本务必购买商业授权,以免引起法律纠纷
|
||||
// | 禁止对系统程序代码以任何目的,任何形式的再发布
|
||||
// | 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团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeshopTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
|
||||
use app\admin\logic\LiveGoodsLogic;
|
||||
|
||||
/**
|
||||
* 直播商品控制器
|
||||
* Class LiveGoods
|
||||
* @package app\admin\controller
|
||||
*/
|
||||
class LiveGoods extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes 获取直播商品列表
|
||||
* @return mixed|void
|
||||
* @throws @\EasyWeChat\Kernel\Exceptions\HttpException
|
||||
* @throws @\EasyWeChat\Kernel\Exceptions\InvalidArgumentException
|
||||
* @throws @\EasyWeChat\Kernel\Exceptions\InvalidConfigException
|
||||
* @throws @\EasyWeChat\Kernel\Exceptions\RuntimeException
|
||||
* @throws @\Psr\SimpleCache\InvalidArgumentException
|
||||
* @author heshihu
|
||||
* @date 2021/9/17 11:42
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = LiveGoodsLogic::lists($get);
|
||||
if (is_string($lists)) {
|
||||
return $this->_error($lists);
|
||||
}
|
||||
$this->_success('获取成功', $lists);
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加直播商品
|
||||
* @return mixed|void
|
||||
* @throws @\EasyWeChat\Kernel\Exceptions\HttpException
|
||||
* @throws @\EasyWeChat\Kernel\Exceptions\InvalidArgumentException
|
||||
* @throws @\EasyWeChat\Kernel\Exceptions\InvalidConfigException
|
||||
* @throws @\EasyWeChat\Kernel\Exceptions\RuntimeException
|
||||
* @throws @\Psr\SimpleCache\InvalidArgumentException
|
||||
* @author heshihu
|
||||
* @date 2021/9/17 15:26
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post, 'app\admin\validate\LiveGoods');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
$result = LiveGoodsLogic::add($post);
|
||||
if ($result !== true) {
|
||||
return $this->_error($result);
|
||||
}
|
||||
$this->_success('添加成功');
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function addUploadImage()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$goods_image = $this->request->post('goods_image');
|
||||
$result = LiveGoodsLogic::addUploadImage($goods_image);
|
||||
if (is_string($result)) {
|
||||
return $this->_error($result);
|
||||
}
|
||||
return $this->_success('上传成功', $result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除商品
|
||||
* @return false|void
|
||||
* @throws @\EasyWeChat\Kernel\Exceptions\HttpException
|
||||
* @throws @\EasyWeChat\Kernel\Exceptions\InvalidArgumentException
|
||||
* @throws @\EasyWeChat\Kernel\Exceptions\InvalidConfigException
|
||||
* @throws @\EasyWeChat\Kernel\Exceptions\RuntimeException
|
||||
* @throws @\Psr\SimpleCache\InvalidArgumentException
|
||||
* @author heshihu
|
||||
* @date 2021/9/17 18:38
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$id = $this->request->post('id');
|
||||
$result = LiveGoodsLogic::del($id);
|
||||
if ($result !== true) {
|
||||
return $this->_error($result);
|
||||
}
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeshop100%开源免费商用商城系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,保留版权即可
|
||||
// | 商业版本务必购买商业授权,以免引起法律纠纷
|
||||
// | 禁止对系统程序代码以任何目的,任何形式的再发布
|
||||
// | 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团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeshopTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
|
||||
use app\admin\logic\LiveRoomLogic;
|
||||
|
||||
class LiveRoom extends AdminBase
|
||||
{
|
||||
public $like_not_need_login = ['upload'];
|
||||
|
||||
/**
|
||||
* @notes 获取直播间列表
|
||||
* @return mixed|void
|
||||
* @author 张无忌
|
||||
* @date 2021/9/13 15:57
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = LiveRoomLogic::lists($get);
|
||||
if (is_string($lists)) {
|
||||
return $this->_error($lists);
|
||||
}
|
||||
$this->_success('获取成功', $lists);
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 创建直播间
|
||||
* @return mixed
|
||||
* @author 张无忌
|
||||
* @date 2021/9/13 15:57
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = LiveRoomLogic::add($post);
|
||||
if ($result !== true) {
|
||||
return $this->_error($result);
|
||||
}
|
||||
$this->_success('创建成功');
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 删除直播间
|
||||
* @return bool|void
|
||||
* @author 张无忌
|
||||
* @date 2021/9/14 18:50
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$id = $this->request->post('id');
|
||||
$result = LiveRoomLogic::del($id);
|
||||
if ($result !== true) {
|
||||
return $this->_error($result);
|
||||
}
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 上传临时图片
|
||||
* @return mixed|void
|
||||
* @author 张无忌
|
||||
* @date 2021/9/14 14:51
|
||||
*/
|
||||
public function uploadImage()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$file = request()->file('file');
|
||||
$info = $file->move( './uploads/temp');
|
||||
$result = LiveRoomLogic::upload($info->getSaveName());
|
||||
if (is_string($result)) {
|
||||
return $this->_error($result);
|
||||
}
|
||||
return $this->_success('上传成功', $result);
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
<?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;
|
||||
|
||||
use app\admin\logic\LogLogic;
|
||||
use think\helper\Time;
|
||||
|
||||
class Log extends AdminBase
|
||||
{
|
||||
|
||||
/**
|
||||
* 系统日志
|
||||
* @return mixed
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
|
||||
|
||||
if ($this->request->isAjax()) {
|
||||
$limit = $this->request->get('limit', 20);
|
||||
$page_no = $this->request->get('page', 1);
|
||||
$get = $this->request->get();
|
||||
$this->_success('', LogLogic::lists($page_no, $limit, $get));
|
||||
}
|
||||
|
||||
|
||||
$today = array_map(function ($time) {
|
||||
return date('Y-m-d H:i:s', $time);
|
||||
}, Time::today());
|
||||
$this->assign('today', $today);
|
||||
|
||||
$yesterday = array_map(function ($time) {
|
||||
return date('Y-m-d H:i:s', $time);
|
||||
}, Time::yesterday());
|
||||
$this->assign('yesterday', $yesterday);
|
||||
|
||||
|
||||
$days_ago7 = array_map(function ($time) {
|
||||
return date('Y-m-d H:i:s', $time);
|
||||
}, Time::dayToNow(7));
|
||||
$this->assign('days_ago7', $days_ago7);
|
||||
|
||||
$days_ago30 = array_map(function ($time) {
|
||||
return date('Y-m-d H:i:s', $time);
|
||||
}, Time::dayToNow(30, true));
|
||||
$this->assign('days_ago30', $days_ago30);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
<?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;
|
||||
|
||||
|
||||
use app\admin\logic\LuckDrawLogic;
|
||||
use app\common\server\ConfigServer;
|
||||
use app\common\model\Luckdraw as LuckdrawModel;
|
||||
|
||||
class LuckDraw extends AdminBase
|
||||
{
|
||||
/**
|
||||
* Notes: 查看页面
|
||||
* @author 张无忌(2021/1/25 11:08)
|
||||
* @return mixed
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = LuckDrawLogic::lists($get);
|
||||
$this->_success('获取成功', $lists);
|
||||
}
|
||||
|
||||
// 获取抽奖设置信息
|
||||
$this->assign('setConfig', [
|
||||
'limit' => ConfigServer::get('luckdraw', 'limit', 0),
|
||||
'need' => ConfigServer::get('luckdraw', 'need', 0),
|
||||
'rule' => ConfigServer::get('luckdraw', 'rule', ''),
|
||||
'status' => ConfigServer::get('luckdraw', 'status', 0),
|
||||
'show_win' => ConfigServer::get('luckdraw', 'show_win', 0)
|
||||
]);
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 添加奖品
|
||||
* @author 张无忌(2021/1/25 11:08)
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$validate = $this->validate($post, 'app\admin\validate\LuckDraw.add');
|
||||
if ($validate !== true) {
|
||||
$this->_error($validate);
|
||||
}
|
||||
if (LuckDrawLogic::add($post)) {
|
||||
$this->_success('新增成功');
|
||||
}
|
||||
$error = LuckDrawLogic::getError() ?: '新增失败';
|
||||
$this->_error($error);
|
||||
}
|
||||
$this->assign('prizes', LuckdrawModel::getPrizeDesc(true));
|
||||
$this->assign('coupon', LuckDrawLogic::coupon());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 编辑奖品
|
||||
* @author 张无忌(2021/1/25 11:08)
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$validate = $this->validate($post, 'app\admin\validate\LuckDraw');
|
||||
if ($validate !== true) {
|
||||
$this->_error($validate);
|
||||
}
|
||||
if (LuckDrawLogic::edit($post)) {
|
||||
$this->_success('编辑成功');
|
||||
}
|
||||
$error = LuckDrawLogic::getError() ?: '编辑失败';
|
||||
$this->error($error);
|
||||
}
|
||||
|
||||
$id = $this->request->get('id');
|
||||
$this->assign('prizes', LuckdrawModel::getPrizeDesc(true));
|
||||
$this->assign('coupon', LuckDrawLogic::coupon());
|
||||
$this->assign('detail', LuckDrawLogic::detail($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 删除
|
||||
* @author 张无忌(2021/1/26 11:19)
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$id = $this->request->post('id', 0, 'intval');
|
||||
if (LuckDrawLogic::del($id)) {
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$error = LuckDrawLogic::getError() ?: '删除失败';
|
||||
$this->_error($error);
|
||||
}
|
||||
}
|
||||
|
||||
public function switchStatus()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
if (LuckDrawLogic::switchStatus($post)) {
|
||||
$this->_success('更新成功');
|
||||
} else {
|
||||
$error = LuckDrawLogic::getError() ?? '更新失败';
|
||||
$this->_error($error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 更新排序
|
||||
* @author 张无忌(2021/1/28 10:21)
|
||||
*/
|
||||
public function sort()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
if (LuckDrawLogic::updateSort($post)) {
|
||||
$this->_success('更新成功');
|
||||
} else {
|
||||
$error = LuckDrawLogic::getError() ?? '更新失败';
|
||||
$this->_error($error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 设置抽奖规则
|
||||
* @author 张无忌(2021/1/25 11:08)
|
||||
*/
|
||||
public function set()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = LuckDrawLogic::set($post);
|
||||
if (!$result) {
|
||||
$error = LuckDrawLogic::getError() ?: '设置失败';
|
||||
$this->_error($error);
|
||||
}
|
||||
$this->_success('更新成功');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 抽奖记录
|
||||
* @author 张无忌(2021/1/25 11:08)
|
||||
*/
|
||||
public function record()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = LuckDrawLogic::record($get);
|
||||
$this->_success('OK', $lists);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?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;
|
||||
use app\admin\logic\MapConfigLogic;
|
||||
|
||||
class MapConfig extends AdminBase{
|
||||
|
||||
/**
|
||||
* @notes 获取地图配置
|
||||
* @return mixed|void
|
||||
* @throws \think\Exception
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
* @throws \think\exception\PDOException
|
||||
* @author ljj
|
||||
* @date 2021/8/20 8:34 下午
|
||||
*/
|
||||
public function config(){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
MapConfigLogic::setConfig($post);
|
||||
return $this->_success('设置成功',[]);
|
||||
}
|
||||
$this->assign('config',MapConfigLogic::getConfig());
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
<?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;
|
||||
use app\admin\logic\MarketingConfigLogic;
|
||||
|
||||
class MarketingConfig extends AdminBase{
|
||||
/**
|
||||
* note 邀请奖励
|
||||
* create_time 2020/12/2 16:18
|
||||
*/
|
||||
public function invitedAwardConfig(){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
MarketingConfigLogic::setConfig($post);
|
||||
return $this->_success('设置成功',[]);
|
||||
}
|
||||
$this->assign('config',MarketingConfigLogic::getConfig(['invited_award_integral']));
|
||||
return $this->fetch();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* note 下单奖励
|
||||
* create_time 2020/12/2 16:19
|
||||
*/
|
||||
public function orderAwardConfig(){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
MarketingConfigLogic::setConfig($post);
|
||||
return $this->_success('设置成功',[]);
|
||||
}
|
||||
$this->assign('config',MarketingConfigLogic::getConfig(['order_award_integral']));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 会员注册
|
||||
* create_time 2020/12/2 16:22
|
||||
*/
|
||||
public function registerAwardConfig(){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
MarketingConfigLogic::setConfig($post);
|
||||
return $this->_success('设置成功',[]);
|
||||
}
|
||||
$config = [
|
||||
'register_award_integral_status',
|
||||
'register_award_integral',
|
||||
'register_award_coupon_status',
|
||||
'register_award_coupon',
|
||||
];
|
||||
$this->assign('config',MarketingConfigLogic::getConfig($config));
|
||||
$this->assign('coupon_list',MarketingConfigLogic::getCouponList());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Notes: 积分抵扣
|
||||
* @author 段誉(2021/3/30 17:43)
|
||||
* @return mixed
|
||||
*/
|
||||
public function integralDeduction()
|
||||
{
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
MarketingConfigLogic::setConfig($post);
|
||||
$this->_success('设置成功',[]);
|
||||
}
|
||||
$config = [
|
||||
'integral_deduction_status',//积分抵扣状态
|
||||
'integral_deduction_money',//积分抵扣比例
|
||||
'integral_deduction_limit',//积分使用需超过多少才可使用
|
||||
];
|
||||
$this->assign('config',MarketingConfigLogic::getConfig($config));
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,317 @@
|
||||
<?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;
|
||||
|
||||
use app\admin\logic\CommonLogic;
|
||||
use app\admin\logic\MenuDecorateLogic;
|
||||
use app\common\model\Menu_;
|
||||
use app\common\server\ConfigServer;
|
||||
use app\common\server\UrlServer;
|
||||
class MenuDecorate extends AdminBase{
|
||||
/**
|
||||
* note 首页导航装修页面
|
||||
*/
|
||||
public function indexList(){
|
||||
if($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
return $this->_success('', MenuDecorateLogic::indexList($get));
|
||||
}
|
||||
$index_setting_logo = ConfigServer::get('decoration', 'index_setting_logo',1);
|
||||
$index_setting_hots = ConfigServer::get('decoration', 'index_setting_hots',1);
|
||||
$index_setting_news = ConfigServer::get('decoration', 'index_setting_news', 1);
|
||||
$index_setting_top_bg_image = ConfigServer::get('decoration', 'index_setting_top_bg_image', '');
|
||||
if(!empty($index_setting_top_bg_image)) {
|
||||
$index_setting_top_bg_image = UrlServer::getFileUrl($index_setting_top_bg_image);
|
||||
}
|
||||
$this->assign('index_setting_logo', $index_setting_logo);
|
||||
$this->assign('index_setting_hots', $index_setting_hots);
|
||||
$this->assign('index_setting_news', $index_setting_news);
|
||||
$this->assign('index_setting_top_bg_image', $index_setting_top_bg_image);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 个人中心装修页面
|
||||
*/
|
||||
// public function centerList(){
|
||||
// $this->assign('type',2);
|
||||
// return $this->fetch('lists');
|
||||
// }
|
||||
|
||||
/**
|
||||
* note 个人中心装修页面
|
||||
*/
|
||||
public function centerList(){
|
||||
if($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
return $this->_success('', MenuDecorateLogic::centerList($get));
|
||||
}
|
||||
$center_setting_top_bg_image = ConfigServer::get('decoration', 'center_setting_top_bg_image', '');
|
||||
if(!empty($center_setting_top_bg_image)) {
|
||||
$center_setting_top_bg_image = UrlServer::getFileUrl($center_setting_top_bg_image);
|
||||
}
|
||||
$this->assign('center_setting_top_bg_image', $center_setting_top_bg_image);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* note 获取数据列表
|
||||
* create_time 2020/12/1 11:14
|
||||
*/
|
||||
public function lists(){
|
||||
$get = $this->request->get('');
|
||||
if($this->request->isAjax()){
|
||||
$this->_success('', MenuDecorateLogic::lists($get));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* note 添加菜单
|
||||
* create_time 2020/12/1 11:00
|
||||
*/
|
||||
public function add(){
|
||||
if($this->request->isAjax()){
|
||||
$post_data = $this->request->post();
|
||||
$post_data['del'] = 0;
|
||||
$result = $this->validate($post_data, 'app\admin\validate\MenuDecorate.add');
|
||||
if($result === true){
|
||||
MenuDecorateLogic::add($post_data); //逻辑层处理添加数据
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$type = $this->request->param('type',1);
|
||||
$menu_list = Menu_::getMenuContent($type,true);
|
||||
$this->assign('menu_list',$menu_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 编辑菜单
|
||||
* create_time 2020/12/1 11:00
|
||||
*/
|
||||
public function edit(){
|
||||
if($this->request->isAjax()){
|
||||
$post_data = $this->request->post();
|
||||
$post_data['del'] = 0;
|
||||
$result = $this->validate($post_data, 'app\admin\validate\MenuDecorate.edit');
|
||||
if($result === true){
|
||||
MenuDecorateLogic::edit($post_data); //逻辑层处理添加数据
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$id = $this->request->get('id');
|
||||
$decorate = MenuDecorateLogic::getMenuDecorate($id);
|
||||
$menu_list = Menu_::getMenuContent($decorate['decorate_type'],true);
|
||||
$this->assign('menu_list',$menu_list);
|
||||
$this->assign('decorate',$decorate);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 删除菜单
|
||||
* create_time 2020/12/1 11:00
|
||||
*/
|
||||
public function del($id){
|
||||
if ($this->request->isAjax()) {
|
||||
$result = $this->validate(['id' => $id], 'app\admin\validate\MenuDecorate.del');
|
||||
if ($result === true) {
|
||||
MenuDecorateLogic::del($id);
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 批量删除菜单
|
||||
*/
|
||||
public function batchDel(){
|
||||
if ($this->request->isAjax()) {
|
||||
$ids = $this->request->post('id');
|
||||
$result = $this->validate(['id' => $ids], 'app\admin\validate\MenuDecorate.del');
|
||||
if ($result === true) {
|
||||
MenuDecorateLogic::batchDelMenuDecorate($ids);
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 复制菜单
|
||||
*/
|
||||
public function copy(){
|
||||
$id = $this->request->get('id');
|
||||
$decorate = MenuDecorateLogic::getMenuDecorate($id);
|
||||
$menu_list = Menu_::getIndexMenu(true);
|
||||
if($decorate['decorate_type'] == 2){
|
||||
$menu_list = Menu_::getCentreMenu(true);
|
||||
}
|
||||
$this->assign('menu_list',$menu_list);
|
||||
$this->assign('decorate',$decorate);
|
||||
return $this->fetch();
|
||||
}
|
||||
/*
|
||||
* 修改字段
|
||||
*/
|
||||
public function changeFields(){
|
||||
$table = $this->request->controller();
|
||||
$pk_name = 'id';
|
||||
$pk_value = $this->request->post('id');
|
||||
|
||||
$field = $this->request->post('field');
|
||||
$field_value = $this->request->post('value');
|
||||
$result = CommonLogic::changeTableValue($table, $pk_name, $pk_value, $field, $field_value);
|
||||
if ($result) {
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error('修改失败');
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品分类布局页
|
||||
*/
|
||||
public function categoryLayout() {
|
||||
if($this->request->isPost()) {
|
||||
$post = $this->request->post();
|
||||
// 这里设置值要与显示时取值不同,这里相当于所有的
|
||||
ConfigServer::set('decoration', 'layout_no', $post['layout_no']);
|
||||
$this->_success('设置成功');
|
||||
}
|
||||
|
||||
$category_layouts = ConfigServer::get('decoration', 'category_layout');
|
||||
$category_layouts_tips = ConfigServer::get('decoration', 'category_layout_tips');
|
||||
$layout_no = ConfigServer::get('decoration', 'layout_no', '');
|
||||
$this->assign('category_layouts', $category_layouts);
|
||||
$this->assign('category_layouts_tips', $category_layouts_tips);
|
||||
$this->assign('layout_no', $layout_no);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页 - 其它设置
|
||||
*/
|
||||
public function setIndexSetting()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
ConfigServer::set('decoration', 'index_setting_logo', $post['logo']);
|
||||
ConfigServer::set('decoration', 'index_setting_hots', $post['hots']);
|
||||
ConfigServer::set('decoration', 'index_setting_news', $post['news']);
|
||||
ConfigServer::set('decoration', 'index_setting_top_bg_image', $post['top_bg_image']);
|
||||
$this->_success('设置成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的 - 其它设置
|
||||
*/
|
||||
public function setCenterSetting()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
ConfigServer::set('decoration', 'center_setting_top_bg_image', $post['top_bg_image']);
|
||||
$this->_success('设置成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 底部导航
|
||||
*/
|
||||
public function bottomNavigation()
|
||||
{
|
||||
if($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$result = MenuDecorateLogic::bottomNavigation($get);
|
||||
return $this->_success('', $result);
|
||||
}
|
||||
$unSelectedTextColor = ConfigServer::get('decoration', 'navigation_setting_ust_color', '#000000');
|
||||
$selectedTextColor = ConfigServer::get('decoration', 'navigation_setting_st_color', '#000000');
|
||||
// $top_bg_image = ConfigServer::get('decoration', 'navigation_setting_top_bg_image', '');
|
||||
// if(!empty($top_bg_image)) {
|
||||
// $top_bg_image = UrlServer::getFileUrl($top_bg_image);
|
||||
// }
|
||||
$this->assign('unSelectedTextColor', $unSelectedTextColor);
|
||||
$this->assign('selectedTextColor', $selectedTextColor);
|
||||
// $this->assign('top_bg_image', $top_bg_image);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加底部导航
|
||||
*/
|
||||
public function addNavigation()
|
||||
{
|
||||
if($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = MenuDecorateLogic::addNavigation($post);
|
||||
if($result['flag']) {
|
||||
$this->_success($result['msg']);
|
||||
}else{
|
||||
$this->_error($result['msg']);
|
||||
}
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑底部导航
|
||||
*/
|
||||
public function editNavigation()
|
||||
{
|
||||
if($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = MenuDecorateLogic::editNavigation($post);
|
||||
if($result['flag']) {
|
||||
$this->_success($result['msg']);
|
||||
}else{
|
||||
$this->_error($result['msg']);
|
||||
}
|
||||
}
|
||||
$id = $this->request->get('id');
|
||||
$navigation = MenuDecorateLogic::getNavigation($id);
|
||||
$this->assign('navigation', $navigation);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除底部导航
|
||||
*/
|
||||
public function delNavigation()
|
||||
{
|
||||
if($this->request->isPost()) {
|
||||
$id = $this->request->post('id', '', 'intval');
|
||||
$result = MenuDecorateLogic::delNavigation($id);
|
||||
if($result) {
|
||||
return $this->_success('删除成功');
|
||||
}else{
|
||||
return $this->_error('删除失败');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 底部导航 - 其他设置
|
||||
*/
|
||||
public function setNavigationSetting()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
ConfigServer::set('decoration', 'navigation_setting_ust_color', $post['unSelectedTextColor']);
|
||||
ConfigServer::set('decoration', 'navigation_setting_st_color', $post['selectedTextColor']);
|
||||
// ConfigServer::set('decoration', 'navigation_setting_top_bg_image', $post['top_bg_image']);
|
||||
$this->_success('设置成功');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?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;
|
||||
use app\admin\logic\MessageLogic;
|
||||
|
||||
class Message extends AdminBase{
|
||||
|
||||
public function config(){
|
||||
$config = MessageLogic::config();
|
||||
$this->assign('config',$config);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function set(){
|
||||
$id = $this->request->get('id',1);
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
MessageLogic::setConfig($post);
|
||||
$this->_success('设置成功');
|
||||
|
||||
|
||||
}
|
||||
$info = MessageLogic::getMessage($id);
|
||||
$this->assign('info',$info);
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?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;
|
||||
|
||||
use app\admin\logic\MnpLogic;
|
||||
use think\Request;
|
||||
|
||||
|
||||
class Mnp extends AdminBase
|
||||
{
|
||||
/**
|
||||
* 设置小程序
|
||||
* @return mixed
|
||||
*/
|
||||
public function setMnp()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
MnpLogic::SetMnp($post);
|
||||
$this->_success('设置成功');
|
||||
}
|
||||
|
||||
$mnp = MnpLogic::getMnp();
|
||||
$this->assign('mnp', $mnp);
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
<?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;
|
||||
|
||||
|
||||
use app\admin\logic\MnpMessageLogic;
|
||||
|
||||
class MnpMessage extends AdminBase
|
||||
{
|
||||
/**
|
||||
* Notes: 模板消息管理
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$list = MnpMessageLogic::lists($get);
|
||||
$this->_success('', $list);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 编辑模板消息
|
||||
* @param $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$info = MnpMessageLogic::getTemplateMessage($id);
|
||||
$this->assign('info',$info);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 修改消息模板使用状态
|
||||
*/
|
||||
public function switchStatus()
|
||||
{
|
||||
$get = $this->request->get();
|
||||
$result = MnpMessageLogic::switchStatus($get);
|
||||
if ($result) {
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_success('修改失败');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 同步消息模板
|
||||
*/
|
||||
public function synchro()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
$result = MnpMessageLogic::synchro($post);
|
||||
if ($result === true) {
|
||||
$this->_success('同步成功');
|
||||
}
|
||||
$this->_error('同步失败,请检查配置信息');
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
use app\admin\logic\MyLogic;
|
||||
use yx\admin\builderClass;
|
||||
|
||||
class My extends AdminBase
|
||||
{
|
||||
/**
|
||||
* 修改个人密码
|
||||
* @return mixed
|
||||
* @throws \think\Exception
|
||||
* @throws \think\exception\PDOException
|
||||
*/
|
||||
public function password()
|
||||
{
|
||||
if ($this->request->post()) {
|
||||
$post = input('post.');
|
||||
$post['admin_id'] = $this->admin_id;
|
||||
$result = $this->validate($post, 'app\admin\validate\Password');
|
||||
if ($result === true) {
|
||||
MyLogic::updatePassword($post['password'], $this->admin_id);
|
||||
$this->_success('修改密码成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
<?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;
|
||||
|
||||
|
||||
|
||||
use app\admin\logic\NoticeSettingLogic;
|
||||
use app\common\model\NoticeSetting as NoticeSettingModel;
|
||||
use think\Db;
|
||||
|
||||
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'] ?? NoticeSettingModel::NOTICE_USER;
|
||||
$this->_success('获取成功', NoticeSettingLogic::lists($type));
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 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);
|
||||
$this->_success('操作成功');
|
||||
}
|
||||
|
||||
$this->assign('info', NoticeSettingLogic::info($id, $type));
|
||||
$this->assign('type', $type);
|
||||
return $this->fetch('set_'.$type);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通知记录
|
||||
*/
|
||||
public function record()
|
||||
{
|
||||
if($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$data = NoticeSettingLogic::record($get);
|
||||
$this->_success('', $data);
|
||||
}
|
||||
$param = $this->request->get();
|
||||
$this->assign('param', $param);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除记录,直接删除(非软删除)
|
||||
*/
|
||||
public function delRecord()
|
||||
{
|
||||
$id = $this->request->post('id', '', 'intval');
|
||||
if(empty($id)) {
|
||||
return $this->_error('参数缺失,删除失败');
|
||||
}
|
||||
$res = Db::name('notice')->delete($id);
|
||||
if($res) {
|
||||
return $this->_success('删除成功');
|
||||
}else{
|
||||
return $this->_error('删除失败');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?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;
|
||||
use app\admin\logic\OaLogic;
|
||||
use app\admin\logic\WeChatLogic;
|
||||
use app\common\server\ConfigServer;
|
||||
|
||||
class Oa extends AdminBase {
|
||||
/**
|
||||
* note 设置公众号
|
||||
* create_time 2020/12/11 11:28
|
||||
*/
|
||||
public function setOa(){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
OaLogic::setOa($post);
|
||||
$this->_success('设置成功');
|
||||
}
|
||||
$oa = OaLogic::getOa();
|
||||
$this->assign('oa',$oa);
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* note 微信菜单
|
||||
* create_time 2020/12/11 11:28
|
||||
*/
|
||||
public function oaMenu(){
|
||||
$wechat_menu = ConfigServer::get('menu', 'wechat_menu',[]);
|
||||
$this->assign('menu',$wechat_menu);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 发布菜单
|
||||
* create_time 2020/12/11 11:28
|
||||
*/
|
||||
public function pulishMenu(){
|
||||
$menu = $this->request->post('button');
|
||||
if(empty($menu)){
|
||||
$this->_error('请设置菜单');
|
||||
}
|
||||
$result = OaLogic::pulishMenu($menu);
|
||||
if($result['code'] == 1){
|
||||
$this->_success($result['msg']);
|
||||
}
|
||||
$this->_error($result['msg']);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
<?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;
|
||||
|
||||
|
||||
use app\admin\logic\OaMessageLogic;
|
||||
|
||||
class OaMessage extends AdminBase
|
||||
{
|
||||
|
||||
/**
|
||||
* Notes: 模板消息管理
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$list = OaMessageLogic::lists($get);
|
||||
$this->_success('', $list);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 编辑模板消息
|
||||
* @param $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$info = OaMessageLogic::getTemplateMessage($id);
|
||||
$this->assign('info',$info);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 修改消息模板使用状态
|
||||
*/
|
||||
public function switchStatus()
|
||||
{
|
||||
$get = $this->request->get();
|
||||
$result = OaMessageLogic::switchStatus($get);
|
||||
if ($result) {
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_success('修改失败');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 同步消息模板到公众号
|
||||
*/
|
||||
public function synchro()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
$result = OaMessageLogic::synchro($post);
|
||||
if ($result === true) {
|
||||
$this->_success('同步成功');
|
||||
}
|
||||
$this->_error('同步失败,请检查配置信息');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?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;
|
||||
use app\admin\logic\OpLogic;
|
||||
|
||||
class Op extends Admin{
|
||||
public function config(){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
OpLogic::setConfig($post);
|
||||
$this->_success('设置成功',[]);
|
||||
}
|
||||
$this->assign('config',OpLogic::getConfig(['app_id','secret']));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,227 @@
|
||||
<?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;
|
||||
|
||||
use app\common\model\OrderLog;
|
||||
use app\admin\logic\OrderLogic;
|
||||
use app\common\model\Client_;
|
||||
use app\common\model\Order as CommonOrder;
|
||||
use app\common\model\Pay;
|
||||
use think\Db;
|
||||
|
||||
class Order extends AdminBase
|
||||
{
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 订单列表
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$this->_success('', OrderLogic::lists($get));
|
||||
}
|
||||
$this->assign('order_status', CommonOrder::getOrderStatus(true));
|
||||
$this->assign('order_type', CommonOrder::getOrderType(true));
|
||||
$this->assign('pay_way', Pay::getPayWay(true));
|
||||
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
|
||||
$this->assign('order_source', Client_::getClient(true));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function exportFile()
|
||||
{
|
||||
$get = $this->request->get();
|
||||
$this->_success('', OrderLogic::exportFile($get));
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 订单详情
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$id = $this->request->get('id');
|
||||
$detail = OrderLogic::getDetail($id);
|
||||
$this->assign('detail', $detail);
|
||||
$this->assign('logs', OrderLog::getOrderLog($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 取消订单
|
||||
*/
|
||||
public function cancel()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post('');
|
||||
$check = $this->validate($post, 'app\admin\validate\Order.cancel');
|
||||
if (true !== $check) {
|
||||
$this->_error($check);
|
||||
}
|
||||
$res = OrderLogic::cancel($post['order_id'], $this->admin_id);
|
||||
if ($res === true) {
|
||||
$this->_success('取消成功');
|
||||
}
|
||||
$this->_error($res);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 删除订单
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post('');
|
||||
$check = $this->validate($post, 'app\admin\validate\Order.del');
|
||||
if (true !== $check) {
|
||||
$this->_error($check);
|
||||
}
|
||||
OrderLogic::del($post['order_id'], $this->admin_id);
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 发货
|
||||
*/
|
||||
public function delivery()
|
||||
{
|
||||
$id = $this->request->get('id');
|
||||
$detail = OrderLogic::getDetail($id);
|
||||
$this->assign('detail', $detail);
|
||||
$this->assign('express', OrderLogic::express());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 发货操作
|
||||
*/
|
||||
public function deliveryHandle()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post('');
|
||||
$check = $this->validate($post, 'app\admin\validate\Order.delivery');
|
||||
if (true !== $check) {
|
||||
$this->_error($check);
|
||||
}
|
||||
OrderLogic::deliveryHandle($post, $this->admin_id);
|
||||
$this->_success('发货成功');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 确认收货
|
||||
*/
|
||||
public function confirm()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post('');
|
||||
$check = $this->validate($post, 'app\admin\validate\Order.confirm');
|
||||
if (true !== $check) {
|
||||
$this->_error($check);
|
||||
}
|
||||
OrderLogic::confirm($post['order_id'], $this->admin_id);
|
||||
$this->_success('确认成功');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 物流信息
|
||||
*/
|
||||
public function express()
|
||||
{
|
||||
$id = $this->request->get('id');
|
||||
$detail = OrderLogic::getDetail($id);
|
||||
$detail['shipping'] = OrderLogic::shippingInfo($detail['id']);
|
||||
$this->assign('detail', $detail);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function remarks()
|
||||
{
|
||||
// 获取的
|
||||
if ($this->request->isAjax() && $this->request->isGet()){
|
||||
$get = $this->request->get();
|
||||
$detail = OrderLogic::remarks($get, 'get');
|
||||
$this->_success('获取成功', $detail);
|
||||
}
|
||||
|
||||
// 提交的
|
||||
if ($this->request->isAjax() && $this->request->isPost()) {
|
||||
$post = $this->request->post();
|
||||
$result = OrderLogic::remarks($post, 'post');
|
||||
if ($result) {
|
||||
$this->_success('保存成功');
|
||||
}
|
||||
$this->error('保存失败');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:打印接口
|
||||
*/
|
||||
public function orderPrint(){
|
||||
$id = $this->request->post('id');
|
||||
$result = $this->validate(['id'=>$id],'app\admin\validate\OrderPrint');
|
||||
if(true === $result){
|
||||
$result = OrderLogic::orderPrint($id);
|
||||
if(true === $result){
|
||||
$this->success('打印成功,如未出小票,请检查打印机是否在线');
|
||||
}
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 修改快递单号
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
* @author suny
|
||||
* @date 2021/11/08 16:06 下午
|
||||
*/
|
||||
public function change_delivery()
|
||||
{
|
||||
$get = $this->request->get();
|
||||
if($this->request->isAjax() && $this->request->isPost())
|
||||
{
|
||||
$post = $this->request->post();
|
||||
$result = OrderLogic::changeDelivery($post);
|
||||
if ($result) {
|
||||
$this->_success('操作成功');
|
||||
}
|
||||
}
|
||||
|
||||
$detail = OrderLogic::getDelivery($get);
|
||||
$this->assign('detail', $detail);
|
||||
$this->assign('express', OrderLogic::express());
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
<?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;
|
||||
|
||||
use app\admin\logic\PayConfigLogic;
|
||||
use app\common\server\ConfigServer;
|
||||
use think\db;
|
||||
|
||||
class PayConfig extends AdminBase
|
||||
{
|
||||
|
||||
/**
|
||||
* Notes: 支付列表
|
||||
* @author 段誉(2021/3/10 11:46)
|
||||
* @return mixed
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$this->_success('', PayConfigLogic::lists());
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Notes: 余额支付
|
||||
* @author 段誉(2021/3/8 10:57)
|
||||
* @return mixed
|
||||
*/
|
||||
public function editBalance()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
if (empty($post['icon']) && $post['status'] == 1) {
|
||||
$this->_error('请选择支付图标');
|
||||
}
|
||||
PayConfigLogic::editBalance($post);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->assign('info', PayConfigLogic::info('balance'));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Notes: 编辑微信
|
||||
* @author 段誉(2021/3/8 11:16)
|
||||
* @return mixed
|
||||
*/
|
||||
public function editWechat()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
if ($post['status'] == 1) {
|
||||
if (empty($post['icon'])) {
|
||||
$this->_error('请选择支付图标');
|
||||
}
|
||||
if ($post['apiclient_cert'] == '' || $post['apiclient_key'] == '') {
|
||||
$this->_error('apiclient_cert或apiclient_key不能为空');
|
||||
}
|
||||
}
|
||||
PayConfigLogic::editWechat($post);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$domain_name = ConfigServer::get('website', 'domain_name', '');
|
||||
$domain_name = $domain_name ? $domain_name : request()->domain();
|
||||
$this->assign('domain', $domain_name);
|
||||
$this->assign('info', PayConfigLogic::info('wechat'));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Notes: 支付宝
|
||||
* @author 段誉(2021/3/10 11:47)
|
||||
* @return mixed
|
||||
* @throws \think\Exception
|
||||
* @throws \think\exception\PDOException
|
||||
*/
|
||||
public function editAlipay()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
if (empty($post['icon']) && $post['status'] == 1) {
|
||||
$this->_error('请选择支付图标');
|
||||
}
|
||||
PayConfigLogic::editAlipay($post);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->assign('info', PayConfigLogic::info('alipay'));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* PC商城控制器
|
||||
* Class Pc
|
||||
* @package app\admin\controller
|
||||
*/
|
||||
class Pc extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes PC商城设置
|
||||
* @return \think\response\View|void
|
||||
* @author Tab
|
||||
* @date 2021/8/14 14:55
|
||||
*/
|
||||
public function set()
|
||||
{
|
||||
if($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
\app\admin\logic\Pc::set($params);
|
||||
return $this->_success('设置成功');
|
||||
}
|
||||
$config = \app\admin\logic\Pc::getConfig();
|
||||
$this->assign('config', $config);
|
||||
return view();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
<?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;
|
||||
use app\admin\logic\PrinterLogic;
|
||||
|
||||
class Printer extends AdminBase{
|
||||
/**
|
||||
* Notes:打印机列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function lists(){
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$list = PrinterLogic::lists($get);
|
||||
$this->_success('',$list);
|
||||
}
|
||||
return $this->fetch();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:添加打印机
|
||||
* @return mixed
|
||||
*/
|
||||
public function add(){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post,'app\admin\validate\Printer.add');
|
||||
if(true === $result){
|
||||
$result = PrinterLogic::add($post);
|
||||
if(true === $result){
|
||||
$this->_success('添加成功');
|
||||
}
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->assign('type_list',PrinterLogic::getTypeList());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:编辑打印机
|
||||
* @param $id 打印机id
|
||||
* @return mixed
|
||||
*/
|
||||
public function edit($id){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post,'app\admin\validate\Printer');
|
||||
if(true === $result){
|
||||
$result = PrinterLogic::edit($post);
|
||||
if(true === $result){
|
||||
$this->_success('添加成功');
|
||||
}
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->assign('type_list',PrinterLogic::getTypeList());
|
||||
$this->assign('detail',PrinterLogic::getPrinter($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:设置打印机配置
|
||||
* @return mixed
|
||||
*/
|
||||
public function setConfig(){
|
||||
$id = $this->request->get('id');
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post,'app\admin\validate\SetConfig');
|
||||
if(true === $result){
|
||||
PrinterLogic::setConfig($post);
|
||||
$this->_success('设置成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
|
||||
}
|
||||
$this->assign('detail',PrinterLogic::getConfig($id));
|
||||
return $this->fetch('config');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:设置打印机配置
|
||||
*/
|
||||
public function setTemplate(){
|
||||
$post = $this->request->post();
|
||||
$result = PrinterLogic::setTemplate($post);
|
||||
if(true === $result){
|
||||
$this->_success('模板设置成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:测试打印
|
||||
*/
|
||||
public function testPrint(){
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post,'app\admin\validate\Printer.config');
|
||||
if(true === $result){
|
||||
$result = PrinterLogic::testPrint($post);
|
||||
if(true === $result){
|
||||
$this->_success('打印成功');
|
||||
}
|
||||
}
|
||||
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
public function del(){
|
||||
$id = $this->request->post('id');
|
||||
$result = $this->validate(['id'=>$id],'app\admin\validate\Printer.del');
|
||||
if(true === $result){
|
||||
$result = PrinterLogic::del($id);
|
||||
if($result === true){
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->error($result);
|
||||
}
|
||||
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
<?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;
|
||||
use app\admin\logic\CommonLogic;
|
||||
use app\admin\logic\RechargeLogic;
|
||||
|
||||
class Recharge extends AdminBase {
|
||||
/**
|
||||
* note 充值模板列表
|
||||
* create_time 2020/10/23 16:21
|
||||
*/
|
||||
public function lists(){
|
||||
$get = $this->request->get();
|
||||
if($this->request->isAjax()){
|
||||
if($get['type'] == 1){
|
||||
$list = RechargeLogic::templatelists($get['type']);
|
||||
}else{
|
||||
$list = RechargeLogic::getRechargeConfig();
|
||||
}
|
||||
$this->_success('',$list);
|
||||
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 设置充值
|
||||
* create_time 2020/10/24 11:34
|
||||
*/
|
||||
public function setRecharge(){
|
||||
$post = $this->request->post();
|
||||
if($this->request->isAjax()){
|
||||
RechargeLogic::setRecharge($post);
|
||||
$this->_success('设置成功');
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* note 添加充值模板
|
||||
* create_time 2020/10/23 17:52
|
||||
*/
|
||||
public function add(){
|
||||
|
||||
if ($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post,'app\admin\validate\RechargeTemplate');
|
||||
if ($result === true){
|
||||
RechargeLogic::add($post);
|
||||
$this->_success('添加成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* note 编辑充值模板
|
||||
* create_time 2020/10/23 17:51
|
||||
*/
|
||||
public function edit($id){
|
||||
if ($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post,'app\admin\validate\RechargeTemplate');
|
||||
if ($result === true){
|
||||
RechargeLogic::edit($post);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$info = RechargeLogic::getRechargeTemplate($id);
|
||||
$this->assign('info',$info);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 删除充值模板
|
||||
*/
|
||||
public function del($id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$result = RechargeLogic::del($id);
|
||||
if ($result) {
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error('删除失败');
|
||||
}
|
||||
}
|
||||
|
||||
public function changeFields(){
|
||||
$table = 'recharge_template';
|
||||
|
||||
$pk_name = 'id';
|
||||
$pk_value = $this->request->get('id');
|
||||
|
||||
$field = $this->request->get('field');
|
||||
$field_value = $this->request->get('value');
|
||||
$result = CommonLogic::changeTableValue($table,$pk_name,$pk_value,$field,$field_value);
|
||||
if($result){
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error('修改失败');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
<?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;
|
||||
use app\admin\logic\RechargeLogLogic;
|
||||
use think\helper\Time;
|
||||
|
||||
class RechargeLog extends AdminBase{
|
||||
/**
|
||||
* note 充值记录
|
||||
* create_time 2020/11/18 10:05
|
||||
*/
|
||||
public function lists(){
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$list = RechargeLogLogic::lists($get);
|
||||
$this->_success('', $list);
|
||||
|
||||
}
|
||||
$today = array_map(function ($time) {
|
||||
return date('Y-m-d H:i:s', $time);
|
||||
}, Time::today());
|
||||
$this->assign('today', $today);
|
||||
|
||||
$yesterday = array_map(function ($time) {
|
||||
return date('Y-m-d H:i:s', $time);
|
||||
}, Time::yesterday());
|
||||
$this->assign('yesterday', $yesterday);
|
||||
|
||||
|
||||
$days_ago7 = array_map(function ($time) {
|
||||
return date('Y-m-d H:i:s', $time);
|
||||
}, Time::dayToNow(7));
|
||||
$this->assign('days_ago7', $days_ago7);
|
||||
|
||||
$days_ago30 = array_map(function ($time) {
|
||||
return date('Y-m-d H:i:s', $time);
|
||||
}, Time::dayToNow(30, true));
|
||||
$this->assign('days_ago30', $days_ago30);
|
||||
return $this->fetch();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
<?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;
|
||||
|
||||
use app\admin\logic\AdminLogic;
|
||||
use app\admin\logic\RoleLogic;
|
||||
use think\facade\Hook;
|
||||
|
||||
class Role extends AdminBase
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$this->_success('', RoleLogic::lists());
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加角色
|
||||
* @return mixed
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post, 'app\admin\validate\Role.add');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
$result = RoleLogic::addRole($post);
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->_success('添加成功');
|
||||
}
|
||||
$auth_tree = RoleLogic::authTree();
|
||||
$this->assign('auth_tree', json_encode($auth_tree));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑角色
|
||||
* @param string $role_id
|
||||
* @return mixed
|
||||
* @throws \think\Exception
|
||||
* @throws \think\exception\PDOException
|
||||
*/
|
||||
public function edit($role_id = '')
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post, 'app\admin\validate\Role.edit');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
$result = RoleLogic::editRole($post);
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
Hook::listen('menu_auth');
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$auth_tree = RoleLogic::authTree($role_id);
|
||||
$this->assign('info', RoleLogic::roleInfo($role_id));
|
||||
$this->assign('auth_tree', json_encode($auth_tree));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除角色
|
||||
* @param $role_id
|
||||
* @throws \think\Exception
|
||||
* @throws \think\exception\PDOException
|
||||
*/
|
||||
public function del($role_id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$result = $this->validate(['id' => $role_id], 'app\admin\validate\Role.del');
|
||||
if ($result === true) {
|
||||
RoleLogic::delRole($role_id);
|
||||
Hook::listen('menu_auth');
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
<?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;
|
||||
use app\admin\logic\SeckillLogic;
|
||||
class Seckill extends AdminBase{
|
||||
|
||||
public function lists(){
|
||||
$seckill_time = SeckillLogic::getTimeAll();
|
||||
$this->assign('seckill',$seckill_time);
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* note 秒杀商品
|
||||
* create_time 2020/11/13 16:01
|
||||
*/
|
||||
public function goodsLists(){
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$list = SeckillLogic::goodsList($get);
|
||||
$this->_success('',$list);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* note 秒杀时间
|
||||
* create_time 2020/11/13 16:01
|
||||
*/
|
||||
public function timeLists(){
|
||||
if($this->request->isAjax()){
|
||||
$get= $this->request->get();
|
||||
$list = SeckillLogic::timeList($get);
|
||||
$this->_success('',$list);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* note 添加秒杀时间段
|
||||
* create_time 2020/11/13 16:01
|
||||
*/
|
||||
public function addTime(){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post, 'app\admin\validate\SeckillTime');
|
||||
if($result === true){
|
||||
SeckillLogic::addTime($post);
|
||||
$this->_success('新增成功','');
|
||||
}
|
||||
$this->_error($result,'');
|
||||
|
||||
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 编辑秒杀时间段
|
||||
* create_time 2020/11/13 16:02
|
||||
*/
|
||||
public function editTime($id){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post, 'app\admin\validate\SeckillTime');
|
||||
if($result === true){
|
||||
SeckillLogic::editTime($post);
|
||||
$this->_success('编辑成功','');
|
||||
}
|
||||
$this->_error($result,'');
|
||||
}
|
||||
$this->assign('detail',SeckillLogic::getTime($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 删除秒杀时间段
|
||||
* create_time 2020/11/13 16:02
|
||||
*/
|
||||
public function delTime(){
|
||||
if($this->request->isAjax()){
|
||||
$id = $this->request->post('id');
|
||||
$result = SeckillLogic::delTime($id);
|
||||
|
||||
if($result == true){
|
||||
$this->_success('删除成功','');
|
||||
}
|
||||
return $this->_error('删除失败','');
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
/**
|
||||
* note 添加秒杀商品
|
||||
* create_time 2020/11/13 16:02
|
||||
*/
|
||||
public function addGoods(){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$post['item'] = form_to_linear($post);
|
||||
$result = $this->validate($post,'app\admin\validate\SeckillGoods.add');
|
||||
if($result === true){
|
||||
$result = SeckillLogic::addGoods($post);
|
||||
if($result){
|
||||
$this->_success('新增成功','');
|
||||
}
|
||||
$result = '新增失败';
|
||||
}
|
||||
$this->_error($result);
|
||||
|
||||
}
|
||||
|
||||
$seckill_time = SeckillLogic::getTimeAll();
|
||||
$this->assign('seckill',$seckill_time);
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* note 编辑秒杀商品
|
||||
* create_time 2020/11/13 16:02
|
||||
*/
|
||||
public function editGoods(){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$post['item'] = form_to_linear($post);
|
||||
$result = $this->validate($post,'app\admin\validate\SeckillGoods.edit');
|
||||
if($result === true){
|
||||
$result = SeckillLogic::editGoods($post);
|
||||
if($result){
|
||||
$this->_success('编辑成功','');
|
||||
}
|
||||
$result = '编辑失败';
|
||||
}
|
||||
$this->_error($result);
|
||||
|
||||
|
||||
}
|
||||
$id = $this->request->get('id');
|
||||
$seckill_id = $this->request->get('seckill_id');
|
||||
|
||||
$detail = SeckillLogic::getSeckillGoods($id,$seckill_id);
|
||||
$seckill_time = SeckillLogic::getTimeAll();
|
||||
$this->assign('seckill',$seckill_time);
|
||||
$this->assign('detail',$detail);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 删除秒杀商品
|
||||
* create_time 2020/11/13 16:05
|
||||
*/
|
||||
public function delGoods(){
|
||||
if($this->request->isAjax()){
|
||||
$id = $this->request->post('id');
|
||||
$seckill_id = $this->request->post('seckill_id');
|
||||
$result = SeckillLogic::delGoods($id,$seckill_id);
|
||||
|
||||
if($result == true){
|
||||
$this->_success('删除成功','');
|
||||
}
|
||||
return $this->_error('删除失败','');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
<?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;
|
||||
|
||||
|
||||
use app\admin\logic\SelffetchShopLogic;
|
||||
use app\common\server\ConfigServer;
|
||||
|
||||
class SelffetchShop extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes 查看自提门店列表
|
||||
* @return mixed
|
||||
* @author ljj
|
||||
* @date 2021/8/14 6:02 下午
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$params = $this->request->get();
|
||||
$this->_success('', SelffetchShopLogic::lists($params));
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 添加自提门店
|
||||
* @return mixed
|
||||
* @author ljj
|
||||
* @date 2021/8/16 11:22 上午
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax() && $this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$result = $this->validate($params, 'app\admin\validate\SelffetchShop.add');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
$result = SelffetchShopLogic::add($params);
|
||||
if ($result !== true) {
|
||||
$this->_error('添加失败:' . $result);
|
||||
}
|
||||
$this->_success('添加成功');
|
||||
}
|
||||
|
||||
$this->assign('tx_map_key',ConfigServer::get('map','tx_map_key',''));
|
||||
$this->assign('area_lists', json_encode(SelffetchShopLogic::getAreaLists(), JSON_UNESCAPED_UNICODE));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 编辑自提门店
|
||||
* @param $id
|
||||
* @return mixed
|
||||
* @author ljj
|
||||
* @date 2021/8/16 2:15 下午
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
if ($this->request->isAjax() && $this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$result = $this->validate($params, 'app\admin\validate\SelffetchShop.edit');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
$result = SelffetchShopLogic::edit($params);
|
||||
if ($result !== true) {
|
||||
$this->_error('修改失败:' . $result);
|
||||
}
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
|
||||
$this->assign('tx_map_key',ConfigServer::get('map','tx_map_key',''));
|
||||
$this->assign('area_lists', json_encode(SelffetchShopLogic::getAreaLists(), JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('detail', SelffetchShopLogic::detail($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 修改自提门店状态
|
||||
* @author ljj
|
||||
* @date 2021/8/16 2:35 下午
|
||||
*/
|
||||
public function status()
|
||||
{
|
||||
if ($this->request->isAjax() && $this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$result = $this->validate($params, 'app\admin\validate\SelffetchShop.status');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
$result = SelffetchShopLogic::status($params);
|
||||
if ($result !== true) {
|
||||
$this->_error('修改失败:' . $result);
|
||||
}
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 删除自提门店
|
||||
* @author ljj
|
||||
* @date 2021/8/16 2:42 下午
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax() && $this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$result = $this->validate($params, 'app\admin\validate\SelffetchShop.del');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
$result = SelffetchShopLogic::del($params);
|
||||
if ($result !== true) {
|
||||
$this->_error('删除失败:' . $result);
|
||||
}
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 导出列表
|
||||
* @author ljj
|
||||
* @date 2021/8/16 2:50 下午
|
||||
*/
|
||||
public function exportFile()
|
||||
{
|
||||
$params = $this->request->get();
|
||||
$this->_success('', SelffetchShopLogic::exportFile($params));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
<?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;
|
||||
|
||||
|
||||
use app\admin\logic\SelffetchVerifierLogic;
|
||||
|
||||
class SelffetchVerifier extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes 核销员列表
|
||||
* @return mixed
|
||||
* @author ljj
|
||||
* @date 2021/8/16 3:30 下午
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$params = $this->request->get();
|
||||
$this->_success('', SelffetchVerifierLogic::lists($params));
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 添加核销员
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
* @author ljj
|
||||
* @date 2021/8/16 4:45 下午
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax() && $this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$result = $this->validate($params, 'app\admin\validate\SelffetchVerifier.add');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
$result = SelffetchVerifierLogic::add($params);
|
||||
if ($result !== true) {
|
||||
$this->_error('添加失败:' . $result);
|
||||
}
|
||||
$this->_success('添加成功');
|
||||
}
|
||||
|
||||
$this->assign('shop_lists', SelffetchVerifierLogic::getShopLists());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 获取用户列表
|
||||
* @return mixed
|
||||
* @author ljj
|
||||
* @date 2021/8/19 2:42 下午
|
||||
*/
|
||||
public function userLists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$params = $this->request->get();
|
||||
$this->_success('', SelffetchVerifierLogic::getUserLists($params));
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 编辑核销员
|
||||
* @param $id
|
||||
* @return mixed
|
||||
* @author ljj
|
||||
* @date 2021/8/16 4:49 下午
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
if ($this->request->isAjax() && $this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$result = $this->validate($params, 'app\admin\validate\SelffetchVerifier.edit');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
$result = SelffetchVerifierLogic::edit($params);
|
||||
if ($result !== true) {
|
||||
$this->_error('修改失败:' . $result);
|
||||
}
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
|
||||
//$this->assign('user_lists', SelffetchVerifierLogic::getUserLists());
|
||||
$this->assign('shop_lists', SelffetchVerifierLogic::getShopLists());
|
||||
$this->assign('detail', SelffetchVerifierLogic::detail($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 修改核销员状态
|
||||
* @author ljj
|
||||
* @date 2021/8/16 4:55 下午
|
||||
*/
|
||||
public function status()
|
||||
{
|
||||
if ($this->request->isAjax() && $this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$result = $this->validate($params, 'app\admin\validate\SelffetchVerifier.status');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
$result = SelffetchVerifierLogic::status($params);
|
||||
if ($result !== true) {
|
||||
$this->_error('修改失败:' . $result);
|
||||
}
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 删除核销员
|
||||
* @author ljj
|
||||
* @date 2021/8/16 4:58 下午
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax() && $this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$result = $this->validate($params, 'app\admin\validate\SelffetchVerifier.del');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
$result = SelffetchVerifierLogic::del($params);
|
||||
if ($result !== true) {
|
||||
$this->_error('删除失败:' . $result);
|
||||
}
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 导出核销员列表
|
||||
* @author ljj
|
||||
* @date 2021/8/16 5:02 下午
|
||||
*/
|
||||
public function exportFile()
|
||||
{
|
||||
$params = $this->request->get();
|
||||
$this->_success('', SelffetchVerifierLogic::exportFile($params));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?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;
|
||||
use app\admin\logic\ServiceConfigLogic;
|
||||
|
||||
class ServiceConfig extends AdminBase{
|
||||
public function config(){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
ServiceConfigLogic::setConfig($post);
|
||||
return $this->_success('设置成功',[]);
|
||||
}
|
||||
$this->assign('config',ServiceConfigLogic::getConfig());
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
<?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;
|
||||
|
||||
use app\common\server\ConfigServer;
|
||||
|
||||
class ShopSetting extends AdminBase
|
||||
{
|
||||
|
||||
/**
|
||||
* 交易设置
|
||||
*/
|
||||
public function trading()
|
||||
{
|
||||
$config = [
|
||||
'order_contact' => ConfigServer::get('order_message', 'order_contact' ),//订单管理联系人
|
||||
'order_contact_mobile' => ConfigServer::get('order_message', 'order_contact_mobile'),//订单管理联系人手机
|
||||
'order_cancel' => ConfigServer::get('trading', 'order_cancel', 30),//未付款订单多久时间后自动关闭
|
||||
'customer_cancel_limit' => ConfigServer::get('trading', 'customer_cancel_limit', 0),//已支付订单多长时间内允许客户主动取消订单
|
||||
'order_finish' => ConfigServer::get('trading', 'order_finish', 7),//已发货订单多久时间后自动收货完成订单
|
||||
'refund_days' => ConfigServer::get('after_sale', 'refund_days', 7),//已完成订单多久时间内允许售后退款
|
||||
'deduct_type' => ConfigServer::get('trading', 'deduct_type', 1),//订单库存扣减方式
|
||||
'growth_ratio' => ConfigServer::get('trading', 'growth_ratio', 0),//成长值比例
|
||||
'contact' => ConfigServer::get('shop', 'contact' ),//联系人
|
||||
'mobile' => ConfigServer::get('shop', 'mobile'),//联系手机号
|
||||
'province_id' => ConfigServer::get('shop', 'province_id'),//省份id
|
||||
'city_id' => ConfigServer::get('shop', 'city_id'),//市id
|
||||
'district_id' => ConfigServer::get('shop', 'district_id'),//区id
|
||||
'address' => ConfigServer::get('shop', 'address'),//详细地址
|
||||
'give_integral_scene' => ConfigServer::get('trading', 'give_integral_scene', 1), //赠送积分时机
|
||||
'give_growth_scene' => ConfigServer::get('trading', 'give_growth_scene', 1) //赠送成长值时机
|
||||
];
|
||||
$this->assign('config', $config);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function setTrading()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
if ($post) {
|
||||
ConfigServer::set('trading', 'order_cancel', $post['order_cancel']);
|
||||
ConfigServer::set('trading', 'customer_cancel_limit', $post['customer_cancel_limit']);
|
||||
ConfigServer::set('trading', 'order_finish', $post['order_finish']);
|
||||
ConfigServer::set('after_sale', 'refund_days', $post['refund_days']);
|
||||
ConfigServer::set('trading', 'deduct_type', $post['deduct_type']);//订单库存扣减方式
|
||||
ConfigServer::set('trading', 'growth_ratio', $post['growth_ratio']);//成长值比例
|
||||
ConfigServer::set('shop', 'contact', $post['contact']);//店铺联系人
|
||||
ConfigServer::set('shop', 'mobile', $post['mobile']);//店铺联系手机号
|
||||
ConfigServer::set('shop', 'province_id', $post['province_id']);//店铺省份id
|
||||
ConfigServer::set('shop', 'city_id', $post['city_id']);//店铺市id
|
||||
ConfigServer::set('shop', 'district_id', $post['district_id']);//店铺地区id
|
||||
ConfigServer::set('shop', 'address', $post['address']);//店铺详细地址
|
||||
ConfigServer::set('order_message', 'order_contact', $post['order_contact']);//订单管理联系人
|
||||
ConfigServer::set('order_message', 'order_contact_mobile', $post['order_contact_mobile']);//订单管理联系人手机
|
||||
|
||||
ConfigServer::set('trading', 'give_integral_scene', $post['give_integral_scene']);//赠送积分时机
|
||||
ConfigServer::set('trading', 'give_growth_scene', $post['give_growth_scene']);//赠送成长值时机
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 售后退款
|
||||
*/
|
||||
public function policy()
|
||||
{
|
||||
$config = [
|
||||
'service' => ConfigServer::get('policy', 'service'),
|
||||
'privacy' => ConfigServer::get('policy', 'privacy'),
|
||||
'after_sale' => ConfigServer::get('policy', 'after_sale'),
|
||||
|
||||
];
|
||||
$this->assign('config', $config);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function setPolicy()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
if ($post) {
|
||||
ConfigServer::set('policy', 'service', $post['service']);
|
||||
ConfigServer::set('policy', 'privacy', $post['privacy']);
|
||||
ConfigServer::set('policy', 'after_sale', $post['after_sale']);
|
||||
$this->_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),
|
||||
|
||||
];
|
||||
$this->assign('config', $config);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
public function setWithdraw()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
if(empty($post['type'])) {
|
||||
return $this->_error('至少选择一种提现方式');
|
||||
}
|
||||
if ($post['poundage'] > 100 || $post['poundage'] < 0) {
|
||||
return $this->_error('提现手续费须在0-100区间内');
|
||||
}
|
||||
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']);//微信零钱接口
|
||||
$this->_success('操作成功');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Notes: 注册设置
|
||||
* @author 段誉(2021/2/25 15:14)
|
||||
* @return mixed
|
||||
* @throws \think\Exception
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
* @throws \think\exception\PDOException
|
||||
*/
|
||||
public function setRegister()
|
||||
{
|
||||
if ($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
ConfigServer::set('register_setting', 'open', $post['open']);
|
||||
$this->_success('操作成功');
|
||||
}
|
||||
$config = ConfigServer::get('register_setting', 'open', 0);
|
||||
$this->assign('config', $config);
|
||||
return $this->fetch('register');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
<?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;
|
||||
|
||||
use app\admin\logic\SignDailyLogic;
|
||||
|
||||
/**
|
||||
* 天天签到
|
||||
* Class SignDaily
|
||||
* @package app\admin\controller
|
||||
*/
|
||||
class SignDaily extends AdminBase
|
||||
{
|
||||
|
||||
/**
|
||||
* 连续签到奖励列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$list = SignDailyLogic::lists($get);
|
||||
$this->_success('',$list);
|
||||
|
||||
|
||||
}
|
||||
|
||||
$config = SignDailyLogic::getSignRule();
|
||||
|
||||
$this->assign('config',$config);
|
||||
return $this->fetch();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 签到记录列表
|
||||
*/
|
||||
public function record()
|
||||
{
|
||||
if ($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
|
||||
$this->_success('',SignDailyLogic::record($get));
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加连续签到奖励
|
||||
* @return mixed
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$result =$this->validate($post,'app\admin\validate\SignDaily.add');
|
||||
if ($result === true){
|
||||
$post['integral_status'] = isset($post['integral_status']) && $post['integral_status'] =='on'?1:0;
|
||||
$post['growth_status'] = isset($post['growth_status']) && $post['growth_status'] =='on'?1:0;
|
||||
SignDailyLogic::add($post);
|
||||
$this ->success('添加成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
|
||||
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑连续签到奖励
|
||||
* @return mixed
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
if ($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post,'app\admin\validate\SignDaily.edit');
|
||||
if ($result === true){
|
||||
$post['integral_status'] = isset($post['integral_status']) && $post['integral_status'] == 'on'?1:0;
|
||||
$post['growth_status'] = isset($post['growth_status']) && $post['growth_status'] == 'on'?1:0;
|
||||
SignDailyLogic::edit($post,$id);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$info = SignDailyLogic::getSignDaily($id);
|
||||
$this->assign('info',$info);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除连续签到奖励
|
||||
* @return mixed
|
||||
*/
|
||||
public function del($id)
|
||||
{
|
||||
if ($this->request->isAjax()){
|
||||
SignDailyLogic::del($id);
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 签到规则说明设置
|
||||
* @throws \think\Exception
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
* @throws \think\exception\PDOException
|
||||
*/
|
||||
public function signRule()
|
||||
{
|
||||
if ($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post,'app\admin\validate\SignDaily.sign');
|
||||
if ($result === true){
|
||||
$post['integral_status'] = isset($post['integral_status']) && $post['integral_status'] =='on'?1:0;
|
||||
$post['growth_status'] = isset($post['growth_status']) && $post['growth_status'] =='on'?1:0;
|
||||
SignDailyLogic::setSignRule($post);
|
||||
$this ->success('保存成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?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;
|
||||
|
||||
|
||||
class Sites extends AdminBase
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return '网站设置';
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
use app\admin\logic\SmsLogic;
|
||||
use app\common\model\SmsLog;
|
||||
|
||||
class Sms extends AdminBase{
|
||||
|
||||
public function lists(){
|
||||
if($this->request->isAjax()){
|
||||
$list = SmsLogic::configLists();
|
||||
return $this->_success('',$list);
|
||||
}
|
||||
$status_list = SmsLog::getSendStatusDesc(true);
|
||||
$this->assign('status_list',$status_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function logLists(){
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$list = SmsLogic::logLists($get);
|
||||
return $this->_success('',$list);
|
||||
}
|
||||
}
|
||||
|
||||
public function config(){
|
||||
$id = $this->request->get('id');
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
SmsLogic::setConfig($post);
|
||||
return $this->_success('设置成功');
|
||||
}
|
||||
$info = SmsLogic::getConfig($id);
|
||||
$this->assign('info',$info);
|
||||
return $this->fetch();
|
||||
}
|
||||
public function detail(){
|
||||
$id = $this->request->get('id');
|
||||
$info = SmsLogic::detail($id);
|
||||
$this->assign('info',$info);
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
<?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;
|
||||
|
||||
use app\admin\logic\StatisticsLogic;
|
||||
|
||||
class Statistics extends AdminBase
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 获取会员统计数据
|
||||
* @return mixed
|
||||
* @author 段誉
|
||||
* @date 2022/4/27 10:51
|
||||
*/
|
||||
public function member()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$params = $this->request->get();
|
||||
$this->_success('', StatisticsLogic::getMemberData($params));
|
||||
}
|
||||
$this->assign('time', StatisticsLogic::getDateData());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 获取商品统计数据
|
||||
* @return mixed
|
||||
* @author 段誉
|
||||
* @date 2022/4/27 15:04
|
||||
*/
|
||||
public function goods()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$params = $this->request->get();
|
||||
$this->_success('', StatisticsLogic::getGoodsData($params));
|
||||
}
|
||||
$this->assign('time', StatisticsLogic::getDateData());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取交易数据
|
||||
* @return mixed
|
||||
* @author 段誉
|
||||
* @date 2022/4/27 15:33
|
||||
*/
|
||||
public function deal()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$params = $this->request->get();
|
||||
$this->_success('', StatisticsLogic::getDealData($params));
|
||||
}
|
||||
$this->assign('time', StatisticsLogic::getDateData());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取访问数据
|
||||
* @return mixed
|
||||
* @author 段誉
|
||||
* @date 2022/4/27 15:47
|
||||
*/
|
||||
public function visit()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$params = $this->request->get();
|
||||
$this->_success('', StatisticsLogic::getVisitData($params));
|
||||
}
|
||||
$this->assign('time', StatisticsLogic::getDateData());
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
<?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;
|
||||
|
||||
|
||||
use app\common\server\ConfigServer;
|
||||
|
||||
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' => '腾讯云COS',
|
||||
'path' => '存储在腾讯云,请前往腾讯云开通存储服务',
|
||||
'engine' => 'qcloud',
|
||||
'status' => $default == 'qcloud' ? 1 : 0
|
||||
]
|
||||
];
|
||||
$this->_success('获取成功', $data);
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 === '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) {
|
||||
$this->_error('设置失败:'.$e->getMessage());
|
||||
}
|
||||
$this->_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) {
|
||||
$this->_error('设置失败:'.$e->getMessage());
|
||||
}
|
||||
$this->_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) {
|
||||
$this->_error('设置失败:'.$e->getMessage());
|
||||
}
|
||||
$this->_success('设置成功');
|
||||
}
|
||||
|
||||
$this->_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://'
|
||||
])
|
||||
];
|
||||
|
||||
$this->assign('engine', $engine);
|
||||
$this->assign('storage', $storage);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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) {
|
||||
$this->_error('切换失败: ' . $e->getMessage());
|
||||
}
|
||||
$this->_success('切换成功');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
<?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;
|
||||
use app\admin\logic\SupplierLogic;
|
||||
|
||||
class Supplier extends AdminBase{
|
||||
/**
|
||||
*列表
|
||||
*/
|
||||
public function lists(){
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get(); //获取get请求
|
||||
$this->_success('', SupplierLogic::lists($get)); //逻辑层处理渲染数据
|
||||
}
|
||||
return $this->fetch(); //渲染
|
||||
}
|
||||
|
||||
/**
|
||||
*添加
|
||||
*/
|
||||
public function add(){
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\Supplier'); //验证信息
|
||||
if($result=== true){
|
||||
SupplierLogic::add($post); //逻辑层处理添加数据
|
||||
$this->_success('添加成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
return $this->fetch(); //渲染
|
||||
}
|
||||
|
||||
/**
|
||||
*编辑
|
||||
*/
|
||||
public function edit($id = ''){
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\Supplier'); //验证信息
|
||||
if($result=== true){
|
||||
SupplierLogic::edit($post); //逻辑层处理添加数据
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->assign('info', SupplierLogic::info($id)); //逻辑层处理数据,返回已有信息
|
||||
return $this->fetch(); //渲染
|
||||
}
|
||||
|
||||
/**
|
||||
*删除
|
||||
*/
|
||||
public function del($id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$result = SupplierLogic::del($id); //逻辑层处理删除信息
|
||||
if ($result) {
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error('删除失败');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
<?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;
|
||||
|
||||
use app\admin\logic\TeamActivityLogic;
|
||||
use app\common\model\Team;
|
||||
use think\helper\Time;
|
||||
|
||||
/**
|
||||
* 拼团商品管理 - 控制器
|
||||
* Class TeamActivity
|
||||
* @package app\admin\controller
|
||||
*/
|
||||
class TeamActivity extends AdminBase
|
||||
{
|
||||
/**
|
||||
* Notes: 列表
|
||||
* @author 张无忌(2021/1/12 15:51)
|
||||
* @return mixed
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = TeamActivityLogic::lists($get);
|
||||
$this->_success('获取成功', $lists);
|
||||
}
|
||||
|
||||
return $this->fetch('team_activity/lists');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 添加
|
||||
* @author 张无忌(2021/1/12 15:52)
|
||||
* @return mixed
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$check = $this->validate($post, 'app\admin\validate\TeamActivity.add');
|
||||
if ($check !== true) {
|
||||
$this->_error($check);
|
||||
}
|
||||
if (TeamActivityLogic::add($post)) {
|
||||
$this->_success('新增成功');
|
||||
} else {
|
||||
$error = TeamActivityLogic::getError() ?? '新增失败';
|
||||
$this->_error($error);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->fetch('team_activity/add');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 编辑
|
||||
* @author 张无忌(2021/1/12 15:52)
|
||||
* @return mixed
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$check = $this->validate($post, 'app\admin\validate\TeamActivity');
|
||||
if ($check !== true) {
|
||||
$this->_error($check);
|
||||
}
|
||||
if (TeamActivityLogic::edit($post)) {
|
||||
$this->_success('更新成功');
|
||||
} else {
|
||||
$error = TeamActivityLogic::getError() ?? '更新失败';
|
||||
$this->_error($error);
|
||||
}
|
||||
}
|
||||
|
||||
$id = $this->request->get('id');
|
||||
$this->assign('detail', TeamActivityLogic::getDetail($id));
|
||||
return $this->fetch('team_activity/edit');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 删除
|
||||
* @author 张无忌(2021/1/12 15:52)
|
||||
* @return mixed
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$id = $this->request->post('id');
|
||||
if (TeamActivityLogic::softDelete($id)) {
|
||||
$this->_success('删除成功');
|
||||
} else {
|
||||
$error = TeamActivityLogic::getError() ?? '删除失败';
|
||||
$this->_error($error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 切换状态
|
||||
* @author 张无忌(2021/1/13 18:01)
|
||||
*/
|
||||
public function switchStatus()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
if (TeamActivityLogic::switchStatus($post)) {
|
||||
$this->_success('更新成功');
|
||||
} else {
|
||||
$error = TeamActivityLogic::getError() ?? '更新失败';
|
||||
$this->_error($error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 参团订单
|
||||
* @author 张无忌(2021/1/13 18:21)
|
||||
*/
|
||||
public function teamOrder()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = TeamActivityLogic::teamOrder($get);
|
||||
$this->_success('获取成功', $lists);
|
||||
}
|
||||
|
||||
$team_id = $this->request->get('id', 0, 'intval');
|
||||
$this->assign('team_id', $team_id);
|
||||
$this->assign('team_status', Team::getStatusDesc(true));
|
||||
return $this->fetch('team_activity/team_order');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
<?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;
|
||||
|
||||
|
||||
use app\admin\logic\TeamFoundLogic;
|
||||
use app\common\model\Team;
|
||||
use think\helper\Time;
|
||||
|
||||
class TeamFound extends AdminBase
|
||||
{
|
||||
/**
|
||||
* Notes: 列表
|
||||
* @author 张无忌(2021/1/15 17:24)
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = TeamFoundLogic::lists($get);
|
||||
$this->_success('获取成功', $lists);
|
||||
}
|
||||
|
||||
$days_ago7 = array_map(function ($time) {
|
||||
return date('Y-m-d H:i:s', $time);
|
||||
}, Time::dayToNow(7));
|
||||
$days_ago30 = array_map(function ($time) {
|
||||
return date('Y-m-d H:i:s', $time);
|
||||
}, Time::dayToNow(30, true));
|
||||
|
||||
$this->assign('days_ago7', $days_ago7);
|
||||
$this->assign('days_ago30', $days_ago30);
|
||||
$this->assign('team_status', Team::getStatusDesc(true));
|
||||
return $this->fetch('team_found/lists');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 拼团详细
|
||||
* @author 张无忌(2021/1/15 17:24)
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = TeamFoundLogic::teamOrderListById($get);
|
||||
$this->_success('获取成功', $lists);
|
||||
}
|
||||
|
||||
$found_id = $this->request->get('found_id', 0, 'intval');
|
||||
$this->assign('found_id', $found_id);
|
||||
$this->assign('detail', TeamFoundLogic::getDetail($found_id));
|
||||
return $this->fetch('team_found/detail');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 退款列表
|
||||
* @author 张无忌(2021/1/19 9:55)
|
||||
* @return mixed
|
||||
*/
|
||||
public function refundDetail()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = TeamFoundLogic::getRefundDetail($get);
|
||||
$this->_success('获取成功', $lists);
|
||||
}
|
||||
|
||||
$found_id = $this->request->get('found_id', 0, 'intval');
|
||||
$this->assign('found_id', $found_id);
|
||||
return $this->fetch('team_found/refund');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 实现-原路退款
|
||||
* @author 张无忌(2021/1/18 17:43)
|
||||
*/
|
||||
public function handlerRefund()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
if (TeamFoundLogic::handleRefund($post, $this->admin_id)) {
|
||||
$this->_success('退款成功');
|
||||
}
|
||||
$error = TeamFoundLogic::getError() ?: '退款失败';
|
||||
$this->_error($error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?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;
|
||||
|
||||
|
||||
use app\common\server\ConfigServer;
|
||||
|
||||
/**
|
||||
* 拼团设置
|
||||
* Class TeamSet
|
||||
* @package app\admin\controller
|
||||
*/
|
||||
class TeamSet extends AdminBase
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$automatic = ConfigServer::get('team', 'automatic', 0);
|
||||
$this->assign('automatic', $automatic);
|
||||
return $this->fetch('team_set/index');
|
||||
}
|
||||
|
||||
public function set()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$automatic = $this->request->post('automatic', 0, 'intval');
|
||||
ConfigServer::set('team', 'automatic', $automatic);
|
||||
$this->_success('设置成功');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,218 @@
|
||||
<?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;
|
||||
|
||||
|
||||
use app\admin\logic\UserLogic;
|
||||
use app\common\server\ConfigServer;
|
||||
|
||||
class User extends AdminBase
|
||||
{
|
||||
/**
|
||||
* 会员列表
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function lists(){
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$this->_success('', UserLogic::lists($get));
|
||||
|
||||
}
|
||||
$this->assign('level_list',UserLogic::getLevelList());
|
||||
$this->assign('group_list',UserLogic::getGroupList());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出
|
||||
*/
|
||||
public function exportFile()
|
||||
{
|
||||
$get = $this->request->get();
|
||||
$this->_success('', UserLogic::exportFile($get));
|
||||
}
|
||||
|
||||
/*
|
||||
* 设置分组
|
||||
*/
|
||||
public function setGroup(){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
UserLogic::setGroup($post);
|
||||
$this->_success('设置成功','');
|
||||
}
|
||||
$this->assign('group_list',UserLogic::getGroupList());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 账户调整
|
||||
* @param $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function adjustAccount($id){
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post,'app\admin\validate\AdjustAccount');
|
||||
if($result === true){
|
||||
$result = UserLogic::adjustAccount($post); //逻辑层处理信息
|
||||
if($result){
|
||||
$this->_success('操作成功',$result);
|
||||
}
|
||||
$result = '操作失败';
|
||||
}
|
||||
$this->_error($result);
|
||||
|
||||
}
|
||||
$this->assign('info',UserLogic::getUser($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/*
|
||||
* 等级调整
|
||||
*/
|
||||
public function adjustLevel($id){
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post,'app\admin\validate\AdjustUserLevel');
|
||||
if($result === true){
|
||||
$result = UserLogic::adjustLevel($post); //逻辑层处理信息
|
||||
if($result){
|
||||
$this->_success('操作成功',$result);
|
||||
}
|
||||
$result = '操作失败';
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->assign('info',UserLogic::getInfo($id));
|
||||
$this->assign('user_level',UserLogic::getLevelList());
|
||||
return $this->fetch();
|
||||
|
||||
}
|
||||
/*
|
||||
* 会员编辑
|
||||
*/
|
||||
public function edit($id){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post,'app\admin\validate\User');
|
||||
if($result === true){
|
||||
UserLogic::edit($post);
|
||||
$this->_success('保存成功');
|
||||
}
|
||||
return $this->_error($result);
|
||||
}
|
||||
$detail = UserLogic::getUser($id,true);
|
||||
$this->assign('info',$detail);
|
||||
return $this->fetch();
|
||||
}
|
||||
/*
|
||||
* 会员详情
|
||||
*/
|
||||
public function infoOld($id){
|
||||
$detail = UserLogic::getUser($id,false,true);
|
||||
$this->assign('detail',$detail);
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function info(){
|
||||
$id = $this->request->get('id', '', 'intval');
|
||||
$detail = UserLogic::getInfo($id);
|
||||
return view('', [
|
||||
'detail' => $detail
|
||||
]);
|
||||
}
|
||||
|
||||
public function getList(){
|
||||
$post = $this->request->get('');
|
||||
$list = UserLogic::getList($post);
|
||||
$this->_success('',$list);
|
||||
}
|
||||
public function sendCouponList(){
|
||||
if($this->request->isAjax()){
|
||||
$list = UserLogic::sendCouponList();
|
||||
$this->_success('',$list);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function fans()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$result = UserLogic::fans($params);
|
||||
return $this->_success('', $result);
|
||||
}
|
||||
|
||||
$id = $this->request->get('id/d');
|
||||
return view('', ['id' => $id]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转账记录
|
||||
*/
|
||||
public function transferRecord()
|
||||
{
|
||||
if($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$get['page'] = $get['page'] ?? $this->page_no;
|
||||
$get['limit'] = $get['limit'] ?? $this->page_size;
|
||||
$data = UserLogic::transferRecord($get);
|
||||
$this->_success('', $data);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function adjustFirstLeader()
|
||||
{
|
||||
if($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$result = UserLogic::adjustFirstLeader($params);
|
||||
if ($result) {
|
||||
return $this->_success('调整成功');
|
||||
}
|
||||
return $this->_error(UserLogic::getError());
|
||||
}
|
||||
|
||||
$id = $this->request->get('id/d');
|
||||
$user = \app\common\model\User::field('id,sn,nickname,first_leader')->findOrEmpty($id)->toArray();
|
||||
$firstLeader = \app\common\model\User::getUserInfo($user['first_leader']);
|
||||
return view('', [
|
||||
'user_id' => $id,
|
||||
'user' => $user,
|
||||
'first_leader' => $firstLeader
|
||||
]);
|
||||
}
|
||||
|
||||
public function userLists()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$lists = UserLogic::userLists($params);
|
||||
return $this->_success('', $lists);
|
||||
}
|
||||
return view();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
<?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;
|
||||
|
||||
|
||||
use app\admin\logic\UserGroupLogic;
|
||||
|
||||
class UserGroup extends AdminBase
|
||||
{
|
||||
|
||||
/**
|
||||
* 用户分组列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function lists(){
|
||||
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get(); //获取get请求
|
||||
$this->_success('', UserGroupLogic::lists($get)); //逻辑层处理渲染数据
|
||||
}
|
||||
return $this->fetch(); //渲染
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @return mixed
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\UserGroup.add');
|
||||
if ($result === true) {
|
||||
UserGroupLogic::addUserGroup($post);
|
||||
$this->_success('添加成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param string $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\UserGroup.edit');
|
||||
if ($result === true) {
|
||||
UserGroupLogic::editUserGroup($post);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->assign('info', UserGroupLogic::info($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param $id
|
||||
*/
|
||||
public function del($id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$result = $this->validate(['id'=>$id], 'app\admin\validate\UserGroup.del');
|
||||
if($result === true) {
|
||||
UserGroupLogic::delUserGroup($id);
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
<?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;
|
||||
use app\admin\logic\UserLevelLogic;
|
||||
use app\admin\logic\UserLogic;
|
||||
|
||||
class UserLevel extends AdminBase{
|
||||
/**
|
||||
* note 会员列表
|
||||
* create_time 2020/12/15 11:45
|
||||
*/
|
||||
public function lists(){
|
||||
$get = $this->request->get();
|
||||
if($this->request->isAjax()){
|
||||
$lists = UserLevelLogic::lists($get);
|
||||
$this->_success('',$lists);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 添加会员
|
||||
* create_time 2020/12/15 11:45
|
||||
*/
|
||||
public function add(){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post,'app\admin\validate\UserLevel.add');
|
||||
if($result === true){
|
||||
$result = UserLevelLogic::add($post);
|
||||
if($result){
|
||||
$this->_success('添加成功','');
|
||||
}
|
||||
$result = '添加失败';
|
||||
}
|
||||
$this->_error($result);
|
||||
|
||||
}
|
||||
$this->assign('privilege_list',UserLevelLogic::getPrivilegeList());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 会员编辑
|
||||
* create_time 2020/12/15 11:45
|
||||
*/
|
||||
public function edit($id){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post,'app\admin\validate\UserLevel');
|
||||
if($result === true){
|
||||
$result = UserLevelLogic::edit($post);
|
||||
if($result){
|
||||
$this->_success('添加成功','');
|
||||
}
|
||||
$result = '添加失败';
|
||||
}
|
||||
$this->_error($result);
|
||||
|
||||
}
|
||||
$detail = UserLevelLogic::getUserLevel($id);
|
||||
$this->assign('privilege_list',UserLevelLogic::getPrivilegeList());
|
||||
$this->assign('detail',$detail);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 会员删除
|
||||
* create_time 2020/12/15 11:44
|
||||
*/
|
||||
public function del($id){
|
||||
if($this->request->isAjax()){
|
||||
$result = $this->validate(['id'=>$id],'app\admin\validate\UserLevel.del');
|
||||
if($result === true){
|
||||
UserLevelLogic::del($id);
|
||||
$this->_success('删除成功','');
|
||||
}
|
||||
$this->_error($result,'');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
<?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;
|
||||
use app\admin\logic\UserPrivilegeLogic;
|
||||
class UserPrivilege extends AdminBase{
|
||||
/**
|
||||
* note 权益列表
|
||||
* create_time 2020/12/2 11:04
|
||||
*/
|
||||
public function lists(){
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$list = UserPrivilegeLogic::lists($get);
|
||||
$this->_success('',$list);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* note 添加权益
|
||||
* create_time 2020/12/2 11:04
|
||||
*/
|
||||
public function add(){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post,'app\admin\validate\UserPrivilege.add');
|
||||
if($result === true){
|
||||
UserPrivilegeLogic::add($post);
|
||||
$this->_success('添加成功',[]);
|
||||
}
|
||||
$this->_error($result,[]);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 编辑权益
|
||||
* create_time 2020/12/2 11:40
|
||||
*/
|
||||
public function edit($id){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post,'app\admin\validate\UserPrivilege.edit');
|
||||
if($result === true){
|
||||
UserPrivilegeLogic::edit($post);
|
||||
$this->_success('添加成功',[]);
|
||||
}
|
||||
$this->_error($result,[]);
|
||||
}
|
||||
|
||||
$this->assign('detail',UserPrivilegeLogic::getPrivilege($id));
|
||||
return $this->fetch();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* note 删除权益
|
||||
* create_time 2020/12/2 11:40
|
||||
*/
|
||||
public function del($id){
|
||||
if($this->request->isAjax()){
|
||||
$result = $this->validate(['id'=>$id],'app\admin\validate\UserPrivilege.del');
|
||||
if($result === true){
|
||||
UserPrivilegeLogic::del($id);
|
||||
$this->_success('删除成功','');
|
||||
}
|
||||
$this->_error($result,'');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
<?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;
|
||||
|
||||
use app\admin\logic\UserSettingLogic;
|
||||
|
||||
/**
|
||||
* 用户设置
|
||||
* Class User
|
||||
* @package app\admin\controller\setting
|
||||
*/
|
||||
class UserSetting extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes 用户设置
|
||||
* @return \think\response\View
|
||||
* @author Tab
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$config = UserSettingLogic::getConfig();
|
||||
return view('', ['config' => $config,'user_level'=>UserSettingLogic::getUserLevel()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 用户设置
|
||||
* @return \think\response\Json
|
||||
* @author Tab
|
||||
*/
|
||||
public function set()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$result = UserSettingLogic::set($params);
|
||||
if($result) {
|
||||
return $this->_success('保存成功');
|
||||
}
|
||||
return $this->_error(UserSettingLogic::getError());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
<?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;
|
||||
|
||||
|
||||
use app\admin\logic\VerificationLogic;
|
||||
use app\common\model\Client_;
|
||||
use app\common\model\Order as CommonOrder;
|
||||
use app\common\model\Pay;
|
||||
|
||||
class Verification extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes 自提订单列表
|
||||
* @return mixed
|
||||
* @author ljj
|
||||
* @date 2021/8/16 6:10 下午
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$params = $this->request->get();
|
||||
$params['admin_name'] = $this->admin_info['name'];
|
||||
$this->_success('', VerificationLogic::lists($params));
|
||||
}
|
||||
$this->assign('order_type', CommonOrder::getOrderType(true));
|
||||
$this->assign('pay_way', Pay::getPayWay(true));
|
||||
$this->assign('order_source', Client_::getClient(true));
|
||||
$this->assign('verification_status', CommonOrder::getVerificationStatus(true));
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 导出自提订单列表
|
||||
* @author ljj
|
||||
* @date 2021/8/16 7:55 下午
|
||||
*/
|
||||
public function exportFile()
|
||||
{
|
||||
$params = $this->request->get();
|
||||
$params['admin_name'] = $this->admin_info['name'];
|
||||
$this->_success('', VerificationLogic::exportFile($params));
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 提货核销
|
||||
* @param $id
|
||||
* @return mixed
|
||||
* @author ljj
|
||||
* @date 2021/8/17 10:09 上午
|
||||
*/
|
||||
public function verification($id)
|
||||
{
|
||||
if ($this->request->isAjax() && $this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$params['admin_info'] = $this->admin_info;
|
||||
$result = $this->validate($params, 'app\admin\validate\Verification.verification');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
$result = VerificationLogic::verification($params);
|
||||
if ($result !== true) {
|
||||
$this->_error('核销失败:' . $result);
|
||||
}
|
||||
$this->_success('核销成功');
|
||||
}
|
||||
|
||||
$this->assign('detail', VerificationLogic::verificationInfo($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 核销查询
|
||||
* @param $id
|
||||
* @return mixed
|
||||
* @author ljj
|
||||
* @date 2021/8/17 11:47 上午
|
||||
*/
|
||||
public function verificationQuery($id)
|
||||
{
|
||||
$this->assign('detail', VerificationLogic::verificationQuery($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
<?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;
|
||||
use app\admin\logic\CommonLogic;
|
||||
use app\admin\logic\WechatReplyLogic;
|
||||
use app\common\model\WeChat;
|
||||
|
||||
class WechatReply extends AdminBase{
|
||||
public function lists(){
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$list = WechatReplyLogic::lists($get);
|
||||
$this->_success('',$list);
|
||||
|
||||
}
|
||||
$type_list= Wechat::getCustomReply();
|
||||
$this->assign('type_list',$type_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
public function add(){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post,'app\admin\validate\WeChatReply.'.$post['reply_type']);
|
||||
|
||||
if ($result === true){
|
||||
WechatReplyLogic::add($post);
|
||||
$this->_success('添加超过',[]);
|
||||
}
|
||||
$this->_error($result);
|
||||
|
||||
}
|
||||
$type = $this->request->get('type');
|
||||
$template = 'add_'.$type;
|
||||
return $this->fetch($template);
|
||||
}
|
||||
|
||||
public function edit($id){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post,'app\admin\validate\WeChatReply.'.$post['reply_type']);
|
||||
|
||||
if ($result === true){
|
||||
WechatReplyLogic::edit($post);
|
||||
$this->_success('添加超过',[]);
|
||||
}
|
||||
$this->_error($result);
|
||||
|
||||
}
|
||||
$detail = WechatReplyLogic::getReply($id);
|
||||
$this->assign('detail',$detail);
|
||||
$template = 'edit_'.$detail['reply_type'];
|
||||
return $this->fetch($template);
|
||||
|
||||
}
|
||||
public function del($id){
|
||||
$result = $this->validate(['id'=>$id],'app\admin\validate\WeChatReply.del');
|
||||
if ($result === true) {
|
||||
WechatReplyLogic::del($id);
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* 修改字段
|
||||
*/
|
||||
public function changeFields(){
|
||||
$pk_value = $this->request->post('id');
|
||||
$field = $this->request->post('field');
|
||||
$field_value = $this->request->post('value');
|
||||
$reply_type = $this->request->post('reply_type');
|
||||
$result = WechatReplyLogic::changeFields($pk_value, $field, $field_value,$reply_type);
|
||||
if ($result) {
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error('修改失败');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
<?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;
|
||||
|
||||
use app\admin\logic\WithdrawLogic;
|
||||
use app\common\model\Withdraw as WithdrawModel;
|
||||
use think\helper\Time;
|
||||
use app\admin\logic\WechatCorporatePaymentLogic;
|
||||
|
||||
class Withdraw extends AdminBase
|
||||
{
|
||||
|
||||
/**
|
||||
* 提现列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
return $this->_success('获取列表成功', WithdrawLogic::lists($get));
|
||||
}
|
||||
|
||||
$this->assign('type', WithdrawModel::getTypeDesc(true));
|
||||
$this->assign('status', WithdrawModel::getStatusDesc(true));
|
||||
|
||||
$today = array_map(function ($time) {
|
||||
return date('Y-m-d H:i:s', $time);
|
||||
}, Time::today());
|
||||
$this->assign('today', $today);
|
||||
|
||||
$yesterday = array_map(function ($time) {
|
||||
return date('Y-m-d H:i:s', $time);
|
||||
}, Time::yesterday());
|
||||
$this->assign('yesterday', $yesterday);
|
||||
|
||||
|
||||
$days_ago7 = array_map(function ($time) {
|
||||
return date('Y-m-d H:i:s', $time);
|
||||
}, Time::dayToNow(7));
|
||||
$this->assign('days_ago7', $days_ago7);
|
||||
|
||||
$days_ago30 = array_map(function ($time) {
|
||||
return date('Y-m-d H:i:s', $time);
|
||||
}, Time::dayToNow(30, true));
|
||||
$this->assign('days_ago30', $days_ago30);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Desc: 审核通过
|
||||
*/
|
||||
public function confirm()
|
||||
{
|
||||
if ($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$result = WithdrawLogic::confirm($post);
|
||||
if($result['code']) {
|
||||
return $this->_success($result['msg']);
|
||||
}else{
|
||||
return $this->_error($result['msg']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Desc: 审核拒绝
|
||||
*/
|
||||
public function refuse()
|
||||
{
|
||||
if ($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
WithdrawLogic::refuse($post);
|
||||
$this->_success('已拒绝提现');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 提现详情
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$id = $this->request->get('id', '', 'intval');
|
||||
$detail = WithdrawLogic::detail($id);
|
||||
$this->assign('detail', $detail);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示提现审核界面
|
||||
*/
|
||||
public function review()
|
||||
{
|
||||
$id = $this->request->get('id', '', 'intval');
|
||||
$this->assign('id', $id);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示提现转账界面
|
||||
*/
|
||||
public function transfer()
|
||||
{
|
||||
$id = $this->request->get('id', '', 'intval');
|
||||
$this->assign('id', $id);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 转账失败
|
||||
*/
|
||||
public function transferFail()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
$result = WithdrawLogic::transferFail($post);
|
||||
if($result['code']) {
|
||||
return $this->_success($result['msg']);
|
||||
}else{
|
||||
return $this->_error($result['msg']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 转账成功
|
||||
*/
|
||||
public function transferSuccess()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
$result = WithdrawLogic::transferSuccess($post);
|
||||
if($result['code']) {
|
||||
return $this->_success($result['msg']);
|
||||
}else{
|
||||
return $this->_error($result['msg']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 提现结果查询
|
||||
*/
|
||||
public function search()
|
||||
{
|
||||
$id = $this->request->post('id', '', 'intval');
|
||||
$result = WithdrawLogic::search($id);
|
||||
if($result['code']) {
|
||||
return $this->_success($result['msg']);
|
||||
}else{
|
||||
return $this->_error($result['msg']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 提现失败
|
||||
*/
|
||||
public function withdrawFailed() {
|
||||
$id = $this->request->post('id', '', 'intval');
|
||||
$result = WithdrawLogic::withdrawFailed($id);
|
||||
$this->_success('提现失败已回退佣金');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?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\http\middleware;
|
||||
|
||||
use app\admin\cache\RoleNoneAuthCacheUris;
|
||||
|
||||
class Auth
|
||||
{
|
||||
/**
|
||||
* 权限控制
|
||||
* @param $request
|
||||
* @param \Closure $next
|
||||
* @return mixed|\think\response\Redirect
|
||||
*/
|
||||
public function handle($request, \Closure $next)
|
||||
{
|
||||
|
||||
//未登录的无需权限控制
|
||||
if (empty(session('admin_info'))) {
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
//如果id为1,视为系统超级管理,无需权限控制
|
||||
if (session('admin_info.id') == 1) {
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
//权限控制判断
|
||||
$controller_action = $request->controller() . '/' . $request->action();////当前访问
|
||||
$controller_action = strtolower($controller_action);
|
||||
$auth_cache = new RoleNoneAuthCacheUris(session('admin_info.role_id'), ['role_id' => session('admin_info.role_id')]);
|
||||
$none_auth = $auth_cache->set(3600);
|
||||
if (empty($none_auth) || !in_array($controller_action, $none_auth)) {
|
||||
//通过权限控制
|
||||
return $next($request);
|
||||
}
|
||||
return redirect('dispatch/dispatch_error',['msg' => '权限不足,无法访问']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
<?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\http\middleware;
|
||||
|
||||
|
||||
use app\admin\logic\LoginLogic;
|
||||
use app\admin\server\LoginServer;
|
||||
|
||||
class Login
|
||||
{
|
||||
/**
|
||||
* 登录验证
|
||||
* @param $request
|
||||
* @param \Closure $next
|
||||
* @return mixed|\think\response\Redirect
|
||||
*/
|
||||
public function handle($request, \Closure $next)
|
||||
{
|
||||
//已登录的访问登录页
|
||||
if (session('admin_info') && !$this->isNotNeedLogin($request)) {
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
//已登录的访问非登录页
|
||||
if (session('admin_info') && $this->isNotNeedLogin($request)) {
|
||||
return redirect('index/index');
|
||||
}
|
||||
|
||||
//未登录的访问非登录页
|
||||
if (!session('admin_info') && $this->isNotNeedLogin($request)) {
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
//未登录访问登录页
|
||||
return redirect('account/login');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 是否免登录验证
|
||||
* @param $request
|
||||
* @return bool
|
||||
*/
|
||||
private function isNotNeedLogin($request)
|
||||
{
|
||||
$data = app()->controller($request->controller())->like_not_need_login;
|
||||
if (empty($data)) {
|
||||
return false;
|
||||
}
|
||||
$action = strtolower($request->action());
|
||||
$data = array_map('strtolower', $data);
|
||||
if (!in_array($action, $data)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user