其余文件
This commit is contained in:
103
app/admin/controller/shop/Apply.php
Normal file
103
app/admin/controller/shop/Apply.php
Normal file
@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\admin\controller\shop;
|
||||
|
||||
|
||||
use app\admin\logic\shop\ApplyLogic;
|
||||
use app\admin\validate\shop\ShopApplyValidate;
|
||||
use app\common\basics\AdminBase;
|
||||
use app\common\server\JsonServer;
|
||||
|
||||
/**
|
||||
* 商家入驻
|
||||
* Class Apply
|
||||
* @package app\admin\controller\shop
|
||||
*/
|
||||
class Apply extends AdminBase
|
||||
{
|
||||
/**
|
||||
* NOTE: 申请列表
|
||||
* @author: 张无忌
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = ApplyLogic::lists($get);
|
||||
return JsonServer::success('获取成功', $lists);
|
||||
}
|
||||
|
||||
return view('', [
|
||||
'totalCount' => ApplyLogic::totalCount()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* NOTE: 统计
|
||||
* @author: 张无忌
|
||||
*/
|
||||
public function totalCount()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
return JsonServer::success('获取成功', ApplyLogic::totalCount());
|
||||
}
|
||||
|
||||
return JsonServer::error('请求异常');
|
||||
}
|
||||
|
||||
/**
|
||||
* NOTE: 详细
|
||||
* @author: 张无忌
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
(new ShopApplyValidate())->goCheck('id');
|
||||
$id = $this->request->get('id');
|
||||
return view('', [
|
||||
'detail' => ApplyLogic::detail($id)
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* NOTE: 审核
|
||||
* @author: 张无忌
|
||||
*/
|
||||
public function audit()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
(new ShopApplyValidate())->goCheck('audit');
|
||||
$post = $this->request->post();
|
||||
$res = ApplyLogic::audit($post);
|
||||
if ($res) {
|
||||
return JsonServer::success('操作成功');
|
||||
}
|
||||
|
||||
$error = ApplyLogic::getError() ?: '操作失败';
|
||||
return JsonServer::error($error);
|
||||
}
|
||||
|
||||
return view();
|
||||
}
|
||||
|
||||
/**
|
||||
* NOTE: 删除
|
||||
* @author: 张无忌
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
(new ShopApplyValidate())->goCheck('id');
|
||||
$id = $this->request->post('id');
|
||||
$res = ApplyLogic::del($id);
|
||||
if ($res) {
|
||||
return JsonServer::success('删除成功');
|
||||
}
|
||||
|
||||
$error = ApplyLogic::getError() ?: '删除失败';
|
||||
return JsonServer::error($error);
|
||||
}
|
||||
|
||||
return JsonServer::error('请求异常');
|
||||
}
|
||||
}
|
||||
137
app/admin/controller/shop/Auth.php
Normal file
137
app/admin/controller/shop/Auth.php
Normal file
@ -0,0 +1,137 @@
|
||||
<?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\shop;
|
||||
|
||||
|
||||
use app\admin\validate\ShopAuthValidate;
|
||||
use app\admin\logic\shop\AuthLogic;
|
||||
use app\common\basics\AdminBase;
|
||||
use app\common\server\JsonServer;
|
||||
|
||||
/**
|
||||
* 商家菜单
|
||||
* Class Auth
|
||||
* @package app\admin\controller\shop
|
||||
*/
|
||||
class Auth extends AdminBase
|
||||
{
|
||||
/**
|
||||
* Notes: 列表
|
||||
* @author 段誉(2021/4/10 16:44)
|
||||
* @return string|\think\response\Json
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if($this->request->isAjax()) {
|
||||
$data = AuthLogic::lists();
|
||||
return json(['code' => 0, 'msg' => '列表', 'data' => json_encode($data)]);
|
||||
}
|
||||
return view();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Notes: 添加
|
||||
* @author 段誉(2021/4/12 16:43)
|
||||
* @return string|\think\response\Json
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['disable'] = isset($post['disable']) && $post['disable'] == 'on' ? 0 : 1;
|
||||
(new ShopAuthValidate())->goCheck();
|
||||
$result = AuthLogic::addMenu($post);
|
||||
if (false === $result) {
|
||||
return JsonServer::error(AuthLogic::getError() ?: '操作失败');
|
||||
}
|
||||
return JsonServer::success('操作成功');
|
||||
}
|
||||
return view('', ['menu_lists' => AuthLogic::chooseMenu()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 编辑
|
||||
* @author 段誉(2021/4/12 16:43)
|
||||
* @return string|\think\response\Json
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$id = $this->request->get('id');
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['disable'] = isset($post['disable']) && $post['disable'] == 'on' ? 0 : 1;
|
||||
(new ShopAuthValidate())->goCheck();
|
||||
if (false === AuthLogic::editMenu($post)) {
|
||||
return JsonServer::error(AuthLogic::getError() ?: '操作失败');
|
||||
}
|
||||
return JsonServer::success('操作成功');
|
||||
}
|
||||
return view('', [
|
||||
'detail' => AuthLogic::detail($id),
|
||||
'menu_lists' => AuthLogic::chooseMenu()
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Notes: 删除
|
||||
* @author 段誉(2021/4/12 16:43)
|
||||
* @return \think\response\Json
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
if (empty($post['ids'])) {
|
||||
return JsonServer::error(AuthLogic::getError() ?: '操作失败');
|
||||
}
|
||||
AuthLogic::delMenu($post['ids']);
|
||||
return JsonServer::success('操作成功');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Notes: 设置
|
||||
* @author 段誉(2021/4/12 16:43)
|
||||
*/
|
||||
public function status()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
AuthLogic::setStatus($post);
|
||||
return JsonServer::success('操作成功');
|
||||
}
|
||||
}
|
||||
}
|
||||
114
app/admin/controller/shop/Category.php
Normal file
114
app/admin/controller/shop/Category.php
Normal file
@ -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\shop;
|
||||
|
||||
|
||||
use app\admin\logic\shop\CategoryLogic;
|
||||
use app\common\basics\AdminBase;
|
||||
use app\common\server\JsonServer;
|
||||
|
||||
/**
|
||||
* 主营类目
|
||||
* Class Category
|
||||
* @package app\admin\controller\shop
|
||||
*/
|
||||
class Category extends AdminBase
|
||||
{
|
||||
/**
|
||||
* NOTE: 主营类目列表
|
||||
* @author: 张无忌
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = CategoryLogic::lists($get);
|
||||
return JsonServer::success('获取成功', $lists);
|
||||
}
|
||||
|
||||
return view();
|
||||
}
|
||||
|
||||
/**
|
||||
* NOTE: 新增主营类目
|
||||
* @author: 张无忌
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
if(!isset($post['image']) || empty($post['image'])) {
|
||||
return JsonServer::error('类目图标不能为空');
|
||||
}
|
||||
$res = CategoryLogic::add($post);
|
||||
if ($res === false) {
|
||||
$error = CategoryLogic::getError() ?: '新增失败';
|
||||
return JsonServer::error($error);
|
||||
}
|
||||
return JsonServer::success('新增成功');
|
||||
}
|
||||
|
||||
return view();
|
||||
}
|
||||
|
||||
/**
|
||||
* NOTE: 编辑主营类目
|
||||
* @author: 张无忌
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
if(!isset($post['image']) || empty($post['image'])) {
|
||||
return JsonServer::error('类目图标不能为空');
|
||||
}
|
||||
$res = CategoryLogic::edit($post);
|
||||
if ($res === false) {
|
||||
$error = CategoryLogic::getError() ?: '编辑失败';
|
||||
return JsonServer::error($error);
|
||||
}
|
||||
return JsonServer::success('编辑成功');
|
||||
}
|
||||
|
||||
$id = $this->request->get('id');
|
||||
return view('', [
|
||||
'detail' => CategoryLogic::detail($id)
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* NOTE: 删除主营类目
|
||||
* @author: 张无忌
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$id = $this->request->post('id');
|
||||
$res = CategoryLogic::del($id);
|
||||
if ($res === false) {
|
||||
$error = CategoryLogic::getError() ?: '删除失败';
|
||||
return JsonServer::error($error);
|
||||
}
|
||||
return JsonServer::success('删除成功');
|
||||
}
|
||||
|
||||
return JsonServer::error('请求异常');
|
||||
}
|
||||
}
|
||||
162
app/admin/controller/shop/Store.php
Normal file
162
app/admin/controller/shop/Store.php
Normal file
@ -0,0 +1,162 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\admin\controller\shop;
|
||||
|
||||
|
||||
use app\admin\logic\shop\CategoryLogic;
|
||||
use app\admin\logic\shop\StoreLogic;
|
||||
use app\admin\validate\shop\StoreLValidate;
|
||||
use app\admin\validate\shop\StoreStatusValidate;
|
||||
use app\common\basics\AdminBase;
|
||||
use app\common\server\ConfigServer;
|
||||
use app\common\server\JsonServer;
|
||||
use think\facade\Log;
|
||||
|
||||
/**
|
||||
* 商家管理
|
||||
* Class Store
|
||||
* @package app\admin\controller\shop
|
||||
*/
|
||||
class Store extends AdminBase
|
||||
{
|
||||
/**
|
||||
* NOTE: 商家列表
|
||||
* @author: 张无忌
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = StoreLogic::lists($get);
|
||||
return JsonServer::success('获取成功', $lists);
|
||||
}
|
||||
|
||||
return view('', [
|
||||
'category' => CategoryLogic::getCategory()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* NOTE: 新增商家
|
||||
* @author: 张无忌
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
(new StoreLValidate())->goCheck('add');
|
||||
$post = $this->request->post();
|
||||
$lists = StoreLogic::add($post);
|
||||
if ($lists === false) {
|
||||
$error = StoreLogic::getError() ?: '新增失败';
|
||||
return JsonServer::error($error);
|
||||
}
|
||||
return JsonServer::success('新增成功');
|
||||
}
|
||||
|
||||
return view('', [
|
||||
'category' => CategoryLogic::getCategory(),
|
||||
'tx_map_key' => ConfigServer::get('map', 'tx_map_key')
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* NOTE: 编辑商家
|
||||
* @author: 张无忌
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
(new StoreLValidate())->goCheck('edit');
|
||||
$post = $this->request->post();
|
||||
if (!empty($post['password'])) {
|
||||
(new StoreLValidate())->goCheck('pwd');
|
||||
}
|
||||
|
||||
$res = StoreLogic::edit($post);
|
||||
if ($res === false) {
|
||||
$error = StoreLogic::getError() ?: '编辑失败';
|
||||
return JsonServer::error($error);
|
||||
}
|
||||
return JsonServer::success('编辑成功');
|
||||
}
|
||||
|
||||
$id = $this->request->get('id');
|
||||
return view('', [
|
||||
'detail' => StoreLogic::detail($id),
|
||||
'category' => CategoryLogic::getCategory(),
|
||||
'tx_map_key' => ConfigServer::get('map', 'tx_map_key')
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* NOTE: 设置商家
|
||||
* @author: 张无忌
|
||||
*/
|
||||
public function set()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
(new StoreLValidate())->goCheck('set');
|
||||
$post = $this->request->post();
|
||||
$res = StoreLogic::set($post);
|
||||
|
||||
if ($res === false) {
|
||||
$error = StoreLogic::getError() ?: '设置失败';
|
||||
return JsonServer::error($error);
|
||||
}
|
||||
return JsonServer::success('设置成功');
|
||||
}
|
||||
|
||||
$id = $this->request->get('id');
|
||||
return view('', [
|
||||
'detail' => StoreLogic::detail($id)
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* NOTE: 编辑账号
|
||||
* @author: 张无忌
|
||||
*/
|
||||
public function account()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
(new StoreLValidate())->goCheck('account');
|
||||
$post = $this->request->post();
|
||||
if (!empty($post['password'])) {
|
||||
(new StoreLValidate())->goCheck('pwd');
|
||||
}
|
||||
|
||||
$res = StoreLogic::account($post);
|
||||
if ($res === false) {
|
||||
$error = StoreLogic::getError() ?: '更新失败';
|
||||
return JsonServer::error($error);
|
||||
}
|
||||
return JsonServer::success('更新成功');
|
||||
}
|
||||
|
||||
$id = $this->request->get('id');
|
||||
return view('', [
|
||||
'detail' => StoreLogic::getAccountInfo($id)
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 批量操作
|
||||
* @return \think\response\Json|void
|
||||
* @author 段誉
|
||||
* @date 2022/3/17 10:42
|
||||
*/
|
||||
public function batchOperation()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
(new StoreStatusValidate())->goCheck();
|
||||
$post = $this->request->post();
|
||||
$res = StoreLogic::batchOperation($post['ids'], $post['field'], $post['value']);
|
||||
if (false === $res) {
|
||||
$error = StoreLogic::getError() ?: '操作失败';
|
||||
return JsonServer::error($error);
|
||||
}
|
||||
return JsonServer::success('操作成功');
|
||||
}
|
||||
}
|
||||
}
|
||||
50
app/admin/controller/shop/Treaty.php
Normal file
50
app/admin/controller/shop/Treaty.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?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\shop;
|
||||
|
||||
|
||||
use app\admin\logic\shop\TreatyLogic;
|
||||
use app\common\basics\AdminBase;
|
||||
use app\common\server\JsonServer;
|
||||
|
||||
/**
|
||||
* 入驻协议
|
||||
* Class Treaty
|
||||
* @package app\admin\controller\shop
|
||||
*/
|
||||
class Treaty extends AdminBase
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$res = TreatyLogic::set($post);
|
||||
if ($res === false) {
|
||||
$error = TreatyLogic::getError() ?: '更新失败';
|
||||
return JsonServer::error($error);
|
||||
}
|
||||
return JsonServer::success('更新成功');
|
||||
}
|
||||
|
||||
return view('', [
|
||||
'detail' => TreatyLogic::detail()
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user