no message
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
'middleware' => [
|
||||
// 初始化
|
||||
app\adminapi\http\middleware\InitMiddleware::class,
|
||||
// 登录验证
|
||||
app\adminapi\http\middleware\LoginMiddleware::class,
|
||||
// 权限认证
|
||||
app\adminapi\http\middleware\AuthMiddleware::class,
|
||||
// 演示模式 - 禁止提交数据
|
||||
app\adminapi\http\middleware\CheckDemoMiddleware::class,
|
||||
// 演示模式 - 不返回敏感数据
|
||||
app\adminapi\http\middleware\EncryDemoDataMiddleware::class,
|
||||
],
|
||||
];
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
declare (strict_types=1);
|
||||
|
||||
namespace app\adminapi\controller;
|
||||
|
||||
use think\App;
|
||||
use app\common\controller\BaseLikeAdminController;
|
||||
|
||||
/**
|
||||
* 管理元控制器基类
|
||||
* Class BaseAdminController
|
||||
* @package app\adminapi\controller
|
||||
*/
|
||||
class BaseAdminController extends BaseLikeAdminController
|
||||
{
|
||||
protected int $adminId = 0;
|
||||
protected array $adminInfo = [];
|
||||
|
||||
public function initialize()
|
||||
{
|
||||
if (isset($this->request->adminInfo) && $this->request->adminInfo) {
|
||||
$this->adminInfo = $this->request->adminInfo;
|
||||
$this->adminId = $this->request->adminInfo['admin_id'];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller;
|
||||
|
||||
use app\adminapi\logic\auth\AuthLogic;
|
||||
use app\adminapi\logic\ConfigLogic;
|
||||
|
||||
/**
|
||||
* 配置控制器
|
||||
* Class ConfigController
|
||||
* @package app\adminapi\controller
|
||||
*/
|
||||
class ConfigController extends BaseAdminController
|
||||
{
|
||||
public array $notNeedLogin = ['getConfig', 'dict'];
|
||||
|
||||
|
||||
/**
|
||||
* @notes 基础配置
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2021/12/31 11:01
|
||||
*/
|
||||
public function getConfig()
|
||||
{
|
||||
$data = ConfigLogic::getConfig();
|
||||
return $this->data($data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 根据类型获取字典数据
|
||||
* @return \think\response\Json
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author 段誉
|
||||
* @date 2022/9/27 19:10
|
||||
*/
|
||||
public function dict()
|
||||
{
|
||||
$type = $this->request->get('type', '');
|
||||
$data = ConfigLogic::getDictByType($type);
|
||||
return $this->data($data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller;
|
||||
|
||||
|
||||
use app\common\cache\ExportCache;
|
||||
use app\common\service\JsonService;
|
||||
|
||||
class DownloadController extends BaseAdminController
|
||||
{
|
||||
|
||||
public array $notNeedLogin = ['export'];
|
||||
|
||||
/**
|
||||
* @notes 导出文件
|
||||
* @return \think\response\File|\think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/11/24 16:10
|
||||
*/
|
||||
public function export()
|
||||
{
|
||||
//获取文件缓存的key
|
||||
$fileKey = request()->get('file');
|
||||
|
||||
//通过文件缓存的key获取文件储存的路径
|
||||
$exportCache = new ExportCache();
|
||||
$fileInfo = $exportCache->getFile($fileKey);
|
||||
|
||||
if (empty($fileInfo)) {
|
||||
return JsonService::fail('下载文件不存在');
|
||||
}
|
||||
|
||||
//下载前删除缓存
|
||||
$exportCache->delete($fileKey);
|
||||
|
||||
return download($fileInfo['src'] . $fileInfo['name'], $fileInfo['name']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller;
|
||||
|
||||
|
||||
use app\adminapi\lists\file\FileCateLists;
|
||||
use app\adminapi\lists\file\FileLists;
|
||||
use app\adminapi\logic\FileLogic;
|
||||
use app\adminapi\validate\FileValidate;
|
||||
use think\response\Json;
|
||||
|
||||
/**文件管理
|
||||
* Class FileController
|
||||
* @package app\adminapi\controller
|
||||
*/
|
||||
class FileController extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 文件列表
|
||||
* @return Json
|
||||
* @author 段誉
|
||||
* @date 2021/12/29 14:30
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new FileLists());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 文件移动成功
|
||||
* @return Json
|
||||
* @author 段誉
|
||||
* @date 2021/12/29 14:30
|
||||
*/
|
||||
public function move()
|
||||
{
|
||||
$params = (new FileValidate())->post()->goCheck('move');
|
||||
FileLogic::move($params);
|
||||
return $this->success('移动成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 重命名文件
|
||||
* @return Json
|
||||
* @author 段誉
|
||||
* @date 2021/12/29 14:31
|
||||
*/
|
||||
public function rename()
|
||||
{
|
||||
$params = (new FileValidate())->post()->goCheck('rename');
|
||||
FileLogic::rename($params);
|
||||
return $this->success('重命名成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除文件
|
||||
* @return Json
|
||||
* @author 段誉
|
||||
* @date 2021/12/29 14:31
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$params = (new FileValidate())->post()->goCheck('delete');
|
||||
FileLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 分类列表
|
||||
* @return Json
|
||||
* @author 段誉
|
||||
* @date 2021/12/29 14:31
|
||||
*/
|
||||
public function listCate()
|
||||
{
|
||||
return $this->dataLists(new FileCateLists());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加文件分类
|
||||
* @return Json
|
||||
* @author 段誉
|
||||
* @date 2021/12/29 14:31
|
||||
*/
|
||||
public function addCate()
|
||||
{
|
||||
$params = (new FileValidate())->post()->goCheck('addCate');
|
||||
FileLogic::addCate($params);
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑文件分类
|
||||
* @return Json
|
||||
* @author 段誉
|
||||
* @date 2021/12/29 14:31
|
||||
*/
|
||||
public function editCate()
|
||||
{
|
||||
$params = (new FileValidate())->post()->goCheck('editCate');
|
||||
FileLogic::editCate($params);
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除文件分类
|
||||
* @return Json
|
||||
* @author 段誉
|
||||
* @date 2021/12/29 14:32
|
||||
*/
|
||||
public function delCate()
|
||||
{
|
||||
$params = (new FileValidate())->post()->goCheck('id');
|
||||
FileLogic::delCate($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller;
|
||||
|
||||
use app\adminapi\logic\LoginLogic;
|
||||
use app\adminapi\validate\LoginValidate;
|
||||
|
||||
/**
|
||||
* 管理员登录控制器
|
||||
* Class LoginController
|
||||
* @package app\adminapi\controller
|
||||
*/
|
||||
class LoginController extends BaseAdminController
|
||||
{
|
||||
public array $notNeedLogin = ['account'];
|
||||
|
||||
/**
|
||||
* @notes 账号登录
|
||||
* @date 2021/6/30 17:01
|
||||
* @return \think\response\Json
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author 令狐冲
|
||||
*/
|
||||
public function account()
|
||||
{
|
||||
$params = (new LoginValidate())->post()->goCheck();
|
||||
return $this->data((new LoginLogic())->login($params));
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 退出登录
|
||||
* @return \think\response\Json
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author 令狐冲
|
||||
* @date 2021/7/8 00:36
|
||||
*/
|
||||
public function logout()
|
||||
{
|
||||
//退出登录情况特殊,只有成功的情况,也不需要token验证
|
||||
(new LoginLogic())->logout($this->adminInfo);
|
||||
return $this->success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller;
|
||||
|
||||
|
||||
use app\common\service\UploadService;
|
||||
use Exception;
|
||||
use think\response\Json;
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
* Class UploadController
|
||||
* @package app\adminapi\controller
|
||||
*/
|
||||
class UploadController extends BaseAdminController
|
||||
{
|
||||
/**
|
||||
* @notes 上传图片
|
||||
* @return Json
|
||||
* @author 段誉
|
||||
* @date 2021/12/29 16:27
|
||||
*/
|
||||
public function image()
|
||||
{
|
||||
try {
|
||||
$cid = $this->request->post('cid', 0);
|
||||
$result = UploadService::image($cid);
|
||||
return $this->success('上传成功', $result);
|
||||
} catch (Exception $e) {
|
||||
return $this->fail($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 上传视频
|
||||
* @return Json
|
||||
* @author 段誉
|
||||
* @date 2021/12/29 16:27
|
||||
*/
|
||||
public function video()
|
||||
{
|
||||
try {
|
||||
$cid = $this->request->post('cid', 0);
|
||||
$result = UploadService::video($cid);
|
||||
return $this->success('上传成功', $result);
|
||||
} catch (Exception $e) {
|
||||
return $this->fail($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 上传文件
|
||||
* @return Json
|
||||
* @author dw
|
||||
* @date 2023/06/26
|
||||
*/
|
||||
public function file()
|
||||
{
|
||||
try {
|
||||
$cid = $this->request->post('cid', 0);
|
||||
$result = UploadService::file($cid);
|
||||
return $this->success('上传成功', $result);
|
||||
} catch (Exception $e) {
|
||||
return $this->fail($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller;
|
||||
|
||||
use app\adminapi\logic\WorkbenchLogic;
|
||||
|
||||
/**
|
||||
* 工作台
|
||||
* Class WorkbenchCotroller
|
||||
* @package app\adminapi\controller
|
||||
*/
|
||||
class WorkbenchController extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 工作台
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2021/12/29 17:01
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$result = WorkbenchLogic::index();
|
||||
return $this->data($result);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\controller\ai;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\ai\AiAnalysisLists;
|
||||
|
||||
class AiAnalysisController extends BaseAdminController
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new AiAnalysisLists());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\controller\ai;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\ai\AiConfigLists;
|
||||
use app\adminapi\logic\ai\AiConfigLogic;
|
||||
use app\adminapi\validate\ai\AiConfigValidate;
|
||||
|
||||
class AiConfigController extends BaseAdminController
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new AiConfigLists());
|
||||
}
|
||||
|
||||
public function detail()
|
||||
{
|
||||
$params = (new AiConfigValidate())->goCheck('detail');
|
||||
$result = AiConfigLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
public function edit()
|
||||
{
|
||||
$params = (new AiConfigValidate())->post()->goCheck('edit');
|
||||
$result = AiConfigLogic::edit($params);
|
||||
if (true === $result) {
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(AiConfigLogic::getError());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\controller\ai;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\ai\AiLogLists;
|
||||
|
||||
class AiLogController extends BaseAdminController
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new AiLogLists());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\controller\ai;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\ai\KbConfigLists;
|
||||
use app\adminapi\logic\ai\KbConfigLogic;
|
||||
use app\adminapi\validate\ai\KbConfigValidate;
|
||||
|
||||
class KbConfigController extends BaseAdminController
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new KbConfigLists());
|
||||
}
|
||||
|
||||
public function detail()
|
||||
{
|
||||
$params = (new KbConfigValidate())->goCheck('detail');
|
||||
return $this->data(KbConfigLogic::detail($params));
|
||||
}
|
||||
|
||||
public function edit()
|
||||
{
|
||||
$params = (new KbConfigValidate())->post()->goCheck();
|
||||
$result = KbConfigLogic::edit($params);
|
||||
if ($result === true) {
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(KbConfigLogic::getError());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\controller\ai;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\ai\KbDocumentLists;
|
||||
|
||||
class KbDocumentController extends BaseAdminController
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new KbDocumentLists());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\controller\ai;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\ai\KbQueryLogLists;
|
||||
|
||||
class KbQueryLogController extends BaseAdminController
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new KbQueryLogLists());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\controller\ai;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\ai\KbSyncJobLists;
|
||||
use app\adminapi\validate\ai\KbSyncJobValidate;
|
||||
use think\facade\Console;
|
||||
|
||||
class KbSyncJobController extends BaseAdminController
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new KbSyncJobLists());
|
||||
}
|
||||
|
||||
public function rebuild()
|
||||
{
|
||||
$params = (new KbSyncJobValidate())->post()->goCheck();
|
||||
Console::call('kb:rebuild', ['--domain' => $params['domain']]);
|
||||
return $this->success('已触发重建任务');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\controller\app;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\app\AppVersionLists;
|
||||
use app\adminapi\logic\app\AppVersionLogic;
|
||||
use app\adminapi\validate\app\AppVersionValidate;
|
||||
|
||||
/**
|
||||
* APP 版本管理控制器
|
||||
* Class AppVersionController
|
||||
* @package app\adminapi\controller\app
|
||||
*/
|
||||
class AppVersionController extends BaseAdminController
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new AppVersionLists());
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
$params = (new AppVersionValidate())->post()->goCheck('add');
|
||||
$result = AppVersionLogic::add($params);
|
||||
if ($result === true) {
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(AppVersionLogic::getError());
|
||||
}
|
||||
|
||||
public function edit()
|
||||
{
|
||||
$params = (new AppVersionValidate())->post()->goCheck('edit');
|
||||
$result = AppVersionLogic::edit($params);
|
||||
if ($result === true) {
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(AppVersionLogic::getError());
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$params = (new AppVersionValidate())->post()->goCheck('delete');
|
||||
AppVersionLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
|
||||
public function detail()
|
||||
{
|
||||
$params = (new AppVersionValidate())->goCheck('detail');
|
||||
$result = AppVersionLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
public function updateStatus()
|
||||
{
|
||||
$params = (new AppVersionValidate())->post()->goCheck('status');
|
||||
$result = AppVersionLogic::updateStatus($params);
|
||||
if ($result === true) {
|
||||
return $this->success('修改成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(AppVersionLogic::getError());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\controller\article;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\article\ArticleAiCommentTaskLists;
|
||||
use app\adminapi\logic\article\ArticleAiCommentTaskLogic;
|
||||
use app\adminapi\validate\article\ArticleAiCommentTaskValidate;
|
||||
|
||||
class ArticleAiCommentTaskController extends BaseAdminController
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new ArticleAiCommentTaskLists());
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$params = (new ArticleAiCommentTaskValidate())->post()->goCheck('delete');
|
||||
ArticleAiCommentTaskLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
|
||||
public function retry()
|
||||
{
|
||||
$params = (new ArticleAiCommentTaskValidate())->post()->goCheck('retry');
|
||||
$result = ArticleAiCommentTaskLogic::retry($params);
|
||||
if (true === $result) {
|
||||
return $this->success('重置成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(ArticleAiCommentTaskLogic::getError());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\article;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\article\ArticleCateLists;
|
||||
use app\adminapi\logic\article\ArticleCateLogic;
|
||||
use app\adminapi\validate\article\ArticleCateValidate;
|
||||
|
||||
/**
|
||||
* 资讯分类管理控制器
|
||||
* Class ArticleCateController
|
||||
* @package app\adminapi\controller\article
|
||||
*/
|
||||
class ArticleCateController extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 查看资讯分类列表
|
||||
* @return \think\response\Json
|
||||
* @author heshihu
|
||||
* @date 2022/2/21 17:11
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new ArticleCateLists());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加资讯分类
|
||||
* @return \think\response\Json
|
||||
* @author heshihu
|
||||
* @date 2022/2/21 17:31
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$params = (new ArticleCateValidate())->post()->goCheck('add');
|
||||
ArticleCateLogic::add($params);
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑资讯分类
|
||||
* @return \think\response\Json
|
||||
* @author heshihu
|
||||
* @date 2022/2/21 17:49
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$params = (new ArticleCateValidate())->post()->goCheck('edit');
|
||||
$result = ArticleCateLogic::edit($params);
|
||||
if (true === $result) {
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(ArticleCateLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除资讯分类
|
||||
* @return \think\response\Json
|
||||
* @author heshihu
|
||||
* @date 2022/2/21 17:52
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$params = (new ArticleCateValidate())->post()->goCheck('delete');
|
||||
ArticleCateLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 资讯分类详情
|
||||
* @return \think\response\Json
|
||||
* @author heshihu
|
||||
* @date 2022/2/21 17:54
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$params = (new ArticleCateValidate())->goCheck('detail');
|
||||
$result = ArticleCateLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 更改资讯分类状态
|
||||
* @return \think\response\Json
|
||||
* @author heshihu
|
||||
* @date 2022/2/21 10:15
|
||||
*/
|
||||
public function updateStatus()
|
||||
{
|
||||
$params = (new ArticleCateValidate())->post()->goCheck('status');
|
||||
$result = ArticleCateLogic::updateStatus($params);
|
||||
if (true === $result) {
|
||||
return $this->success('修改成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(ArticleCateLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取文章分类
|
||||
* @return \think\response\Json
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author 段誉
|
||||
* @date 2022/10/13 10:54
|
||||
*/
|
||||
public function all()
|
||||
{
|
||||
$result = ArticleCateLogic::getAllData();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\article;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\article\ArticleLists;
|
||||
use app\adminapi\logic\article\ArticleLogic;
|
||||
use app\adminapi\validate\article\ArticleValidate;
|
||||
|
||||
/**
|
||||
* 资讯管理控制器
|
||||
* Class ArticleController
|
||||
* @package app\adminapi\controller\article
|
||||
*/
|
||||
class ArticleController extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 查看资讯列表
|
||||
* @return \think\response\Json
|
||||
* @author heshihu
|
||||
* @date 2022/2/22 9:47
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new ArticleLists());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 添加资讯
|
||||
* @return \think\response\Json
|
||||
* @author heshihu
|
||||
* @date 2022/2/22 9:57
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$params = (new ArticleValidate())->post()->goCheck('add');
|
||||
$result = ArticleLogic::add($params);
|
||||
if (true === $result) {
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(ArticleLogic::getError());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 编辑资讯
|
||||
* @return \think\response\Json
|
||||
* @author heshihu
|
||||
* @date 2022/2/22 10:12
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$params = (new ArticleValidate())->post()->goCheck('edit');
|
||||
$result = ArticleLogic::edit($params);
|
||||
if (true === $result) {
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(ArticleLogic::getError());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 删除资讯
|
||||
* @return \think\response\Json
|
||||
* @author heshihu
|
||||
* @date 2022/2/22 10:17
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$params = (new ArticleValidate())->post()->goCheck('delete');
|
||||
ArticleLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 资讯详情
|
||||
* @return \think\response\Json
|
||||
* @author heshihu
|
||||
* @date 2022/2/22 10:15
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$params = (new ArticleValidate())->goCheck('detail');
|
||||
$result = ArticleLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 更改资讯状态
|
||||
* @return \think\response\Json
|
||||
* @author heshihu
|
||||
* @date 2022/2/22 10:18
|
||||
*/
|
||||
public function updateStatus()
|
||||
{
|
||||
$params = (new ArticleValidate())->post()->goCheck('status');
|
||||
$result = ArticleLogic::updateStatus($params);
|
||||
if (true === $result) {
|
||||
return $this->success('修改成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(ArticleLogic::getError());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 批量推荐
|
||||
* @return \think\response\Json
|
||||
* @author heshihu
|
||||
* @date 2022/2/22 10:18
|
||||
*/
|
||||
public function batchRecommend()
|
||||
{
|
||||
$params = (new ArticleValidate())->post()->goCheck('batchRecommend');
|
||||
$result = ArticleLogic::batchRecommend($params);
|
||||
if (true === $result) {
|
||||
return $this->success('设置成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(ArticleLogic::getError());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\auth;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\auth\AdminLists;
|
||||
use app\adminapi\validate\auth\AdminValidate;
|
||||
use app\adminapi\logic\auth\AdminLogic;
|
||||
use app\adminapi\validate\auth\editSelfValidate;
|
||||
|
||||
/**
|
||||
* 管理员控制器
|
||||
* Class AdminController
|
||||
* @package app\adminapi\controller\auth
|
||||
*/
|
||||
class AdminController extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 查看管理员列表
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2021/12/29 9:55
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new AdminLists());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加管理员
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2021/12/29 10:21
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$params = (new AdminValidate())->post()->goCheck('add');
|
||||
$result = AdminLogic::add($params);
|
||||
if (true === $result) {
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(AdminLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑管理员
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2021/12/29 11:03
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$params = (new AdminValidate())->post()->goCheck('edit');
|
||||
$result = AdminLogic::edit($params);
|
||||
if (true === $result) {
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(AdminLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除管理员
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2021/12/29 11:03
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$params = (new AdminValidate())->post()->goCheck('delete');
|
||||
$result = AdminLogic::delete($params);
|
||||
if (true === $result) {
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(AdminLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 查看管理员详情
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2021/12/29 11:07
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$params = (new AdminValidate())->goCheck('detail');
|
||||
$result = AdminLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取当前管理员信息
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2021/12/31 10:53
|
||||
*/
|
||||
public function mySelf()
|
||||
{
|
||||
$result = AdminLogic::detail(['id' => $this->adminId], 'auth');
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑超级管理员信息
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/4/8 17:54
|
||||
*/
|
||||
public function editSelf()
|
||||
{
|
||||
$params = (new editSelfValidate())->post()->goCheck('', ['admin_id' => $this->adminId]);
|
||||
$result = AdminLogic::editSelf($params);
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\auth;
|
||||
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\auth\MenuLists;
|
||||
use app\adminapi\logic\auth\MenuLogic;
|
||||
use app\adminapi\validate\auth\MenuValidate;
|
||||
|
||||
|
||||
/**
|
||||
* 系统菜单权限
|
||||
* Class MenuController
|
||||
* @package app\adminapi\controller\setting\system
|
||||
*/
|
||||
class MenuController extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 获取菜单路由
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/6/29 17:41
|
||||
*/
|
||||
public function route()
|
||||
{
|
||||
$result = MenuLogic::getMenuByAdminId($this->adminId);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取菜单列表
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/6/29 17:23
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new MenuLists());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 菜单详情
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/6/30 10:07
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$params = (new MenuValidate())->goCheck('detail');
|
||||
return $this->data(MenuLogic::detail($params));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加菜单
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/6/30 10:07
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$params = (new MenuValidate())->post()->goCheck('add');
|
||||
MenuLogic::add($params);
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑菜单
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/6/30 10:07
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$params = (new MenuValidate())->post()->goCheck('edit');
|
||||
MenuLogic::edit($params);
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除菜单
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/6/30 10:07
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$params = (new MenuValidate())->post()->goCheck('delete');
|
||||
MenuLogic::delete($params);
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 更新状态
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/7/6 17:04
|
||||
*/
|
||||
public function updateStatus()
|
||||
{
|
||||
$params = (new MenuValidate())->post()->goCheck('status');
|
||||
MenuLogic::updateStatus($params);
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取菜单数据
|
||||
* @return \think\response\Json
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author 段誉
|
||||
* @date 2022/10/13 11:03
|
||||
*/
|
||||
public function all()
|
||||
{
|
||||
$result = MenuLogic::getAllData();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\auth;
|
||||
|
||||
use app\adminapi\{
|
||||
logic\auth\RoleLogic,
|
||||
lists\auth\RoleLists,
|
||||
validate\auth\RoleValidate,
|
||||
controller\BaseAdminController
|
||||
};
|
||||
|
||||
/**
|
||||
* 角色控制器
|
||||
* Class RoleController
|
||||
* @package app\adminapi\controller\auth
|
||||
*/
|
||||
class RoleController extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 查看角色列表
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2021/12/29 11:49
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new RoleLists());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加权限
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2021/12/29 11:49
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$params = (new RoleValidate())->post()->goCheck('add');
|
||||
$res = RoleLogic::add($params);
|
||||
if (true === $res) {
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(RoleLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑角色
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2021/12/29 14:18
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$params = (new RoleValidate())->post()->goCheck('edit');
|
||||
$res = RoleLogic::edit($params);
|
||||
if (true === $res) {
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(RoleLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除角色
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2021/12/29 14:18
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$params = (new RoleValidate())->post()->goCheck('del');
|
||||
RoleLogic::delete($params['id']);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 查看角色详情
|
||||
* @return \think\response\Json
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author 段誉
|
||||
* @date 2021/12/29 14:18
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$params = (new RoleValidate())->goCheck('detail');
|
||||
$detail = RoleLogic::detail($params['id']);
|
||||
return $this->data($detail);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取角色数据
|
||||
* @return \think\response\Json
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author 段誉
|
||||
* @date 2022/10/13 10:39
|
||||
*/
|
||||
public function all()
|
||||
{
|
||||
$result = RoleLogic::getAllData();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\channel;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\logic\channel\AppSettingLogic;
|
||||
|
||||
/**
|
||||
* APP设置控制器
|
||||
* Class AppSettingController
|
||||
* @package app\adminapi\controller\setting\app
|
||||
*/
|
||||
class AppSettingController extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 获取App设置
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 10:24
|
||||
*/
|
||||
public function getConfig()
|
||||
{
|
||||
$result = AppSettingLogic::getConfig();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes App设置
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 10:25
|
||||
*/
|
||||
public function setConfig()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
AppSettingLogic::setConfig($params);
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\channel;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\logic\channel\MnpSettingsLogic;
|
||||
use app\adminapi\validate\channel\MnpSettingsValidate;
|
||||
|
||||
/**
|
||||
* 小程序设置
|
||||
* Class MnpSettingsController
|
||||
* @package app\adminapi\controller\channel
|
||||
*/
|
||||
class MnpSettingsController extends BaseAdminController
|
||||
{
|
||||
/**
|
||||
* @notes 获取小程序配置
|
||||
* @return \think\response\Json
|
||||
* @author ljj
|
||||
* @date 2022/2/16 9:38 上午
|
||||
*/
|
||||
public function getConfig()
|
||||
{
|
||||
$result = (new MnpSettingsLogic())->getConfig();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 设置小程序配置
|
||||
* @return \think\response\Json
|
||||
* @author ljj
|
||||
* @date 2022/2/16 9:51 上午
|
||||
*/
|
||||
public function setConfig()
|
||||
{
|
||||
$params = (new MnpSettingsValidate())->post()->goCheck();
|
||||
(new MnpSettingsLogic())->setConfig($params);
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\channel;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\logic\channel\OfficialAccountMenuLogic;
|
||||
|
||||
/**
|
||||
* 微信公众号菜单控制器
|
||||
* Class OfficialAccountMenuController
|
||||
* @package app\adminapi\controller\channel
|
||||
*/
|
||||
class OfficialAccountMenuController extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 保存菜单
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 10:41
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$result = OfficialAccountMenuLogic::save($params);
|
||||
if(false === $result) {
|
||||
return $this->fail(OfficialAccountMenuLogic::getError());
|
||||
}
|
||||
return $this->success('保存成功',[],1,1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 保存发布菜单
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 10:42
|
||||
*/
|
||||
public function saveAndPublish()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$result = OfficialAccountMenuLogic::saveAndPublish($params);
|
||||
if($result) {
|
||||
return $this->success('保存并发布成功',[],1,1);
|
||||
}
|
||||
return $this->fail(OfficialAccountMenuLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @notes 查看菜单详情
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 10:42
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$result = OfficialAccountMenuLogic::detail();
|
||||
return $this->data($result);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\channel;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\channel\OfficialAccountReplyLists;
|
||||
use app\adminapi\logic\channel\OfficialAccountReplyLogic;
|
||||
use app\adminapi\validate\channel\OfficialAccountReplyValidate;
|
||||
|
||||
/**
|
||||
* 微信公众号回复控制器
|
||||
* Class OfficialAccountReplyController
|
||||
* @package app\adminapi\controller\channel
|
||||
*/
|
||||
class OfficialAccountReplyController extends BaseAdminController
|
||||
{
|
||||
|
||||
public array $notNeedLogin = ['index'];
|
||||
|
||||
|
||||
/**
|
||||
* @notes 查看回复列表(关注/关键词/默认)
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 10:58
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new OfficialAccountReplyLists());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加回复(关注/关键词/默认)
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 10:58
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$params = (new OfficialAccountReplyValidate())->post()->goCheck('add');
|
||||
$result = OfficialAccountReplyLogic::add($params);
|
||||
if ($result) {
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(OfficialAccountReplyLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 查看回复详情
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 10:58
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$params = (new OfficialAccountReplyValidate())->goCheck('detail');
|
||||
$result = OfficialAccountReplyLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑回复(关注/关键词/默认)
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 10:58
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$params = (new OfficialAccountReplyValidate())->post()->goCheck('edit');
|
||||
$result = OfficialAccountReplyLogic::edit($params);
|
||||
if ($result) {
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(OfficialAccountReplyLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除回复(关注/关键词/默认)
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 10:59
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$params = (new OfficialAccountReplyValidate())->post()->goCheck('delete');
|
||||
OfficialAccountReplyLogic::delete($params);
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 更新排序
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 10:59
|
||||
*/
|
||||
public function sort()
|
||||
{
|
||||
$params = (new OfficialAccountReplyValidate())->post()->goCheck('sort');
|
||||
OfficialAccountReplyLogic::sort($params);
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 更新状态
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 10:59
|
||||
*/
|
||||
public function status()
|
||||
{
|
||||
$params = (new OfficialAccountReplyValidate())->post()->goCheck('status');
|
||||
OfficialAccountReplyLogic::status($params);
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 微信公众号回调
|
||||
* @throws \ReflectionException
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 10:59
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$result = OfficialAccountReplyLogic::index();
|
||||
return response($result->getBody())->header([
|
||||
'Content-Type' => 'text/plain;charset=utf-8'
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\channel;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\logic\channel\OfficialAccountSettingLogic;
|
||||
use app\adminapi\validate\channel\OfficialAccountSettingValidate;
|
||||
|
||||
/**
|
||||
* 公众号设置
|
||||
* Class OfficialAccountSettingController
|
||||
* @package app\adminapi\controller\channel
|
||||
*/
|
||||
class OfficialAccountSettingController extends BaseAdminController
|
||||
{
|
||||
/**
|
||||
* @notes 获取公众号配置
|
||||
* @return \think\response\Json
|
||||
* @author ljj
|
||||
* @date 2022/2/16 10:09 上午
|
||||
*/
|
||||
public function getConfig()
|
||||
{
|
||||
$result = (new OfficialAccountSettingLogic())->getConfig();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 设置公众号配置
|
||||
* @return \think\response\Json
|
||||
* @author ljj
|
||||
* @date 2022/2/16 10:09 上午
|
||||
*/
|
||||
public function setConfig()
|
||||
{
|
||||
$params = (new OfficialAccountSettingValidate())->post()->goCheck();
|
||||
(new OfficialAccountSettingLogic())->setConfig($params);
|
||||
return $this->success('操作成功',[],1,1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\channel;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\logic\channel\OpenSettingLogic;
|
||||
use app\adminapi\validate\channel\OpenSettingValidate;
|
||||
|
||||
/**
|
||||
* 微信开放平台
|
||||
* Class AppSettingController
|
||||
* @package app\adminapi\controller\setting\app
|
||||
*/
|
||||
class OpenSettingController extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 获取微信开放平台设置
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 11:03
|
||||
*/
|
||||
public function getConfig()
|
||||
{
|
||||
$result = OpenSettingLogic::getConfig();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 微信开放平台设置
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 11:03
|
||||
*/
|
||||
public function setConfig()
|
||||
{
|
||||
$params = (new OpenSettingValidate())->post()->goCheck();
|
||||
OpenSettingLogic::setConfig($params);
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\channel;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\logic\channel\WebPageSettingLogic;
|
||||
use app\adminapi\validate\channel\WebPageSettingValidate;
|
||||
|
||||
/**
|
||||
* H5设置控制器
|
||||
* Class HFiveSettingController
|
||||
* @package app\adminapi\controller\setting\h5
|
||||
*/
|
||||
class WebPageSettingController extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 获取H5设置
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 10:36
|
||||
*/
|
||||
public function getConfig()
|
||||
{
|
||||
$result = WebPageSettingLogic::getConfig();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes H5设置
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 10:36
|
||||
*/
|
||||
public function setConfig()
|
||||
{
|
||||
$params = (new WebPageSettingValidate())->post()->goCheck();
|
||||
WebPageSettingLogic::setConfig($params);
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\controller\community;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\community\CommunityCommentLists;
|
||||
use app\adminapi\logic\community\CommunityCommentLogic;
|
||||
use app\adminapi\validate\community\CommunityCommentValidate;
|
||||
|
||||
class CommunityCommentController extends BaseAdminController
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new CommunityCommentLists());
|
||||
}
|
||||
|
||||
public function updateStatus()
|
||||
{
|
||||
$params = (new CommunityCommentValidate())->post()->goCheck('status');
|
||||
$result = CommunityCommentLogic::updateStatus($params);
|
||||
if (true === $result) {
|
||||
return $this->success('修改成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(CommunityCommentLogic::getError());
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$params = (new CommunityCommentValidate())->post()->goCheck('delete');
|
||||
CommunityCommentLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\controller\community;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\community\CommunityPostLists;
|
||||
use app\adminapi\logic\community\CommunityPostLogic;
|
||||
use app\adminapi\validate\community\CommunityPostValidate;
|
||||
|
||||
class CommunityPostController extends BaseAdminController
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new CommunityPostLists());
|
||||
}
|
||||
|
||||
public function detail()
|
||||
{
|
||||
$params = (new CommunityPostValidate())->goCheck('detail');
|
||||
$result = CommunityPostLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
public function updateStatus()
|
||||
{
|
||||
$params = (new CommunityPostValidate())->post()->goCheck('status');
|
||||
$result = CommunityPostLogic::updateStatus($params);
|
||||
if (true === $result) {
|
||||
return $this->success('修改成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(CommunityPostLogic::getError());
|
||||
}
|
||||
|
||||
public function setTop()
|
||||
{
|
||||
$params = (new CommunityPostValidate())->post()->goCheck('top');
|
||||
$result = CommunityPostLogic::setTop($params);
|
||||
if (true === $result) {
|
||||
return $this->success('设置成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(CommunityPostLogic::getError());
|
||||
}
|
||||
|
||||
public function setHot()
|
||||
{
|
||||
$params = (new CommunityPostValidate())->post()->goCheck('hot');
|
||||
$result = CommunityPostLogic::setHot($params);
|
||||
if (true === $result) {
|
||||
return $this->success('设置成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(CommunityPostLogic::getError());
|
||||
}
|
||||
|
||||
public function setRecommend()
|
||||
{
|
||||
$params = (new CommunityPostValidate())->post()->goCheck('recommend');
|
||||
$result = CommunityPostLogic::setRecommend($params);
|
||||
if (true === $result) {
|
||||
return $this->success('设置成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(CommunityPostLogic::getError());
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$params = (new CommunityPostValidate())->post()->goCheck('delete');
|
||||
CommunityPostLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\controller\community;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\community\CommunityTagLists;
|
||||
use app\adminapi\logic\community\CommunityTagLogic;
|
||||
use app\adminapi\validate\community\CommunityTagValidate;
|
||||
|
||||
class CommunityTagController extends BaseAdminController
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new CommunityTagLists());
|
||||
}
|
||||
|
||||
public function all()
|
||||
{
|
||||
$result = CommunityTagLogic::all();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
$params = (new CommunityTagValidate())->post()->goCheck('add');
|
||||
CommunityTagLogic::add($params);
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
|
||||
public function edit()
|
||||
{
|
||||
$params = (new CommunityTagValidate())->post()->goCheck('edit');
|
||||
$result = CommunityTagLogic::edit($params);
|
||||
if (true === $result) {
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(CommunityTagLogic::getError());
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$params = (new CommunityTagValidate())->post()->goCheck('delete');
|
||||
CommunityTagLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
|
||||
public function detail()
|
||||
{
|
||||
$params = (new CommunityTagValidate())->goCheck('detail');
|
||||
$result = CommunityTagLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\controller\crawler;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\crawler\CrawlErrorLogLists;
|
||||
use app\common\model\CrawlErrorLog;
|
||||
|
||||
class CrawlErrorLogController extends BaseAdminController
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new CrawlErrorLogLists());
|
||||
}
|
||||
|
||||
public function detail()
|
||||
{
|
||||
$id = $this->request->get('id/d', 0);
|
||||
$result = CrawlErrorLog::findOrEmpty($id)->toArray();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$ids = $this->request->post('ids/a', []);
|
||||
if (empty($ids)) {
|
||||
return $this->fail('请选择要删除的记录');
|
||||
}
|
||||
CrawlErrorLog::destroy($ids);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\crontab;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\crontab\CrontabLists;
|
||||
use app\adminapi\logic\crontab\CrontabLogic;
|
||||
use app\adminapi\validate\crontab\CrontabValidate;
|
||||
|
||||
/**
|
||||
* 定时任务控制器
|
||||
* Class CrontabController
|
||||
* @package app\adminapi\controller\crontab
|
||||
*/
|
||||
class CrontabController extends BaseAdminController
|
||||
{
|
||||
/**
|
||||
* @notes 定时任务列表
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 14:27
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new CrontabLists());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加定时任务
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 14:27
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$params = (new CrontabValidate())->post()->goCheck('add');
|
||||
$result = CrontabLogic::add($params);
|
||||
if ($result) {
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(CrontabLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 查看定时任务详情
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 14:27
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$params = (new CrontabValidate())->goCheck('detail');
|
||||
$result = CrontabLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑定时任务
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 14:27
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$params = (new CrontabValidate())->post()->goCheck('edit');
|
||||
$result = CrontabLogic::edit($params);
|
||||
if ($result) {
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(CrontabLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除定时任务
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 14:27
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$params = (new CrontabValidate())->post()->goCheck('delete');
|
||||
$result = CrontabLogic::delete($params);
|
||||
if ($result) {
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail('删除失败');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 操作定时任务
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 14:28
|
||||
*/
|
||||
public function operate()
|
||||
{
|
||||
$params = (new CrontabValidate())->post()->goCheck('operate');
|
||||
$result = CrontabLogic::operate($params);
|
||||
if ($result) {
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(CrontabLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 手动执行定时任务
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$params = (new CrontabValidate())->post()->goCheck('detail');
|
||||
$result = CrontabLogic::run($params);
|
||||
if ($result) {
|
||||
return $this->success('执行完成', $result);
|
||||
}
|
||||
return $this->fail(CrontabLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 执行日志列表
|
||||
*/
|
||||
public function logs()
|
||||
{
|
||||
$params = $this->request->get();
|
||||
$result = CrontabLogic::logs($params);
|
||||
return $this->success('', $result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取规则执行时间
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 14:28
|
||||
*/
|
||||
public function expression()
|
||||
{
|
||||
$params = (new CrontabValidate())->goCheck('expression');
|
||||
$result = CrontabLogic::expression($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\adminapi\controller\decorate;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\logic\decorate\DecorateDataLogic;
|
||||
use think\response\Json;
|
||||
|
||||
/**
|
||||
* 装修-数据
|
||||
* Class DataController
|
||||
* @package app\adminapi\controller\decorate
|
||||
*/
|
||||
class DataController extends BaseAdminController
|
||||
{
|
||||
/**
|
||||
* @notes 文章列表
|
||||
* @return Json
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author mjf
|
||||
* @date 2024/3/14 18:13
|
||||
*/
|
||||
public function article(): Json
|
||||
{
|
||||
$limit = $this->request->get('limit/d', 10);
|
||||
$result = DecorateDataLogic::getArticleLists($limit);
|
||||
return $this->success('获取成功', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes pc设置
|
||||
* @return Json
|
||||
* @author mjf
|
||||
* @date 2024/3/14 18:13
|
||||
*/
|
||||
public function pc(): Json
|
||||
{
|
||||
$result = DecorateDataLogic::pc();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\adminapi\controller\decorate;
|
||||
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\logic\decorate\DecoratePageLogic;
|
||||
use app\adminapi\validate\decorate\DecoratePageValidate;
|
||||
|
||||
|
||||
/**
|
||||
* 装修页面
|
||||
* Class DecoratePageController
|
||||
* @package app\adminapi\controller\decorate
|
||||
*/
|
||||
class PageController extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 获取装修修页面详情
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/9/14 18:43
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$id = $this->request->get('id/d');
|
||||
$result = DecoratePageLogic::getDetail($id);
|
||||
return $this->success('获取成功', $result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 保存装修配置
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/9/15 9:57
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
$params = (new DecoratePageValidate())->post()->goCheck();
|
||||
$result = DecoratePageLogic::save($params);
|
||||
if (false === $result) {
|
||||
return $this->fail(DecoratePageLogic::getError());
|
||||
}
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\adminapi\controller\decorate;
|
||||
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\logic\decorate\DecorateTabbarLogic;
|
||||
|
||||
/**
|
||||
* 装修-底部导航
|
||||
* Class DecorateTabbarController
|
||||
* @package app\adminapi\controller\decorate
|
||||
*/
|
||||
class TabbarController extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 底部导航详情
|
||||
* @return \think\response\Json
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author 段誉
|
||||
* @date 2022/9/7 16:39
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$data = DecorateTabbarLogic::detail();
|
||||
return $this->success('', $data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 底部导航保存
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/9/6 9:58
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
DecorateTabbarLogic::save($params);
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\dept;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\logic\dept\DeptLogic;
|
||||
use app\adminapi\validate\dept\DeptValidate;
|
||||
|
||||
/**
|
||||
* 部门管理控制器
|
||||
* Class DeptController
|
||||
* @package app\adminapi\controller\dept
|
||||
*/
|
||||
class DeptController extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 部门列表
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/5/25 18:07
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
$params = $this->request->get();
|
||||
$result = DeptLogic::lists($params);
|
||||
return $this->success('',$result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 上级部门
|
||||
* @return \think\response\Json
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author 段誉
|
||||
* @date 2022/5/26 18:36
|
||||
*/
|
||||
public function leaderDept()
|
||||
{
|
||||
$result = DeptLogic::leaderDept();
|
||||
return $this->success('',$result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加部门
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/5/25 18:40
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$params = (new DeptValidate())->post()->goCheck('add');
|
||||
DeptLogic::add($params);
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑部门
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/5/25 18:41
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$params = (new DeptValidate())->post()->goCheck('edit');
|
||||
$result = DeptLogic::edit($params);
|
||||
if (true === $result) {
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(DeptLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除部门
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/5/25 18:41
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$params = (new DeptValidate())->post()->goCheck('delete');
|
||||
DeptLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取部门详情
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/5/25 18:41
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$params = (new DeptValidate())->goCheck('detail');
|
||||
$result = DeptLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取部门数据
|
||||
* @return \think\response\Json
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author 段誉
|
||||
* @date 2022/10/13 10:28
|
||||
*/
|
||||
public function all()
|
||||
{
|
||||
$result = DeptLogic::getAllData();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\dept;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\dept\JobsLists;
|
||||
use app\adminapi\logic\dept\JobsLogic;
|
||||
use app\adminapi\validate\dept\JobsValidate;
|
||||
|
||||
|
||||
/**
|
||||
* 岗位管理控制器
|
||||
* Class JobsController
|
||||
* @package app\adminapi\controller\dept
|
||||
*/
|
||||
class JobsController extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 岗位列表
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/5/26 10:00
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new JobsLists());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加岗位
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/5/25 18:40
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$params = (new JobsValidate())->post()->goCheck('add');
|
||||
JobsLogic::add($params);
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑岗位
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/5/25 18:41
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$params = (new JobsValidate())->post()->goCheck('edit');
|
||||
$result = JobsLogic::edit($params);
|
||||
if (true === $result) {
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(JobsLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除岗位
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/5/25 18:41
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$params = (new JobsValidate())->post()->goCheck('delete');
|
||||
JobsLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取岗位详情
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/5/25 18:41
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$params = (new JobsValidate())->goCheck('detail');
|
||||
$result = JobsLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取岗位数据
|
||||
* @return \think\response\Json
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author 段誉
|
||||
* @date 2022/10/13 10:31
|
||||
*/
|
||||
public function all()
|
||||
{
|
||||
$result = JobsLogic::getAllData();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\controller\device;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\device\DeviceLists;
|
||||
use app\common\model\device\UserDevice;
|
||||
|
||||
/**
|
||||
* 设备管理(只读)
|
||||
*/
|
||||
class DeviceController extends BaseAdminController
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new DeviceLists());
|
||||
}
|
||||
|
||||
public function detail()
|
||||
{
|
||||
$id = (int)$this->request->get('id', 0);
|
||||
if ($id <= 0) return $this->fail('参数错误');
|
||||
$info = UserDevice::findOrEmpty($id)->toArray();
|
||||
return $this->data($info);
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$id = (int)$this->request->post('id', 0);
|
||||
if ($id <= 0) return $this->fail('参数错误');
|
||||
UserDevice::destroy($id);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备统计概览
|
||||
*/
|
||||
public function stats()
|
||||
{
|
||||
$total = UserDevice::count();
|
||||
$platforms = UserDevice::field('platform, COUNT(*) as count')
|
||||
->group('platform')
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
$today = strtotime(date('Y-m-d'));
|
||||
$todayActive = UserDevice::where('last_at', '>=', $today)->count();
|
||||
$todayNew = UserDevice::where('first_at', '>=', $today)->count();
|
||||
|
||||
return $this->data([
|
||||
'total' => $total,
|
||||
'today_active' => $todayActive,
|
||||
'today_new' => $todayNew,
|
||||
'platforms' => $platforms,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\finance;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\finance\AccountLogLists;
|
||||
use app\common\enum\user\AccountLogEnum;
|
||||
|
||||
/***
|
||||
* 账户流水控制器
|
||||
* Class AccountLogController
|
||||
* @package app\adminapi\controller
|
||||
*/
|
||||
class AccountLogController extends BaseAdminController
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 账户流水明细
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2023/2/24 15:25
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new AccountLogLists());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 用户余额变动类型
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2023/2/24 15:25
|
||||
*/
|
||||
public function getUmChangeType()
|
||||
{
|
||||
return $this->data(AccountLogEnum::getUserMoneyChangeTypeDesc());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\finance;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\finance\RefundLogLists;
|
||||
use app\adminapi\lists\finance\RefundRecordLists;
|
||||
use app\adminapi\logic\finance\RefundLogic;
|
||||
|
||||
/**
|
||||
* 退款控制器
|
||||
* Class RefundController
|
||||
* @package app\adminapi\controller\finance
|
||||
*/
|
||||
class RefundController extends BaseAdminController
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 退还统计
|
||||
* @return \think\response\Json
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author 段誉
|
||||
* @date 2023/3/3 12:10
|
||||
*/
|
||||
public function stat()
|
||||
{
|
||||
$result = RefundLogic::stat();
|
||||
return $this->success('', $result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 退款记录
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2023/3/1 9:47
|
||||
*/
|
||||
public function record()
|
||||
{
|
||||
return $this->dataLists(new RefundRecordLists());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 退款日志
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2023/3/1 9:47
|
||||
*/
|
||||
public function log()
|
||||
{
|
||||
$recordId = $this->request->get('record_id', 0);
|
||||
$result = RefundLogic::refundLog($recordId);
|
||||
return $this->success('', $result);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\controller\lottery;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\lottery\LotteryCategoryLists;
|
||||
use app\adminapi\logic\lottery\LotteryCategoryLogic;
|
||||
use app\adminapi\validate\lottery\LotteryCategoryValidate;
|
||||
|
||||
class LotteryCategoryController extends BaseAdminController
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new LotteryCategoryLists());
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
$params = (new LotteryCategoryValidate())->post()->goCheck('add');
|
||||
LotteryCategoryLogic::add($params);
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
|
||||
public function edit()
|
||||
{
|
||||
$params = (new LotteryCategoryValidate())->post()->goCheck('edit');
|
||||
$result = LotteryCategoryLogic::edit($params);
|
||||
if (true === $result) {
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(LotteryCategoryLogic::getError());
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$params = (new LotteryCategoryValidate())->post()->goCheck('delete');
|
||||
LotteryCategoryLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
|
||||
public function detail()
|
||||
{
|
||||
$params = (new LotteryCategoryValidate())->goCheck('detail');
|
||||
$result = LotteryCategoryLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\controller\lottery;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\lottery\LotteryDrawLists;
|
||||
use app\adminapi\logic\lottery\LotteryDrawLogic;
|
||||
use app\adminapi\validate\lottery\LotteryDrawValidate;
|
||||
|
||||
class LotteryDrawController extends BaseAdminController
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new LotteryDrawLists());
|
||||
}
|
||||
|
||||
public function detail()
|
||||
{
|
||||
$params = (new LotteryDrawValidate())->goCheck('detail');
|
||||
$result = LotteryDrawLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$params = (new LotteryDrawValidate())->post()->goCheck('delete');
|
||||
LotteryDrawLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\controller\lottery;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\lottery\LotteryRegionLists;
|
||||
use app\adminapi\logic\lottery\LotteryRegionLogic;
|
||||
use app\adminapi\validate\lottery\LotteryRegionValidate;
|
||||
|
||||
class LotteryRegionController extends BaseAdminController
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new LotteryRegionLists());
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
$params = (new LotteryRegionValidate())->post()->goCheck('add');
|
||||
LotteryRegionLogic::add($params);
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
|
||||
public function edit()
|
||||
{
|
||||
$params = (new LotteryRegionValidate())->post()->goCheck('edit');
|
||||
$result = LotteryRegionLogic::edit($params);
|
||||
if (true === $result) {
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(LotteryRegionLogic::getError());
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$params = (new LotteryRegionValidate())->post()->goCheck('delete');
|
||||
LotteryRegionLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
|
||||
public function detail()
|
||||
{
|
||||
$params = (new LotteryRegionValidate())->goCheck('detail');
|
||||
$result = LotteryRegionLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\controller\match;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\match\LeagueLists;
|
||||
use app\adminapi\logic\match\LeagueLogic;
|
||||
use app\adminapi\validate\match\LeagueValidate;
|
||||
|
||||
class LeagueController extends BaseAdminController
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new LeagueLists());
|
||||
}
|
||||
|
||||
public function detail()
|
||||
{
|
||||
$params = (new LeagueValidate())->goCheck('detail');
|
||||
$result = LeagueLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
public function edit()
|
||||
{
|
||||
$params = (new LeagueValidate())->post()->goCheck('edit');
|
||||
$result = LeagueLogic::edit($params);
|
||||
if (true === $result) {
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(LeagueLogic::getError());
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$params = (new LeagueValidate())->post()->goCheck('delete');
|
||||
LeagueLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\controller\match;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\match\MatchLists;
|
||||
use app\adminapi\logic\match\MatchLogic;
|
||||
use app\adminapi\validate\match\MatchValidate;
|
||||
|
||||
class MatchController extends BaseAdminController
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new MatchLists());
|
||||
}
|
||||
|
||||
public function detail()
|
||||
{
|
||||
$params = (new MatchValidate())->goCheck('detail');
|
||||
$result = MatchLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
public function edit()
|
||||
{
|
||||
$params = (new MatchValidate())->post()->goCheck('edit');
|
||||
$result = MatchLogic::edit($params);
|
||||
if (true === $result) {
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(MatchLogic::getError());
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$params = (new MatchValidate())->post()->goCheck('delete');
|
||||
MatchLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\notice;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\notice\NoticeSettingLists;
|
||||
use app\adminapi\logic\notice\NoticeLogic;
|
||||
use app\adminapi\validate\notice\NoticeValidate;
|
||||
|
||||
/**
|
||||
* 通知控制器
|
||||
* Class NoticeController
|
||||
* @package app\adminapi\controller\notice
|
||||
*/
|
||||
class NoticeController extends BaseAdminController
|
||||
{
|
||||
/**
|
||||
* @notes 查看通知设置列表
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 11:18
|
||||
*/
|
||||
public function settingLists()
|
||||
{
|
||||
return $this->dataLists(new NoticeSettingLists());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 查看通知设置详情
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 11:18
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$params = (new NoticeValidate())->goCheck('detail');
|
||||
$result = NoticeLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 通知设置
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 11:18
|
||||
*/
|
||||
public function set()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$result = NoticeLogic::set($params);
|
||||
if ($result) {
|
||||
return $this->success('设置成功');
|
||||
}
|
||||
return $this->fail(NoticeLogic::getError());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\notice;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\logic\notice\SmsConfigLogic;
|
||||
use app\adminapi\validate\notice\SmsConfigValidate;
|
||||
|
||||
/**
|
||||
* 短信配置控制器
|
||||
* Class SmsConfigController
|
||||
* @package app\adminapi\controller\notice
|
||||
*/
|
||||
class SmsConfigController extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 获取短信配置
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 11:36
|
||||
*/
|
||||
public function getConfig()
|
||||
{
|
||||
$result = SmsConfigLogic::getConfig();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 短信配置
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 11:36
|
||||
*/
|
||||
public function setConfig()
|
||||
{
|
||||
$params = (new SmsConfigValidate())->post()->goCheck('setConfig');
|
||||
SmsConfigLogic::setConfig($params);
|
||||
return $this->success('操作成功',[],1,1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 查看短信配置详情
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 11:36
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$params = (new SmsConfigValidate())->goCheck('detail');
|
||||
$result = SmsConfigLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\controller\points;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\logic\points\PointsProductLogic;
|
||||
use app\adminapi\lists\points\PointsProductLists;
|
||||
use app\adminapi\validate\points\PointsProductValidate;
|
||||
|
||||
class PointsProductController extends BaseAdminController
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new PointsProductLists());
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
$params = (new PointsProductValidate())->post()->goCheck('add');
|
||||
PointsProductLogic::add($params);
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
|
||||
public function edit()
|
||||
{
|
||||
$params = (new PointsProductValidate())->post()->goCheck();
|
||||
PointsProductLogic::edit($params);
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$params = (new PointsProductValidate())->post()->goCheck('delete');
|
||||
PointsProductLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
|
||||
public function detail()
|
||||
{
|
||||
$params = (new PointsProductValidate())->goCheck('detail');
|
||||
return $this->data(PointsProductLogic::detail($params));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\controller\popup;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\popup\PopupLists;
|
||||
use app\adminapi\logic\popup\PopupLogic;
|
||||
use app\adminapi\validate\popup\PopupValidate;
|
||||
|
||||
/**
|
||||
* 页面弹窗管理
|
||||
*/
|
||||
class PopupController extends BaseAdminController
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new PopupLists());
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
$params = (new PopupValidate())->post()->goCheck('add');
|
||||
PopupLogic::add($params);
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
|
||||
public function edit()
|
||||
{
|
||||
$params = (new PopupValidate())->post()->goCheck('edit');
|
||||
$result = PopupLogic::edit($params);
|
||||
if ($result === true) {
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(PopupLogic::getError());
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$params = (new PopupValidate())->post()->goCheck('delete');
|
||||
PopupLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
|
||||
public function detail()
|
||||
{
|
||||
$params = (new PopupValidate())->goCheck('detail');
|
||||
$result = PopupLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
public function updateStatus()
|
||||
{
|
||||
$params = (new PopupValidate())->post()->goCheck('status');
|
||||
PopupLogic::updateStatus($params);
|
||||
return $this->success('修改成功', [], 1, 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\controller\popup;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\popup\PopupLogLists;
|
||||
use app\common\model\popup\PagePopup;
|
||||
use app\common\model\popup\PagePopupLog;
|
||||
|
||||
/**
|
||||
* 弹窗操作日志
|
||||
*/
|
||||
class PopupLogController extends BaseAdminController
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new PopupLogLists());
|
||||
}
|
||||
|
||||
/**
|
||||
* 弹窗统计概览
|
||||
* GET /popup.popup_log/stats?popup_id=xxx
|
||||
* 返回:[show, click, close, ctr, days[]]
|
||||
*/
|
||||
public function stats()
|
||||
{
|
||||
$popupId = (int)$this->request->get('popup_id', 0);
|
||||
$where = [];
|
||||
if ($popupId > 0) $where[] = ['popup_id', '=', $popupId];
|
||||
|
||||
$show = PagePopupLog::where($where)->where('action', 1)->count();
|
||||
$click = PagePopupLog::where($where)->where('action', 2)->count();
|
||||
$close = PagePopupLog::where($where)->where('action', 3)->count();
|
||||
$ctr = $show > 0 ? round($click / $show * 100, 2) : 0;
|
||||
|
||||
// 最近 7 天每日统计
|
||||
$days = [];
|
||||
for ($i = 6; $i >= 0; $i--) {
|
||||
$start = strtotime(date('Y-m-d', strtotime("-{$i} day")));
|
||||
$end = $start + 86400;
|
||||
$dShow = PagePopupLog::where($where)->where('action', 1)
|
||||
->where('create_time', '>=', $start)
|
||||
->where('create_time', '<', $end)->count();
|
||||
$dClick = PagePopupLog::where($where)->where('action', 2)
|
||||
->where('create_time', '>=', $start)
|
||||
->where('create_time', '<', $end)->count();
|
||||
$days[] = [
|
||||
'date' => date('m-d', $start),
|
||||
'show' => $dShow,
|
||||
'click' => $dClick,
|
||||
];
|
||||
}
|
||||
|
||||
$popupName = '';
|
||||
if ($popupId > 0) {
|
||||
$popup = PagePopup::find($popupId);
|
||||
$popupName = $popup ? (string)$popup['name'] : '';
|
||||
}
|
||||
|
||||
return $this->data([
|
||||
'popup_id' => $popupId,
|
||||
'popup_name' => $popupName,
|
||||
'show' => $show,
|
||||
'click' => $click,
|
||||
'close' => $close,
|
||||
'ctr' => $ctr,
|
||||
'days' => $days,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\recharge;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\recharge\RechargeLists;
|
||||
use app\adminapi\logic\recharge\RechargeLogic;
|
||||
use app\adminapi\validate\recharge\RechargeRefundValidate;
|
||||
|
||||
/**
|
||||
* 充值控制器
|
||||
* Class RechargeController
|
||||
* @package app\adminapi\controller\recharge
|
||||
*/
|
||||
class RechargeController extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 获取充值设置
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2023/2/22 16:48
|
||||
*/
|
||||
public function getConfig()
|
||||
{
|
||||
$result = RechargeLogic::getConfig();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 充值设置
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2023/2/22 16:48
|
||||
*/
|
||||
public function setConfig()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$result = RechargeLogic::setConfig($params);
|
||||
if($result) {
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(RechargeLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 充值记录
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2023/2/24 16:01
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new RechargeLists());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 退款
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2023/2/28 17:29
|
||||
*/
|
||||
public function refund()
|
||||
{
|
||||
$params = (new RechargeRefundValidate())->post()->goCheck('refund');
|
||||
$result = RechargeLogic::refund($params, $this->adminId);
|
||||
list($flag, $msg) = $result;
|
||||
if(false === $flag) {
|
||||
return $this->fail($msg);
|
||||
}
|
||||
return $this->success($msg, [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 重新退款
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2023/2/28 19:17
|
||||
*/
|
||||
public function refundAgain()
|
||||
{
|
||||
$params = (new RechargeRefundValidate())->post()->goCheck('again');
|
||||
$result = RechargeLogic::refundAgain($params, $this->adminId);
|
||||
list($flag, $msg) = $result;
|
||||
if(false === $flag) {
|
||||
return $this->fail($msg);
|
||||
}
|
||||
return $this->success($msg, [], 1, 1);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\setting;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\logic\setting\CustomerServiceLogic;
|
||||
|
||||
/**
|
||||
* 客服设置
|
||||
* Class CustomerServiceController
|
||||
* @package app\adminapi\controller\setting
|
||||
*/
|
||||
class CustomerServiceController extends BaseAdminController
|
||||
{
|
||||
/**
|
||||
* @notes 获取客服设置
|
||||
* @return \think\response\Json
|
||||
* @author ljj
|
||||
* @date 2022/2/15 12:05 下午
|
||||
*/
|
||||
public function getConfig()
|
||||
{
|
||||
$result = CustomerServiceLogic::getConfig();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 设置客服设置
|
||||
* @return \think\response\Json
|
||||
* @author ljj
|
||||
* @date 2022/2/15 12:11 下午
|
||||
*/
|
||||
public function setConfig()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
CustomerServiceLogic::setConfig($params);
|
||||
return $this->success('设置成功', [], 1, 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\setting;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\logic\setting\HotSearchLogic;
|
||||
|
||||
/**
|
||||
* 热门搜索设置
|
||||
* Class HotSearchController
|
||||
* @package app\adminapi\controller\setting
|
||||
*/
|
||||
class HotSearchController extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 获取热门搜索
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/9/5 19:00
|
||||
*/
|
||||
public function getConfig()
|
||||
{
|
||||
$result = HotSearchLogic::getConfig();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置热门搜索
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/9/5 19:00
|
||||
*/
|
||||
public function setConfig()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$result = HotSearchLogic::setConfig($params);
|
||||
if (false === $result) {
|
||||
return $this->fail(HotSearchLogic::getError() ?: '系统错误');
|
||||
}
|
||||
return $this->success('设置成功', [], 1, 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\controller\setting;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\setting\SmsUploadLists;
|
||||
|
||||
class SmsUploadController extends BaseAdminController
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new SmsUploadLists());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\setting;
|
||||
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\logic\setting\StorageLogic;
|
||||
use app\adminapi\validate\setting\StorageValidate;
|
||||
use think\response\Json;
|
||||
|
||||
|
||||
/**
|
||||
* 存储设置控制器
|
||||
* Class StorageController
|
||||
* @package app\adminapi\controller\setting\shop
|
||||
*/
|
||||
class StorageController extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 获取存储引擎列表
|
||||
* @return Json
|
||||
* @author 段誉
|
||||
* @date 2022/4/20 16:13
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->success('获取成功', StorageLogic::lists());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 存储配置信息
|
||||
* @return Json
|
||||
* @author 段誉
|
||||
* @date 2022/4/20 16:19
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$param = (new StorageValidate())->get()->goCheck('detail');
|
||||
return $this->success('获取成功', StorageLogic::detail($param));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置存储参数
|
||||
* @return Json
|
||||
* @author 段誉
|
||||
* @date 2022/4/20 16:19
|
||||
*/
|
||||
public function setup()
|
||||
{
|
||||
$params = (new StorageValidate())->post()->goCheck('setup');
|
||||
$result = StorageLogic::setup($params);
|
||||
if (true === $result) {
|
||||
return $this->success('配置成功', [], 1, 1);
|
||||
}
|
||||
return $this->success($result, [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 切换存储引擎
|
||||
* @return Json
|
||||
* @author 段誉
|
||||
* @date 2022/4/20 16:19
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
$params = (new StorageValidate())->post()->goCheck('change');
|
||||
StorageLogic::change($params);
|
||||
return $this->success('切换成功', [], 1, 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\setting;
|
||||
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\logic\setting\TransactionSettingsLogic;
|
||||
use app\adminapi\validate\setting\TransactionSettingsValidate;
|
||||
|
||||
/**
|
||||
* 交易设置
|
||||
* Class TransactionSettingsController
|
||||
* @package app\adminapi\controller\setting
|
||||
*/
|
||||
class TransactionSettingsController extends BaseAdminController
|
||||
{
|
||||
/**
|
||||
* @notes 获取交易设置
|
||||
* @return \think\response\Json
|
||||
* @author ljj
|
||||
* @date 2022/2/15 11:40 上午
|
||||
*/
|
||||
public function getConfig()
|
||||
{
|
||||
$result = TransactionSettingsLogic::getConfig();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 设置交易设置
|
||||
* @return \think\response\Json
|
||||
* @author ljj
|
||||
* @date 2022/2/15 11:50 上午
|
||||
*/
|
||||
public function setConfig()
|
||||
{
|
||||
$params = (new TransactionSettingsValidate())->post()->goCheck('setConfig');
|
||||
TransactionSettingsLogic::setConfig($params);
|
||||
return $this->success('操作成功',[],1,1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\setting\dict;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\setting\dict\DictDataLists;
|
||||
use app\adminapi\logic\setting\dict\DictDataLogic;
|
||||
use app\adminapi\validate\dict\DictDataValidate;
|
||||
|
||||
|
||||
/**
|
||||
* 字典数据
|
||||
* Class DictDataController
|
||||
* @package app\adminapi\controller\dictionary
|
||||
*/
|
||||
class DictDataController extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 获取字典数据列表
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/6/20 16:35
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new DictDataLists());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加字典数据
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/6/20 17:13
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$params = (new DictDataValidate())->post()->goCheck('add');
|
||||
DictDataLogic::save($params);
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑字典数据
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/6/20 17:13
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$params = (new DictDataValidate())->post()->goCheck('edit');
|
||||
DictDataLogic::save($params);
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除字典数据
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/6/20 17:13
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$params = (new DictDataValidate())->post()->goCheck('id');
|
||||
DictDataLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取字典详情
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/6/20 17:14
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$params = (new DictDataValidate())->goCheck('id');
|
||||
$result = DictDataLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\setting\dict;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\setting\dict\DictTypeLists;
|
||||
use app\adminapi\logic\setting\dict\DictTypeLogic;
|
||||
use app\adminapi\validate\dict\DictTypeValidate;
|
||||
|
||||
|
||||
/**
|
||||
* 字典类型
|
||||
* Class DictTypeController
|
||||
* @package app\adminapi\controller\dict
|
||||
*/
|
||||
class DictTypeController extends BaseAdminController
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取字典类型列表
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/6/20 15:50
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new DictTypeLists());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加字典类型
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/6/20 16:24
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$params = (new DictTypeValidate())->post()->goCheck('add');
|
||||
DictTypeLogic::add($params);
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑字典类型
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/6/20 16:25
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$params = (new DictTypeValidate())->post()->goCheck('edit');
|
||||
DictTypeLogic::edit($params);
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除字典类型
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/6/20 16:25
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$params = (new DictTypeValidate())->post()->goCheck('delete');
|
||||
DictTypeLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取字典详情
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/6/20 16:25
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$params = (new DictTypeValidate())->goCheck('detail');
|
||||
$result = DictTypeLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取字典类型数据
|
||||
* @return \think\response\Json
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author 段誉
|
||||
* @date 2022/10/13 10:46
|
||||
*/
|
||||
public function all()
|
||||
{
|
||||
$result = DictTypeLogic::getAllData();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\adminapi\controller\setting\pay;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\setting\pay\PayConfigLists;
|
||||
use app\adminapi\logic\setting\pay\PayConfigLogic;
|
||||
use app\adminapi\validate\setting\PayConfigValidate;
|
||||
use think\response\Json;
|
||||
|
||||
/**
|
||||
* 支付配置
|
||||
* Class PayConfigController
|
||||
* @package app\adminapi\controller\setting\pay
|
||||
*/
|
||||
class PayConfigController extends BaseAdminController
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置支付配置
|
||||
* @return Json
|
||||
* @author 段誉
|
||||
* @date 2023/2/23 16:14
|
||||
*/
|
||||
public function setConfig(): Json
|
||||
{
|
||||
$params = (new PayConfigValidate())->post()->goCheck();
|
||||
PayConfigLogic::setConfig($params);
|
||||
return $this->success('设置成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取支付配置
|
||||
* @return Json
|
||||
* @author 段誉
|
||||
* @date 2023/2/23 16:14
|
||||
*/
|
||||
public function getConfig(): Json
|
||||
{
|
||||
$id = (new PayConfigValidate())->goCheck('get');
|
||||
$result = PayConfigLogic::getConfig($id);
|
||||
return $this->success('获取成功', $result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes
|
||||
* @return Json
|
||||
* @author 段誉
|
||||
* @date 2023/2/23 16:15
|
||||
*/
|
||||
public function lists(): Json
|
||||
{
|
||||
return $this->dataLists(new PayConfigLists());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\setting\pay;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\logic\setting\pay\PayWayLogic;
|
||||
|
||||
|
||||
/**
|
||||
* 支付方式
|
||||
* Class PayWayController
|
||||
* @package app\adminapi\controller\setting\pay
|
||||
*/
|
||||
class PayWayController extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 获取支付方式
|
||||
* @return \think\response\Json
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author 段誉
|
||||
* @date 2023/2/23 16:27
|
||||
*/
|
||||
public function getPayWay()
|
||||
{
|
||||
$result = PayWayLogic::getPayWay();
|
||||
return $this->success('获取成功',$result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置支付方式
|
||||
* @return \think\response\Json
|
||||
* @throws \Exception
|
||||
* @author 段誉
|
||||
* @date 2023/2/23 16:27
|
||||
*/
|
||||
public function setPayWay()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$result = (new PayWayLogic())->setPayWay($params);
|
||||
if (true !== $result) {
|
||||
return $this->fail($result);
|
||||
}
|
||||
return $this->success('操作成功',[],1, 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\setting\system;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\logic\setting\system\CacheLogic;
|
||||
|
||||
/**
|
||||
* 系统缓存
|
||||
* Class CacheController
|
||||
* @package app\adminapi\controller\setting\system
|
||||
*/
|
||||
class CacheController extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 清除系统缓存
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/4/8 16:34
|
||||
*/
|
||||
public function clear()
|
||||
{
|
||||
CacheLogic::clear();
|
||||
return $this->success('清除成功', [], 1, 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\setting\system;
|
||||
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\setting\system\LogLists;
|
||||
|
||||
/**
|
||||
* 系统日志
|
||||
* Class LogController
|
||||
* @package app\adminapi\controller\setting\system
|
||||
*/
|
||||
class LogController extends BaseAdminController
|
||||
{
|
||||
/**
|
||||
* @notes 查看系统日志列表
|
||||
* @return \think\response\Json
|
||||
* @author ljj
|
||||
* @date 2021/8/3 4:25 下午
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new LogLists());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\setting\system;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\logic\setting\system\SystemLogic;
|
||||
|
||||
|
||||
/**
|
||||
* 系统维护
|
||||
* Class SystemController
|
||||
* @package app\adminapi\controller\setting\system
|
||||
*/
|
||||
class SystemController extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 获取系统环境信息
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2021/12/28 18:36
|
||||
*/
|
||||
public function info()
|
||||
{
|
||||
$result = SystemLogic::getInfo();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\adminapi\controller\setting\user;
|
||||
|
||||
use app\adminapi\{
|
||||
controller\BaseAdminController,
|
||||
logic\setting\user\UserLogic,
|
||||
validate\setting\UserConfigValidate
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 设置-用户设置控制器
|
||||
* Class UserController
|
||||
* @package app\adminapi\controller\config
|
||||
*/
|
||||
class UserController extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 获取用户设置
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 10:08
|
||||
*/
|
||||
public function getConfig()
|
||||
{
|
||||
$result = (new UserLogic())->getConfig();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置用户设置
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 10:08
|
||||
*/
|
||||
public function setConfig()
|
||||
{
|
||||
$params = (new UserConfigValidate())->post()->goCheck('user');
|
||||
(new UserLogic())->setConfig($params);
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取注册配置
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 10:08
|
||||
*/
|
||||
public function getRegisterConfig()
|
||||
{
|
||||
$result = (new UserLogic())->getRegisterConfig();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置注册配置
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 10:08
|
||||
*/
|
||||
public function setRegisterConfig()
|
||||
{
|
||||
$params = (new UserConfigValidate())->post()->goCheck('register');
|
||||
(new UserLogic())->setRegisterConfig($params);
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\setting\web;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\logic\setting\web\WebSettingLogic;
|
||||
use app\adminapi\validate\setting\WebSettingValidate;
|
||||
|
||||
/**
|
||||
* 网站设置
|
||||
* Class WebSettingController
|
||||
* @package app\adminapi\controller\setting
|
||||
*/
|
||||
class WebSettingController extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 获取网站信息
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2021/12/28 15:44
|
||||
*/
|
||||
public function getWebsite()
|
||||
{
|
||||
$result = WebSettingLogic::getWebsiteInfo();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置网站信息
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2021/12/28 15:45
|
||||
*/
|
||||
public function setWebsite()
|
||||
{
|
||||
$params = (new WebSettingValidate())->post()->goCheck('website');
|
||||
WebSettingLogic::setWebsiteInfo($params);
|
||||
return $this->success('设置成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取备案信息
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2021/12/28 16:10
|
||||
*/
|
||||
public function getCopyright()
|
||||
{
|
||||
$result = WebSettingLogic::getCopyright();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置备案信息
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2021/12/28 16:10
|
||||
*/
|
||||
public function setCopyright()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$result = WebSettingLogic::setCopyright($params);
|
||||
if (false === $result) {
|
||||
return $this->fail(WebSettingLogic::getError() ?: '操作失败');
|
||||
}
|
||||
return $this->success('设置成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置政策协议
|
||||
* @return \think\response\Json
|
||||
* @author ljj
|
||||
* @date 2022/2/15 11:00 上午
|
||||
*/
|
||||
public function setAgreement()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
WebSettingLogic::setAgreement($params);
|
||||
return $this->success('设置成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取政策协议
|
||||
* @return \think\response\Json
|
||||
* @author ljj
|
||||
* @date 2022/2/15 11:16 上午
|
||||
*/
|
||||
public function getAgreement()
|
||||
{
|
||||
$result = WebSettingLogic::getAgreement();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 获取站点统计配置
|
||||
* @return \think\response\Json
|
||||
* @author yfdong
|
||||
* @date 2024/09/20 22:24
|
||||
*/
|
||||
public function getSiteStatistics()
|
||||
{
|
||||
$result = WebSettingLogic::getSiteStatistics();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 获取站点统计配置
|
||||
* @return \think\response\Json
|
||||
* @author yfdong
|
||||
* @date 2024/09/20 22:51
|
||||
*/
|
||||
public function setSiteStatistics()
|
||||
{
|
||||
$params = (new WebSettingValidate())->post()->goCheck('siteStatistics');
|
||||
WebSettingLogic::setSiteStatistics($params);
|
||||
return $this->success('设置成功', [], 1, 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\controller\shortlink;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\shortlink\ShortLinkLists;
|
||||
use app\adminapi\lists\shortlink\ShortLinkLogLists;
|
||||
use app\common\model\ShortLink;
|
||||
use app\common\service\ShortLinkPosterDataService;
|
||||
use app\common\service\ShortLinkQrCodeService;
|
||||
|
||||
class ShortLinkController extends BaseAdminController
|
||||
{
|
||||
/**
|
||||
* @notes 短链接列表
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new ShortLinkLists());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 短链接点击日志
|
||||
*/
|
||||
public function logLists()
|
||||
{
|
||||
return $this->dataLists(new ShortLinkLogLists());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 删除短链接
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$id = $this->request->post('id/d', 0);
|
||||
if (empty($id)) {
|
||||
return $this->fail('参数错误');
|
||||
}
|
||||
ShortLink::destroy($id);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 重新生成二维码
|
||||
*/
|
||||
public function regenerateQrcode()
|
||||
{
|
||||
$id = $this->request->post('id/d', 0);
|
||||
if (empty($id)) {
|
||||
return $this->fail('参数错误');
|
||||
}
|
||||
|
||||
$link = ShortLink::findOrEmpty($id);
|
||||
if ($link->isEmpty()) {
|
||||
return $this->fail('短链接不存在');
|
||||
}
|
||||
|
||||
// 删除旧二维码与海报合成文件
|
||||
$oldUri = (string) $link->getData('qrcode');
|
||||
$candidates = [];
|
||||
if ($oldUri !== '') {
|
||||
$candidates[] = $oldUri;
|
||||
}
|
||||
// 同时清理可能的同名残留文件(海报版与纯二维码版)
|
||||
$candidates[] = 'uploads/qrcode/shortlink/' . $link->code . '.png';
|
||||
$candidates[] = 'uploads/qrcode/shortlink/' . $link->code . '_poster.png';
|
||||
$candidates[] = 'uploads/qrcode/shortlink/' . $link->code . '.svg';
|
||||
foreach (array_unique($candidates) as $uri) {
|
||||
$abs = public_path() . $uri;
|
||||
if (is_file($abs)) {
|
||||
@unlink($abs);
|
||||
}
|
||||
}
|
||||
|
||||
$shortUrl = request()->domain() . '/s/' . $link->code;
|
||||
$posterData = ShortLinkPosterDataService::build(
|
||||
(string) $link->page_type,
|
||||
$link->page_id,
|
||||
(int) $link->user_id
|
||||
);
|
||||
$qrcode = ShortLinkQrCodeService::create($shortUrl, $link->code, $posterData['poster_image_uri'], $posterData);
|
||||
|
||||
$link->qrcode = $qrcode['uri'];
|
||||
$link->save();
|
||||
|
||||
return $this->success('重新生成成功', [
|
||||
'qrcode' => $qrcode['uri'],
|
||||
'qrcode_url' => $qrcode['url'],
|
||||
], 1, 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,206 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\tools;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\tools\DataTableLists;
|
||||
use app\adminapi\lists\tools\GenerateTableLists;
|
||||
use app\adminapi\logic\tools\GeneratorLogic;
|
||||
use app\adminapi\validate\tools\EditTableValidate;
|
||||
use app\adminapi\validate\tools\GenerateTableValidate;
|
||||
|
||||
|
||||
/**
|
||||
* 代码生成器控制器
|
||||
* Class GeneratorController
|
||||
* @package app\adminapi\controller\article
|
||||
*/
|
||||
class GeneratorController extends BaseAdminController
|
||||
{
|
||||
|
||||
public array $notNeedLogin = ['download'];
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取数据库中所有数据表信息
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/6/14 10:57
|
||||
*/
|
||||
public function dataTable()
|
||||
{
|
||||
return $this->dataLists(new DataTableLists());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取已选择的数据表
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/6/14 10:57
|
||||
*/
|
||||
public function generateTable()
|
||||
{
|
||||
return $this->dataLists(new GenerateTableLists());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 选择数据表
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/6/15 10:09
|
||||
*/
|
||||
public function selectTable()
|
||||
{
|
||||
$params = (new GenerateTableValidate())->post()->goCheck('select');
|
||||
$result = GeneratorLogic::selectTable($params, $this->adminId);
|
||||
if (true === $result) {
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(GeneratorLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 生成代码
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/6/23 19:08
|
||||
*/
|
||||
public function generate()
|
||||
{
|
||||
$params = (new GenerateTableValidate())->post()->goCheck('id');
|
||||
$result = GeneratorLogic::generate($params);
|
||||
if (false === $result) {
|
||||
return $this->fail(GeneratorLogic::getError());
|
||||
}
|
||||
return $this->success('操作成功', $result, 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 下载文件
|
||||
* @return \think\response\File|\think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/6/24 9:51
|
||||
*/
|
||||
public function download()
|
||||
{
|
||||
$params = (new GenerateTableValidate())->goCheck('download');
|
||||
$result = GeneratorLogic::download($params['file']);
|
||||
if (false === $result) {
|
||||
return $this->fail(GeneratorLogic::getError() ?: '下载失败');
|
||||
}
|
||||
return download($result, 'likeadmin-curd.zip');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 预览代码
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/6/23 19:07
|
||||
*/
|
||||
public function preview()
|
||||
{
|
||||
$params = (new GenerateTableValidate())->post()->goCheck('id');
|
||||
$result = GeneratorLogic::preview($params);
|
||||
if (false === $result) {
|
||||
return $this->fail(GeneratorLogic::getError());
|
||||
}
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 同步字段
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/6/17 15:22
|
||||
*/
|
||||
public function syncColumn()
|
||||
{
|
||||
$params = (new GenerateTableValidate())->post()->goCheck('id');
|
||||
$result = GeneratorLogic::syncColumn($params);
|
||||
if (true === $result) {
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(GeneratorLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑表信息
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/6/20 10:44
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$params = (new EditTableValidate())->post()->goCheck();
|
||||
$result = GeneratorLogic::editTable($params);
|
||||
if (true === $result) {
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(GeneratorLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取已选择的数据表详情
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/6/15 19:00
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$params = (new GenerateTableValidate())->goCheck('id');
|
||||
$result = GeneratorLogic::getTableDetail($params);
|
||||
return $this->success('', $result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除已选择的数据表信息
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/6/15 19:00
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$params = (new GenerateTableValidate())->post()->goCheck('id');
|
||||
$result = GeneratorLogic::deleteTable($params);
|
||||
if (true === $result) {
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(GeneratorLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取模型
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/12/14 11:07
|
||||
*/
|
||||
public function getModels()
|
||||
{
|
||||
$result = GeneratorLogic::getAllModels();
|
||||
return $this->success('', $result, 1, 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\adminapi\controller\user;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\user\UserLists;
|
||||
use app\adminapi\logic\user\UserLogic;
|
||||
use app\adminapi\validate\user\AdjustUserMoney;
|
||||
use app\adminapi\validate\user\UserValidate;
|
||||
|
||||
/**
|
||||
* 用户控制器
|
||||
* Class UserController
|
||||
* @package app\adminapi\controller\user
|
||||
*/
|
||||
class UserController extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 用户列表
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/9/22 16:16
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new UserLists());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取用户详情
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/9/22 16:34
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$params = (new UserValidate())->goCheck('detail');
|
||||
$detail = UserLogic::detail($params['id']);
|
||||
return $this->success('', $detail);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑用户信息
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/9/22 16:34
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$params = (new UserValidate())->post()->goCheck('setInfo');
|
||||
UserLogic::setUserInfo($params);
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 调整用户余额
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2023/2/23 14:33
|
||||
*/
|
||||
public function adjustMoney()
|
||||
{
|
||||
$params = (new AdjustUserMoney())->post()->goCheck();
|
||||
$res = UserLogic::adjustUserMoney($params);
|
||||
if (true === $res) {
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail($res);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 调整用户账户(余额/积分)
|
||||
*/
|
||||
public function adjustAccount()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
if (empty($params['user_id']) || empty($params['type']) || empty($params['action']) || empty($params['num'])) {
|
||||
return $this->fail('参数不完整');
|
||||
}
|
||||
if (!in_array($params['type'], ['money', 'points'])) {
|
||||
return $this->fail('调整类型错误');
|
||||
}
|
||||
if (!in_array($params['action'], [1, 2])) {
|
||||
return $this->fail('操作类型错误');
|
||||
}
|
||||
if ($params['num'] <= 0) {
|
||||
return $this->fail('调整数量必须大于零');
|
||||
}
|
||||
$res = UserLogic::adjustUserAccount($params);
|
||||
if (true === $res) {
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail($res);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\controller\vip;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\logic\vip\VipLevelLogic;
|
||||
use app\adminapi\lists\vip\VipLevelLists;
|
||||
use app\adminapi\validate\vip\VipLevelValidate;
|
||||
|
||||
class VipLevelController extends BaseAdminController
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new VipLevelLists());
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
$params = (new VipLevelValidate())->post()->goCheck('add');
|
||||
VipLevelLogic::add($params);
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
|
||||
public function edit()
|
||||
{
|
||||
$params = (new VipLevelValidate())->post()->goCheck();
|
||||
VipLevelLogic::edit($params);
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$params = (new VipLevelValidate())->post()->goCheck('delete');
|
||||
VipLevelLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
|
||||
public function detail()
|
||||
{
|
||||
$params = (new VipLevelValidate())->goCheck('detail');
|
||||
return $this->data(VipLevelLogic::detail($params));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
'listen' => [
|
||||
'AppInit' => [],
|
||||
'HttpRun' => [],
|
||||
'HttpEnd' => ['app\adminapi\listener\OperationLog'],
|
||||
'LogLevel' => [],
|
||||
'LogWrite' => [],
|
||||
]
|
||||
];
|
||||
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
declare (strict_types=1);
|
||||
|
||||
namespace app\adminapi\http\middleware;
|
||||
|
||||
use app\common\{
|
||||
cache\AdminAuthCache,
|
||||
service\JsonService
|
||||
};
|
||||
use think\helper\Str;
|
||||
|
||||
/**
|
||||
* 权限验证中间件
|
||||
* Class AuthMiddleware
|
||||
* @package app\adminapi\http\middleware
|
||||
*/
|
||||
class AuthMiddleware
|
||||
{
|
||||
/**
|
||||
* @notes 权限验证
|
||||
* @param $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
* @author 令狐冲
|
||||
* @date 2021/7/2 19:29
|
||||
*/
|
||||
public function handle($request, \Closure $next)
|
||||
{
|
||||
//不登录访问,无需权限验证
|
||||
if ($request->controllerObject->isNotNeedLogin()) {
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
if ($request->adminInfo['login_ip'] != request()->ip()) {
|
||||
return JsonService::fail('ip地址发生变化,请重新登录', [], -1);
|
||||
}
|
||||
|
||||
//系统默认超级管理员,无需权限验证
|
||||
if (1 === $request->adminInfo['root']) {
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
$adminAuthCache = new AdminAuthCache($request->adminInfo['admin_id']);
|
||||
|
||||
// 当前访问路径
|
||||
$accessUri = strtolower($request->controller() . '/' . $request->action());
|
||||
// 全部路由
|
||||
$allUri = $this->formatUrl($adminAuthCache->getAllUri());
|
||||
|
||||
// 判断该当前访问的uri是否存在,不存在无需验证
|
||||
if (!in_array($accessUri, $allUri)) {
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
// 当前管理员拥有的路由权限
|
||||
$AdminUris = $adminAuthCache->getAdminUri() ?? [];
|
||||
$AdminUris = $this->formatUrl($AdminUris);
|
||||
|
||||
if (in_array($accessUri, $AdminUris)) {
|
||||
return $next($request);
|
||||
}
|
||||
return JsonService::fail('权限不足,无法访问或操作');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 格式化URL
|
||||
* @param array $data
|
||||
* @return array|string[]
|
||||
* @author 段誉
|
||||
* @date 2022/7/7 15:39
|
||||
*/
|
||||
public function formatUrl(array $data)
|
||||
{
|
||||
return array_map(function ($item) {
|
||||
return strtolower(Str::camel($item));
|
||||
}, $data);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
declare (strict_types=1);
|
||||
|
||||
namespace app\adminapi\http\middleware;
|
||||
|
||||
|
||||
use app\common\service\JsonService;
|
||||
|
||||
/**
|
||||
* 校验演示环境
|
||||
* Class CheckDemoMiddleware
|
||||
* @package app\adminapi\http\middleware
|
||||
*/
|
||||
class CheckDemoMiddleware
|
||||
{
|
||||
|
||||
// 允许post的接口
|
||||
protected $ablePost = [
|
||||
'login/account',
|
||||
'login/logout',
|
||||
];
|
||||
|
||||
public function handle($request, \Closure $next)
|
||||
{
|
||||
if ($request->method() != 'POST') {
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
$accessUri = strtolower($request->controller() . '/' . $request->action());
|
||||
if (!in_array($accessUri, $this->ablePost) && env('project.demo_env')) {
|
||||
return JsonService::fail('演示环境不支持修改数据,请下载源码本地部署体验');
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
declare (strict_types=1);
|
||||
|
||||
namespace app\adminapi\http\middleware;
|
||||
|
||||
/**
|
||||
* 演示环境数据加密
|
||||
* Class DemoDataMiddleware
|
||||
* @package app\adminapi\http\middleware
|
||||
*/
|
||||
class EncryDemoDataMiddleware
|
||||
{
|
||||
|
||||
// 需要过滤的接口
|
||||
protected $needCheck = [
|
||||
// 存储配置
|
||||
'setting.storage/detail',
|
||||
// 短信配置
|
||||
'notice.smsConfig/detail',
|
||||
// 公众号配置
|
||||
'channel.official_account_setting/getConfig',
|
||||
// 小程序配置
|
||||
'channel.mnp_settings/getConfig',
|
||||
// 开放平台配置
|
||||
'channel.open_setting/getConfig',
|
||||
// 支付配置
|
||||
'setting.pay.pay_config/getConfig',
|
||||
];
|
||||
|
||||
// 可以排除字段
|
||||
protected $excludeParams = [
|
||||
'name',
|
||||
'icon',
|
||||
'image',
|
||||
'qr_code',
|
||||
'interface_version',
|
||||
'merchant_type',
|
||||
];
|
||||
|
||||
|
||||
public function handle($request, \Closure $next)
|
||||
{
|
||||
$response = $next($request);
|
||||
|
||||
// 非需校验的接口 或者 未开启演示模式
|
||||
$accessUri = strtolower($request->controller() . '/' . $request->action());
|
||||
if (!in_array($accessUri, lower_uri($this->needCheck)) || !env('project.demo_env')) {
|
||||
return $response;
|
||||
}
|
||||
|
||||
// 非json数据
|
||||
if (!method_exists($response, 'header') || !in_array('application/json; charset=utf-8', $response->getHeader())) {
|
||||
return $response;
|
||||
}
|
||||
|
||||
$data = $response->getData();
|
||||
if (!is_array($data) || empty($data)) {
|
||||
return $response;
|
||||
}
|
||||
|
||||
foreach ($data['data'] as $key => $item) {
|
||||
// 字符串
|
||||
if (is_string($item)) {
|
||||
$data['data'][$key] = $this->getEncryData($key, $item);
|
||||
continue;
|
||||
}
|
||||
// 数组
|
||||
if (is_array($item)) {
|
||||
foreach ($item as $itemKey => $itemValue) {
|
||||
$data['data'][$key][$itemKey] = $this->getEncryData($itemKey, $itemValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $response->data($data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 加密配置
|
||||
* @param $key
|
||||
* @param $value
|
||||
* @return mixed|string
|
||||
* @author 段誉
|
||||
* @date 2023/3/6 11:49
|
||||
*/
|
||||
protected function getEncryData($key, $value)
|
||||
{
|
||||
// 非隐藏字段
|
||||
if (in_array($key, $this->excludeParams)) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
// 隐藏字段
|
||||
if (is_string($value)) {
|
||||
return '******';
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
declare (strict_types=1);
|
||||
|
||||
namespace app\adminapi\http\middleware;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\common\exception\ControllerExtendException;
|
||||
use think\exception\ClassNotFoundException;
|
||||
use think\exception\HttpException;
|
||||
|
||||
/**
|
||||
* 初始化验证中间件
|
||||
* Class InitMiddleware
|
||||
* @package app\adminapi\http\middleware
|
||||
*/
|
||||
class InitMiddleware
|
||||
{
|
||||
/**
|
||||
* @notes 初始化
|
||||
* @param $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
* @author 令狐冲
|
||||
* @date 2021/7/2 19:29
|
||||
*/
|
||||
public function handle($request, \Closure $next)
|
||||
{
|
||||
//获取控制器
|
||||
try {
|
||||
$controller = str_replace('.', '\\', $request->controller());
|
||||
$controller = '\\app\\adminapi\\controller\\' . $controller . 'Controller';
|
||||
$controllerClass = invoke($controller);
|
||||
if (($controllerClass instanceof BaseAdminController) === false) {
|
||||
throw new ControllerExtendException($controller, '404');
|
||||
}
|
||||
} catch (ClassNotFoundException $e) {
|
||||
throw new HttpException(404, 'controller not exists:' . $e->getClass());
|
||||
}
|
||||
|
||||
//创建控制器对象
|
||||
$request->controllerObject = invoke($controller);
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
declare (strict_types=1);
|
||||
|
||||
namespace app\adminapi\http\middleware;
|
||||
|
||||
use app\common\cache\AdminTokenCache;
|
||||
use app\adminapi\service\AdminTokenService;
|
||||
use app\common\service\JsonService;
|
||||
use think\facade\Config;
|
||||
|
||||
/**
|
||||
* 登录中间件
|
||||
* Class LoginMiddleware
|
||||
* @package app\adminapi\http\middleware
|
||||
*/
|
||||
class LoginMiddleware
|
||||
{
|
||||
/**
|
||||
* @notes 登录验证
|
||||
* @param $request
|
||||
* @param \Closure $next
|
||||
* @return mixed|\think\response\Json
|
||||
* @author 令狐冲
|
||||
* @date 2021/7/1 17:33
|
||||
*/
|
||||
public function handle($request, \Closure $next)
|
||||
{
|
||||
$token = $request->header('token');
|
||||
//判断接口是否免登录
|
||||
$isNotNeedLogin = $request->controllerObject->isNotNeedLogin();
|
||||
|
||||
//不直接判断$isNotNeedLogin结果,使不需要登录的接口通过,为了兼容某些接口可以登录或不登录访问
|
||||
if (empty($token) && !$isNotNeedLogin) {
|
||||
//没有token并且该地址需要登录才能访问
|
||||
return JsonService::fail('请求参数缺token', [], 0, 0);
|
||||
}
|
||||
|
||||
$adminInfo = (new AdminTokenCache())->getAdminInfo($token);
|
||||
if (empty($adminInfo) && !$isNotNeedLogin) {
|
||||
//token过期无效并且该地址需要登录才能访问
|
||||
return JsonService::fail('登录超时,请重新登录', [], -1);
|
||||
}
|
||||
|
||||
//token临近过期,自动续期
|
||||
if ($adminInfo) {
|
||||
//获取临近过期自动续期时长
|
||||
$beExpireDuration = Config::get('project.admin_token.be_expire_duration');
|
||||
//token续期
|
||||
if (time() > ($adminInfo['expire_time'] - $beExpireDuration)) {
|
||||
$result = AdminTokenService::overtimeToken($token);
|
||||
//续期失败(数据表被删除导致)
|
||||
if (empty($result)) {
|
||||
return JsonService::fail('登录过期', [], -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//给request赋值,用于控制器
|
||||
$request->adminInfo = $adminInfo;
|
||||
$request->adminId = $adminInfo['admin_id'] ?? 0;
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\adminapi\listener;
|
||||
|
||||
|
||||
use ReflectionClass;
|
||||
use think\Exception;
|
||||
|
||||
class OperationLog
|
||||
{
|
||||
/**
|
||||
* @notes 管理员操作日志
|
||||
* @param $response
|
||||
* @return bool|void
|
||||
* @throws \ReflectionException
|
||||
* @author 段誉
|
||||
* @date 2022/4/8 17:09
|
||||
*/
|
||||
public function handle($response)
|
||||
{
|
||||
$request = request();
|
||||
|
||||
//需要登录的接口,无效访问时不记录
|
||||
if (!$request->controllerObject->isNotNeedLogin() && empty($request->adminInfo)) {
|
||||
return;
|
||||
}
|
||||
|
||||
//不记录日志操作
|
||||
if (strtolower(str_replace('.', '\\', $request->controller())) === 'setting\system\log') {
|
||||
return;
|
||||
}
|
||||
|
||||
//获取操作注解
|
||||
$notes = '';
|
||||
try {
|
||||
$re = new ReflectionClass($request->controllerObject);
|
||||
$doc = $re->getMethod($request->action())->getDocComment();
|
||||
if (empty($doc)) {
|
||||
throw new Exception('请给控制器方法注释');
|
||||
}
|
||||
preg_match('/\s(\w+)/u', $re->getMethod($request->action())->getDocComment(), $values);
|
||||
$notes = $values[0];
|
||||
} catch (Exception $e) {
|
||||
$notes = $notes ?: '无法获取操作名称,请给控制器方法注释';
|
||||
}
|
||||
|
||||
$params = $request->param();
|
||||
|
||||
//过滤密码参数
|
||||
if (isset($params['password'])) {
|
||||
$params['password'] = "******";
|
||||
}
|
||||
//过滤密钥参数
|
||||
if(isset($params['app_secret'])){
|
||||
$params['app_secret'] = "******";
|
||||
}
|
||||
|
||||
//导出数据操作进行记录
|
||||
if (isset($params['export']) && $params['export'] == 2) {
|
||||
$notes .= '-数据导出';
|
||||
}
|
||||
|
||||
//记录日志
|
||||
$systemLog = new \app\common\model\OperationLog();
|
||||
$systemLog->admin_id = $request->adminInfo['admin_id'] ?? 0;
|
||||
$systemLog->admin_name = $request->adminInfo['name'] ?? '';
|
||||
$systemLog->action = $notes;
|
||||
$systemLog->account = $request->adminInfo['account'] ?? '';
|
||||
$systemLog->url = $request->url(true);
|
||||
$systemLog->type = $request->isGet() ? 'GET' : 'POST';
|
||||
$systemLog->params = json_encode($params, true);
|
||||
$systemLog->ip = $request->ip();
|
||||
$systemLog->result = $response->getContent();
|
||||
return $systemLog->save();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace app\adminapi\lists;
|
||||
|
||||
|
||||
use app\common\lists\BaseDataLists;
|
||||
|
||||
/**
|
||||
* 管理员模块数据列表基类
|
||||
* Class BaseAdminDataLists
|
||||
* @package app\adminapi\lists
|
||||
*/
|
||||
abstract class BaseAdminDataLists extends BaseDataLists
|
||||
{
|
||||
protected array $adminInfo;
|
||||
protected int $adminId;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->adminInfo = $this->request->adminInfo;
|
||||
$this->adminId = $this->request->adminId;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\lists\ai;
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\model\ai\AiAnalysis;
|
||||
|
||||
class AiAnalysisLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['type', 'status'],
|
||||
];
|
||||
}
|
||||
|
||||
public function lists(): array
|
||||
{
|
||||
$lists = AiAnalysis::where($this->searchWhere)
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order('id', 'desc')
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
foreach ($lists as &$item) {
|
||||
$item['create_time'] = is_numeric($item['create_time']) ? date('Y-m-d H:i:s', $item['create_time']) : $item['create_time'];
|
||||
$item['expire_time'] = !empty($item['expire_time']) && is_numeric($item['expire_time']) ? date('Y-m-d H:i:s', $item['expire_time']) : $item['expire_time'];
|
||||
}
|
||||
|
||||
return $lists;
|
||||
}
|
||||
|
||||
public function count(): int
|
||||
{
|
||||
return AiAnalysis::where($this->searchWhere)->count();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\lists\ai;
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\model\ai\AiConfig;
|
||||
|
||||
class AiConfigLists extends BaseAdminDataLists
|
||||
{
|
||||
public function lists(): array
|
||||
{
|
||||
return AiConfig::limit($this->limitOffset, $this->limitLength)
|
||||
->order('id', 'asc')
|
||||
->select()
|
||||
->toArray();
|
||||
}
|
||||
|
||||
public function count(): int
|
||||
{
|
||||
return AiConfig::count();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\lists\ai;
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\model\ai\AiLog;
|
||||
|
||||
class AiLogLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['type', 'status', 'user_id'],
|
||||
];
|
||||
}
|
||||
|
||||
public function lists(): array
|
||||
{
|
||||
$lists = AiLog::where($this->searchWhere)
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order('id', 'desc')
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
foreach ($lists as &$item) {
|
||||
$item['create_time'] = !empty($item['create_time']) && is_numeric($item['create_time']) ? date('Y-m-d H:i:s', $item['create_time']) : ($item['create_time'] ?: '-');
|
||||
}
|
||||
|
||||
return $lists;
|
||||
}
|
||||
|
||||
public function count(): int
|
||||
{
|
||||
return AiLog::where($this->searchWhere)->count();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\lists\ai;
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\model\ai\AiConfig;
|
||||
|
||||
class KbConfigLists extends BaseAdminDataLists
|
||||
{
|
||||
public function lists(): array
|
||||
{
|
||||
return AiConfig::where(function ($query) {
|
||||
$query->whereLike('name', 'embedding_%')
|
||||
->whereOrLike('name', 'kb_%')
|
||||
->whereOrLike('name', 'qwen_%')
|
||||
->whereOrLike('name', 'openai_%')
|
||||
->whereOrLike('name', 'mtranserver_%')
|
||||
->whereOrLike('name', 'assistant_%')
|
||||
->whereOr('name', '=', 'post_analysis_prompt');
|
||||
})->limit($this->limitOffset, $this->limitLength)
|
||||
->order('id', 'asc')
|
||||
->select()
|
||||
->toArray();
|
||||
}
|
||||
|
||||
public function count(): int
|
||||
{
|
||||
return AiConfig::where(function ($query) {
|
||||
$query->whereLike('name', 'embedding_%')
|
||||
->whereOrLike('name', 'kb_%')
|
||||
->whereOrLike('name', 'qwen_%')
|
||||
->whereOrLike('name', 'openai_%')
|
||||
->whereOrLike('name', 'mtranserver_%')
|
||||
->whereOrLike('name', 'assistant_%')
|
||||
->whereOr('name', '=', 'post_analysis_prompt');
|
||||
})->count();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\lists\ai;
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\model\ai\AiKbDocument;
|
||||
|
||||
class KbDocumentLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['domain', 'subtype', 'is_active'],
|
||||
'%like%' => ['title', 'keywords'],
|
||||
];
|
||||
}
|
||||
|
||||
public function lists(): array
|
||||
{
|
||||
$lists = AiKbDocument::where($this->searchWhere)
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order('id', 'desc')
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
foreach ($lists as &$item) {
|
||||
$item['source_updated_at_text'] = !empty($item['source_updated_at']) ? date('Y-m-d H:i:s', (int) $item['source_updated_at']) : '-';
|
||||
$item['update_time_text'] = !empty($item['update_time']) ? date('Y-m-d H:i:s', (int) $item['update_time']) : '-';
|
||||
}
|
||||
|
||||
return $lists;
|
||||
}
|
||||
|
||||
public function count(): int
|
||||
{
|
||||
return AiKbDocument::where($this->searchWhere)->count();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\lists\ai;
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\model\ai\AiKbQueryLog;
|
||||
|
||||
class KbQueryLogLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['scene', 'status', 'user_id'],
|
||||
'%like%' => ['query_text'],
|
||||
];
|
||||
}
|
||||
|
||||
public function lists(): array
|
||||
{
|
||||
$lists = AiKbQueryLog::where($this->searchWhere)
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order('id', 'desc')
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
foreach ($lists as &$item) {
|
||||
$item['create_time_text'] = !empty($item['create_time']) ? date('Y-m-d H:i:s', (int) $item['create_time']) : '-';
|
||||
}
|
||||
|
||||
return $lists;
|
||||
}
|
||||
|
||||
public function count(): int
|
||||
{
|
||||
return AiKbQueryLog::where($this->searchWhere)->count();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\lists\ai;
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\model\ai\AiKbSyncJob;
|
||||
|
||||
class KbSyncJobLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['domain', 'subtype', 'action', 'status'],
|
||||
];
|
||||
}
|
||||
|
||||
public function lists(): array
|
||||
{
|
||||
$lists = AiKbSyncJob::where($this->searchWhere)
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order('id', 'desc')
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
foreach ($lists as &$item) {
|
||||
$item['scheduled_at_text'] = !empty($item['scheduled_at']) ? date('Y-m-d H:i:s', (int) $item['scheduled_at']) : '-';
|
||||
$item['processed_at_text'] = !empty($item['processed_at']) ? date('Y-m-d H:i:s', (int) $item['processed_at']) : '-';
|
||||
}
|
||||
|
||||
return $lists;
|
||||
}
|
||||
|
||||
public function count(): int
|
||||
{
|
||||
return AiKbSyncJob::where($this->searchWhere)->count();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\lists\app;
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\model\app\AppVersion;
|
||||
|
||||
/**
|
||||
* APP 版本列表
|
||||
* Class AppVersionLists
|
||||
* @package app\adminapi\lists\app
|
||||
*/
|
||||
class AppVersionLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'%like%' => ['version_name', 'title'],
|
||||
'=' => ['platform', 'package_type', 'update_type', 'status'],
|
||||
];
|
||||
}
|
||||
|
||||
public function lists(): array
|
||||
{
|
||||
return AppVersion::where($this->searchWhere)
|
||||
->append(['platform_text', 'package_type_text', 'update_type_text'])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()
|
||||
->toArray();
|
||||
}
|
||||
|
||||
public function count(): int
|
||||
{
|
||||
return AppVersion::where($this->searchWhere)->count();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\lists\article;
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\model\article\ArticleAiCommentTask;
|
||||
use app\common\model\user\User;
|
||||
|
||||
class ArticleAiCommentTaskLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['article_id', 'status'],
|
||||
'%like%' => [],
|
||||
];
|
||||
}
|
||||
|
||||
public function lists(): array
|
||||
{
|
||||
$lists = ArticleAiCommentTask::where($this->searchWhere)
|
||||
->whereNull('delete_time')
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order('id', 'desc')
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
$userIds = array_unique(array_column($lists, 'virtual_user_id'));
|
||||
$users = [];
|
||||
if (!empty($userIds)) {
|
||||
$users = User::whereIn('id', $userIds)->column('nickname', 'id');
|
||||
}
|
||||
|
||||
foreach ($lists as &$item) {
|
||||
$item['virtual_nickname'] = $users[$item['virtual_user_id']] ?? '-';
|
||||
$item['create_time_text'] = is_numeric($item['create_time']) ? date('Y-m-d H:i:s', $item['create_time']) : $item['create_time'];
|
||||
$item['run_at_text'] = is_numeric($item['run_at']) ? date('Y-m-d H:i:s', $item['run_at']) : $item['run_at'];
|
||||
}
|
||||
|
||||
return $lists;
|
||||
}
|
||||
|
||||
public function count(): int
|
||||
{
|
||||
return ArticleAiCommentTask::where($this->searchWhere)
|
||||
->whereNull('delete_time')
|
||||
->count();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\lists\article;
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\lists\ListsSortInterface;
|
||||
use app\common\model\article\ArticleCate;
|
||||
|
||||
/**
|
||||
* 资讯分类列表
|
||||
* Class ArticleCateLists
|
||||
* @package app\adminapi\lists\article
|
||||
*/
|
||||
class ArticleCateLists extends BaseAdminDataLists implements ListsSearchInterface, ListsSortInterface
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置搜索条件
|
||||
* @return array
|
||||
* @author heshihu
|
||||
* @date 2022/2/8 18:39
|
||||
*/
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 设置支持排序字段
|
||||
* @return array
|
||||
* @author heshihu
|
||||
* @date 2022/2/9 15:11
|
||||
*/
|
||||
public function setSortFields(): array
|
||||
{
|
||||
return ['create_time' => 'create_time', 'id' => 'id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 设置默认排序
|
||||
* @return array
|
||||
* @author heshihu
|
||||
* @date 2022/2/9 15:08
|
||||
*/
|
||||
public function setDefaultOrder(): array
|
||||
{
|
||||
return ['sort' => 'desc', 'id' => 'desc'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 获取管理列表
|
||||
* @return array
|
||||
* @author heshihu
|
||||
* @date 2022/2/21 17:11
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
$lists = ArticleCate::where($this->searchWhere)
|
||||
->append(['is_show_desc', 'article_count'])
|
||||
->order($this->sortOrder)
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
$pid = 0;
|
||||
if (!empty($lists)) {
|
||||
$pid = min(array_column($lists, 'pid'));
|
||||
}
|
||||
return self::getTree($lists, $pid);
|
||||
}
|
||||
|
||||
public static function getTree($array, $pid = 0)
|
||||
{
|
||||
$list = [];
|
||||
foreach ($array as $item) {
|
||||
if ($item['pid'] == $pid) {
|
||||
$item['children'] = self::getTree($array, $item['id']);
|
||||
$list[] = $item;
|
||||
}
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 获取数量
|
||||
* @return int
|
||||
* @author heshihu
|
||||
* @date 2022/2/9 15:12
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return ArticleCate::where($this->searchWhere)->count();
|
||||
}
|
||||
|
||||
public function extend()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\lists\article;
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\lists\ListsSortInterface;
|
||||
use app\common\model\article\Article;
|
||||
|
||||
/**
|
||||
* 资讯列表
|
||||
* Class ArticleLists
|
||||
* @package app\adminapi\lists\article
|
||||
*/
|
||||
class ArticleLists extends BaseAdminDataLists implements ListsSearchInterface, ListsSortInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 设置搜索条件
|
||||
* @return array
|
||||
* @author heshihu
|
||||
* @date 2022/2/8 18:39
|
||||
*/
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'%like%' => ['title'],
|
||||
'=' => ['cid', 'is_show', 'is_recommend']
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 设置支持排序字段
|
||||
* @return array
|
||||
* @author heshihu
|
||||
* @date 2022/2/9 15:11
|
||||
*/
|
||||
public function setSortFields(): array
|
||||
{
|
||||
return ['create_time' => 'create_time', 'id' => 'id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 设置默认排序
|
||||
* @return array
|
||||
* @author heshihu
|
||||
* @date 2022/2/9 15:08
|
||||
*/
|
||||
public function setDefaultOrder(): array
|
||||
{
|
||||
return ['sort' => 'desc', 'id' => 'desc'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 获取管理列表
|
||||
* @return array
|
||||
* @author heshihu
|
||||
* @date 2022/2/21 17:11
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
$ArticleLists = Article::where($this->searchWhere)
|
||||
->append(['cate_name', 'click'])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order($this->sortOrder)
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
return $ArticleLists;
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 获取数量
|
||||
* @return int
|
||||
* @author heshihu
|
||||
* @date 2022/2/9 15:12
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return Article::where($this->searchWhere)->count();
|
||||
}
|
||||
|
||||
public function extend()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,206 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\lists\auth;
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\lists\ListsExcelInterface;
|
||||
use app\common\lists\ListsExtendInterface;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\lists\ListsSortInterface;
|
||||
use app\common\model\auth\Admin;
|
||||
use app\common\model\auth\AdminRole;
|
||||
use app\common\model\auth\SystemRole;
|
||||
use app\common\model\dept\Dept;
|
||||
use app\common\model\dept\Jobs;
|
||||
|
||||
/**
|
||||
* 管理员列表
|
||||
* Class AdminLists
|
||||
* @package app\adminapi\lists\auth
|
||||
*/
|
||||
class AdminLists extends BaseAdminDataLists implements ListsExtendInterface, ListsSearchInterface, ListsSortInterface,ListsExcelInterface
|
||||
{
|
||||
/**
|
||||
* @notes 设置导出字段
|
||||
* @return string[]
|
||||
* @author 段誉
|
||||
* @date 2021/12/29 10:08
|
||||
*/
|
||||
public function setExcelFields(): array
|
||||
{
|
||||
return [
|
||||
'account' => '账号',
|
||||
'name' => '名称',
|
||||
'role_name' => '角色',
|
||||
'dept_name' => '部门',
|
||||
'create_time' => '创建时间',
|
||||
'login_time' => '最近登录时间',
|
||||
'login_ip' => '最近登录IP',
|
||||
'disable_desc' => '状态',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置导出文件名
|
||||
* @return string
|
||||
* @author 段誉
|
||||
* @date 2021/12/29 10:08
|
||||
*/
|
||||
public function setFileName(): string
|
||||
{
|
||||
return '管理员列表';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置搜索条件
|
||||
* @return \string[][]
|
||||
* @author 段誉
|
||||
* @date 2021/12/29 10:07
|
||||
*/
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'%like%' => ['name', 'account'],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置支持排序字段
|
||||
* @return string[]
|
||||
* @author 段誉
|
||||
* @date 2021/12/29 10:07
|
||||
* @remark 格式: ['前端传过来的字段名' => '数据库中的字段名'];
|
||||
*/
|
||||
public function setSortFields(): array
|
||||
{
|
||||
return ['create_time' => 'create_time', 'id' => 'id'];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置默认排序
|
||||
* @return string[]
|
||||
* @author 段誉
|
||||
* @date 2021/12/29 10:06
|
||||
*/
|
||||
public function setDefaultOrder(): array
|
||||
{
|
||||
return ['id' => 'desc'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 查询条件
|
||||
* @return array
|
||||
* @author 段誉
|
||||
* @date 2022/11/29 11:33
|
||||
*/
|
||||
public function queryWhere()
|
||||
{
|
||||
$where = [];
|
||||
if (isset($this->params['role_id']) && $this->params['role_id'] != '') {
|
||||
$adminIds = AdminRole::where('role_id', $this->params['role_id'])->column('admin_id');
|
||||
if (!empty($adminIds)) {
|
||||
$where[] = ['id', 'in', $adminIds];
|
||||
}
|
||||
}
|
||||
return $where;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取管理列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author 段誉
|
||||
* @date 2021/12/29 10:05
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
$field = [
|
||||
'id', 'name', 'account', 'create_time', 'disable', 'root',
|
||||
'login_time', 'login_ip', 'multipoint_login', 'avatar'
|
||||
];
|
||||
|
||||
$adminLists = Admin::field($field)
|
||||
->where($this->searchWhere)
|
||||
->where($this->queryWhere())
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order($this->sortOrder)
|
||||
->append(['role_id', 'dept_id', 'jobs_id', 'disable_desc'])
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
// 角色数组('角色id'=>'角色名称')
|
||||
$roleLists = SystemRole::column('name', 'id');
|
||||
// 部门列表
|
||||
$deptLists = Dept::column('name', 'id');
|
||||
// 岗位列表
|
||||
$jobsLists = Jobs::column('name', 'id');
|
||||
|
||||
//管理员列表增加角色名称
|
||||
foreach ($adminLists as $k => $v) {
|
||||
$roleName = '';
|
||||
if ($v['root'] == 1) {
|
||||
$roleName = '系统管理员';
|
||||
} else {
|
||||
foreach ($v['role_id'] as $roleId) {
|
||||
$roleName .= $roleLists[$roleId] ?? '';
|
||||
$roleName .= '/';
|
||||
}
|
||||
}
|
||||
|
||||
$deptName = '';
|
||||
foreach ($v['dept_id'] as $deptId) {
|
||||
$deptName .= $deptLists[$deptId] ?? '';
|
||||
$deptName .= '/';
|
||||
}
|
||||
|
||||
$jobsName = '';
|
||||
foreach ($v['jobs_id'] as $jobsId) {
|
||||
$jobsName .= $jobsLists[$jobsId] ?? '';
|
||||
$jobsName .= '/';
|
||||
}
|
||||
|
||||
$adminLists[$k]['role_name'] = trim($roleName, '/');
|
||||
$adminLists[$k]['dept_name'] = trim($deptName, '/');
|
||||
$adminLists[$k]['jobs_name'] = trim($jobsName, '/');
|
||||
}
|
||||
|
||||
return $adminLists;
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 获取数量
|
||||
* @return int
|
||||
* @author 令狐冲
|
||||
* @date 2021/7/13 00:52
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return Admin::where($this->searchWhere)
|
||||
->where($this->queryWhere())
|
||||
->count();
|
||||
}
|
||||
|
||||
public function extend()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\lists\auth;
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\model\auth\SystemMenu;
|
||||
|
||||
|
||||
/**
|
||||
* 菜单列表
|
||||
* Class MenuLists
|
||||
* @package app\adminapi\lists\auth
|
||||
*/
|
||||
class MenuLists extends BaseAdminDataLists
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 获取菜单列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author 段誉
|
||||
* @date 2022/6/29 16:41
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
$lists = SystemMenu::order(['sort' => 'desc', 'id' => 'asc'])
|
||||
->select()
|
||||
->toArray();
|
||||
return linear_to_tree($lists, 'children');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取菜单数量
|
||||
* @return int
|
||||
* @author 段誉
|
||||
* @date 2022/6/29 16:41
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return SystemMenu::count();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\lists\auth;
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\model\auth\AdminRole;
|
||||
use app\common\model\auth\SystemRole;
|
||||
|
||||
/**
|
||||
* 角色列表
|
||||
* Class RoleLists
|
||||
* @package app\adminapi\lists\auth
|
||||
*/
|
||||
class RoleLists extends BaseAdminDataLists
|
||||
{
|
||||
/**
|
||||
* @notes 导出字段
|
||||
* @return string[]
|
||||
* @author Tab
|
||||
* @date 2021/9/22 18:52
|
||||
*/
|
||||
public function setExcelFields(): array
|
||||
{
|
||||
return [
|
||||
'name' => '角色名称',
|
||||
'desc' => '备注',
|
||||
'create_time' => '创建时间'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 导出表名
|
||||
* @return string
|
||||
* @author Tab
|
||||
* @date 2021/9/22 18:52
|
||||
*/
|
||||
public function setFileName(): string
|
||||
{
|
||||
return '角色表';
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 角色列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author cjhao
|
||||
* @date 2021/8/25 18:00
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
$lists = SystemRole::with(['role_menu_index'])
|
||||
->field('id,name,desc,sort,create_time')
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['sort' => 'desc', 'id' => 'desc'])
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
foreach ($lists as $key => $role) {
|
||||
//使用角色的人数
|
||||
$lists[$key]['num'] = AdminRole::where('role_id', $role['id'])->count();
|
||||
$menuId = array_column($role['role_menu_index'], 'menu_id');
|
||||
$lists[$key]['menu_id'] = $menuId;
|
||||
unset($lists[$key]['role_menu_index']);
|
||||
}
|
||||
|
||||
return $lists;
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 总记录数
|
||||
* @return int
|
||||
* @author Tab
|
||||
* @date 2021/7/13 11:26
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return SystemRole::count();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\lists\channel;
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\model\channel\OfficialAccountReply;
|
||||
|
||||
/**
|
||||
* 微信公众号回复列表
|
||||
* Class OfficialAccountLists
|
||||
* @package app\adminapi\lists
|
||||
*/
|
||||
class OfficialAccountReplyLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 设置搜索
|
||||
* @return \string[][]
|
||||
* @author 段誉
|
||||
* @date 2022/3/30 15:02
|
||||
*/
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['reply_type']
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 回复列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author 段誉
|
||||
* @date 2022/3/30 15:02
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
$field = 'id,name,keyword,matching_type,content,content_type,status,sort';
|
||||
$field .= ',matching_type as matching_type_desc,content_type as content_type_desc,status as status_desc';
|
||||
|
||||
$lists = OfficialAccountReply::field($field)
|
||||
->where($this->searchWhere)
|
||||
->order(['sort' => 'desc', 'id' => 'desc'])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
return $lists;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 回复记录数
|
||||
* @return int
|
||||
* @author 段誉
|
||||
* @date 2022/3/30 15:02
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
$count = OfficialAccountReply::where($this->searchWhere)->count();
|
||||
|
||||
return $count;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\lists\community;
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\model\community\CommunityComment;
|
||||
use app\common\model\community\CommunityPost;
|
||||
use app\common\model\user\User;
|
||||
|
||||
class CommunityCommentLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['post_id', 'user_id', 'status'],
|
||||
];
|
||||
}
|
||||
|
||||
public function lists(): array
|
||||
{
|
||||
$lists = CommunityComment::where($this->searchWhere)
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order('id', 'desc')
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
$userIds = array_unique(array_column($lists, 'user_id'));
|
||||
$users = User::whereIn('id', $userIds)->column('nickname,avatar', 'id');
|
||||
|
||||
$postIds = array_unique(array_column($lists, 'post_id'));
|
||||
$posts = CommunityPost::whereIn('id', $postIds)->column('content,user_id', 'id');
|
||||
|
||||
foreach ($lists as &$item) {
|
||||
$user = $users[$item['user_id']] ?? [];
|
||||
$item['nickname'] = $user['nickname'] ?? '-';
|
||||
$item['create_time'] = is_numeric($item['create_time']) ? date('Y-m-d H:i:s', $item['create_time']) : $item['create_time'];
|
||||
$post = $posts[$item['post_id']] ?? [];
|
||||
$item['post_content'] = isset($post['content']) ? mb_substr($post['content'], 0, 50) : '-';
|
||||
$postUser = !empty($post['user_id']) ? (User::field('nickname')->findOrEmpty($post['user_id'])->toArray()) : [];
|
||||
$item['post_nickname'] = $postUser['nickname'] ?? '-';
|
||||
}
|
||||
|
||||
return $lists;
|
||||
}
|
||||
|
||||
public function count(): int
|
||||
{
|
||||
return CommunityComment::where($this->searchWhere)->count();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\lists\community;
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\model\community\CommunityPost;
|
||||
use app\common\model\user\User;
|
||||
|
||||
class CommunityPostLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['status', 'post_type', 'is_top', 'is_hot', 'is_recommend', 'user_id'],
|
||||
];
|
||||
}
|
||||
|
||||
public function lists(): array
|
||||
{
|
||||
$lists = CommunityPost::where($this->searchWhere)
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order('id', 'desc')
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
$userIds = array_unique(array_column($lists, 'user_id'));
|
||||
$users = User::whereIn('id', $userIds)->column('nickname,avatar', 'id');
|
||||
|
||||
foreach ($lists as &$item) {
|
||||
$user = $users[$item['user_id']] ?? [];
|
||||
$item['nickname'] = $user['nickname'] ?? '-';
|
||||
$item['avatar'] = $user['avatar'] ?? '';
|
||||
$item['create_time'] = is_numeric($item['create_time']) ? date('Y-m-d H:i:s', $item['create_time']) : $item['create_time'];
|
||||
}
|
||||
|
||||
return $lists;
|
||||
}
|
||||
|
||||
public function count(): int
|
||||
{
|
||||
return CommunityPost::where($this->searchWhere)->count();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\lists\community;
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\model\community\CommunityTag;
|
||||
|
||||
class CommunityTagLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'%like%' => ['name'],
|
||||
'=' => ['status'],
|
||||
];
|
||||
}
|
||||
|
||||
public function lists(): array
|
||||
{
|
||||
return CommunityTag::where($this->searchWhere)
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order('sort', 'desc')
|
||||
->order('id', 'desc')
|
||||
->select()
|
||||
->toArray();
|
||||
}
|
||||
|
||||
public function count(): int
|
||||
{
|
||||
return CommunityTag::where($this->searchWhere)->count();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\lists\crawler;
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\model\CrawlErrorLog;
|
||||
|
||||
class CrawlErrorLogLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['task_name', 'error_type', 'channel', 'http_status'],
|
||||
];
|
||||
}
|
||||
|
||||
public function lists(): array
|
||||
{
|
||||
$lists = CrawlErrorLog::field('id,task_name,request_url,request_method,http_status,error_type,error_message,channel,notified,created_at')
|
||||
->where($this->searchWhere)
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order('id', 'desc')
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
return $lists;
|
||||
}
|
||||
|
||||
public function count(): int
|
||||
{
|
||||
return CrawlErrorLog::where($this->searchWhere)->count();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\lists\crontab;
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\model\Crontab;
|
||||
|
||||
/**
|
||||
* 定时任务列表
|
||||
* Class CrontabLists
|
||||
* @package app\adminapi\lists\crontab
|
||||
*/
|
||||
class CrontabLists extends BaseAdminDataLists
|
||||
{
|
||||
/**
|
||||
* @notes 定时任务列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 14:30
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
$field = 'id,name,type,type as type_desc,command,params,expression,
|
||||
status,status as status_desc,error,last_time,time,max_time';
|
||||
|
||||
$lists = Crontab::field($field)
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order('id', 'desc')
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
return $lists;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 定时任务数量
|
||||
* @return int
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 14:38
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return Crontab::count();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\lists\decorate;
|
||||
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\enum\MenuEnum;
|
||||
use app\common\model\decorate\Menu;
|
||||
|
||||
/**
|
||||
* 菜单列表
|
||||
* Class MenuLists
|
||||
* @package app\adminapi\lists\decorate
|
||||
*/
|
||||
class MenuLists extends BaseAdminDataLists
|
||||
{
|
||||
/**
|
||||
* @notes 菜单列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author ljj
|
||||
* @date 2022/2/14 11:29 上午
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
$lists = (new Menu())->field('id,name,image,link_type,link_address,sort,status')
|
||||
->order(['sort'=>'asc','id'=>'desc'])
|
||||
->append(['link_address_desc','status_desc'])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
foreach ($lists as &$list) {
|
||||
$list['link_address_desc'] = MenuEnum::getLinkDesc($list['link_type']).':'.$list['link_address_desc'];
|
||||
}
|
||||
|
||||
return $lists;
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 菜单总数
|
||||
* @return int
|
||||
* @author ljj
|
||||
* @date 2022/2/14 11:29 上午
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return (new Menu())->count();
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user