first commit
This commit is contained in:
1
.example.env
Normal file
1
.example.env
Normal file
@@ -0,0 +1 @@
|
|||||||
|
APP_DEBUG = true
|
||||||
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
/.idea
|
||||||
|
/.vscode
|
||||||
|
*.log
|
||||||
|
/.env
|
||||||
|
/runtime/*
|
||||||
|
/config/install.lock
|
||||||
42
.travis.yml
Normal file
42
.travis.yml
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
sudo: false
|
||||||
|
|
||||||
|
language: php
|
||||||
|
|
||||||
|
branches:
|
||||||
|
only:
|
||||||
|
- stable
|
||||||
|
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- $HOME/.composer/cache
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
- composer self-update
|
||||||
|
|
||||||
|
install:
|
||||||
|
- composer install --no-dev --no-interaction --ignore-platform-reqs
|
||||||
|
- zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Core.zip .
|
||||||
|
- composer require --update-no-dev --no-interaction "topthink/think-image:^1.0"
|
||||||
|
- composer require --update-no-dev --no-interaction "topthink/think-migration:^1.0"
|
||||||
|
- composer require --update-no-dev --no-interaction "topthink/think-captcha:^1.0"
|
||||||
|
- composer require --update-no-dev --no-interaction "topthink/think-mongo:^1.0"
|
||||||
|
- composer require --update-no-dev --no-interaction "topthink/think-worker:^1.0"
|
||||||
|
- composer require --update-no-dev --no-interaction "topthink/think-helper:^1.0"
|
||||||
|
- composer require --update-no-dev --no-interaction "topthink/think-queue:^1.0"
|
||||||
|
- composer require --update-no-dev --no-interaction "topthink/think-angular:^1.0"
|
||||||
|
- composer require --dev --update-no-dev --no-interaction "topthink/think-testing:^1.0"
|
||||||
|
- zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Full.zip .
|
||||||
|
|
||||||
|
script:
|
||||||
|
- php think unit
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
provider: releases
|
||||||
|
api_key:
|
||||||
|
secure: TSF6bnl2JYN72UQOORAJYL+CqIryP2gHVKt6grfveQ7d9rleAEoxlq6PWxbvTI4jZ5nrPpUcBUpWIJHNgVcs+bzLFtyh5THaLqm39uCgBbrW7M8rI26L8sBh/6nsdtGgdeQrO/cLu31QoTzbwuz1WfAVoCdCkOSZeXyT/CclH99qV6RYyQYqaD2wpRjrhA5O4fSsEkiPVuk0GaOogFlrQHx+C+lHnf6pa1KxEoN1A0UxxVfGX6K4y5g4WQDO5zT4bLeubkWOXK0G51XSvACDOZVIyLdjApaOFTwamPcD3S1tfvuxRWWvsCD5ljFvb2kSmx5BIBNwN80MzuBmrGIC27XLGOxyMerwKxB6DskNUO9PflKHDPI61DRq0FTy1fv70SFMSiAtUv9aJRT41NQh9iJJ0vC8dl+xcxrWIjU1GG6+l/ZcRqVx9V1VuGQsLKndGhja7SQ+X1slHl76fRq223sMOql7MFCd0vvvxVQ2V39CcFKao/LB1aPH3VhODDEyxwx6aXoTznvC/QPepgWsHOWQzKj9ftsgDbsNiyFlXL4cu8DWUty6rQy8zT2b4O8b1xjcwSUCsy+auEjBamzQkMJFNlZAIUrukL/NbUhQU37TAbwsFyz7X0E/u/VMle/nBCNAzgkMwAUjiHM6FqrKKBRWFbPrSIixjfjkCnrMEPw=
|
||||||
|
file:
|
||||||
|
- ThinkPHP_Core.zip
|
||||||
|
- ThinkPHP_Full.zip
|
||||||
|
skip_cleanup: true
|
||||||
|
on:
|
||||||
|
tags: true
|
||||||
32
LICENSE.txt
Normal file
32
LICENSE.txt
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
|
||||||
|
ThinkPHP遵循Apache2开源协议发布,并提供免费使用。
|
||||||
|
版权所有Copyright © 2006-2016 by ThinkPHP (http://thinkphp.cn)
|
||||||
|
All rights reserved。
|
||||||
|
ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。
|
||||||
|
|
||||||
|
Apache Licence是著名的非盈利开源组织Apache采用的协议。
|
||||||
|
该协议和BSD类似,鼓励代码共享和尊重原作者的著作权,
|
||||||
|
允许代码修改,再作为开源或商业软件发布。需要满足
|
||||||
|
的条件:
|
||||||
|
1. 需要给代码的用户一份Apache Licence ;
|
||||||
|
2. 如果你修改了代码,需要在被修改的文件中说明;
|
||||||
|
3. 在延伸的代码中(修改和有源代码衍生的代码中)需要
|
||||||
|
带有原来代码中的协议,商标,专利声明和其他原来作者规
|
||||||
|
定需要包含的说明;
|
||||||
|
4. 如果再发布的产品中包含一个Notice文件,则在Notice文
|
||||||
|
件中需要带有本协议内容。你可以在Notice中增加自己的
|
||||||
|
许可,但不可以表现为对Apache Licence构成更改。
|
||||||
|
具体的协议参考:http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
|
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
POSSIBILITY OF SUCH DAMAGE.
|
||||||
56
README.md
Normal file
56
README.md
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
ThinkPHP 6.0
|
||||||
|
===============
|
||||||
|
|
||||||
|
> 运行环境要求PHP7.1+,兼容PHP8.0。
|
||||||
|
|
||||||
|
[官方应用服务市场](https://market.topthink.com) | [`ThinkAPI`——官方统一API服务](https://docs.topthink.com/think-api)
|
||||||
|
|
||||||
|
ThinkPHPV6.0版本由[亿速云](https://www.yisu.com/)独家赞助发布。
|
||||||
|
|
||||||
|
## 主要新特性
|
||||||
|
|
||||||
|
* 采用`PHP7`强类型(严格模式)
|
||||||
|
* 支持更多的`PSR`规范
|
||||||
|
* 原生多应用支持
|
||||||
|
* 更强大和易用的查询
|
||||||
|
* 全新的事件系统
|
||||||
|
* 模型事件和数据库事件统一纳入事件系统
|
||||||
|
* 模板引擎分离出核心
|
||||||
|
* 内部功能中间件化
|
||||||
|
* SESSION/Cookie机制改进
|
||||||
|
* 对Swoole以及协程支持改进
|
||||||
|
* 对IDE更加友好
|
||||||
|
* 统一和精简大量用法
|
||||||
|
|
||||||
|
## 安装
|
||||||
|
|
||||||
|
~~~
|
||||||
|
composer create-project topthink/think tp 6.0.*
|
||||||
|
~~~
|
||||||
|
|
||||||
|
如果需要更新框架使用
|
||||||
|
~~~
|
||||||
|
composer update topthink/framework
|
||||||
|
~~~
|
||||||
|
|
||||||
|
## 文档
|
||||||
|
|
||||||
|
[完全开发手册](https://www.kancloud.cn/manual/thinkphp6_0/content)
|
||||||
|
|
||||||
|
## 参与开发
|
||||||
|
|
||||||
|
请参阅 [ThinkPHP 核心框架包](https://github.com/top-think/framework)。
|
||||||
|
|
||||||
|
## 版权信息
|
||||||
|
|
||||||
|
ThinkPHP遵循Apache2开源协议发布,并提供免费使用。
|
||||||
|
|
||||||
|
本项目包含的第三方源码和二进制文件之版权信息另行标注。
|
||||||
|
|
||||||
|
版权所有Copyright © 2006-2020 by ThinkPHP (http://thinkphp.cn)
|
||||||
|
|
||||||
|
All rights reserved。
|
||||||
|
|
||||||
|
ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。
|
||||||
|
|
||||||
|
更多细节参阅 [LICENSE.txt](LICENSE.txt)
|
||||||
1
app/.htaccess
Normal file
1
app/.htaccess
Normal file
@@ -0,0 +1 @@
|
|||||||
|
deny from all
|
||||||
22
app/AppService.php
Normal file
22
app/AppService.php
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
declare (strict_types = 1);
|
||||||
|
|
||||||
|
namespace app;
|
||||||
|
|
||||||
|
use think\Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应用服务类
|
||||||
|
*/
|
||||||
|
class AppService extends Service
|
||||||
|
{
|
||||||
|
public function register()
|
||||||
|
{
|
||||||
|
// 服务注册
|
||||||
|
}
|
||||||
|
|
||||||
|
public function boot()
|
||||||
|
{
|
||||||
|
// 服务启动
|
||||||
|
}
|
||||||
|
}
|
||||||
95
app/BaseController.php
Normal file
95
app/BaseController.php
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
<?php
|
||||||
|
declare (strict_types = 1);
|
||||||
|
|
||||||
|
namespace app;
|
||||||
|
|
||||||
|
use think\App;
|
||||||
|
use think\exception\ValidateException;
|
||||||
|
use think\Validate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 控制器基础类
|
||||||
|
*/
|
||||||
|
abstract class BaseController
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Request实例
|
||||||
|
* @var \think\Request
|
||||||
|
*/
|
||||||
|
protected $request;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应用实例
|
||||||
|
* @var \think\App
|
||||||
|
*/
|
||||||
|
protected $app;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否批量验证
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
protected $batchValidate = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 控制器中间件
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $middleware = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构造方法
|
||||||
|
* @access public
|
||||||
|
* @param App $app 应用对象
|
||||||
|
*/
|
||||||
|
public function __construct(App $app)
|
||||||
|
{
|
||||||
|
$this->app = $app;
|
||||||
|
$this->request = $this->app->request;
|
||||||
|
|
||||||
|
// 控制器初始化
|
||||||
|
$this->initialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化
|
||||||
|
protected function initialize()
|
||||||
|
{}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证数据
|
||||||
|
* @access protected
|
||||||
|
* @param array $data 数据
|
||||||
|
* @param string|array $validate 验证器名或者验证规则数组
|
||||||
|
* @param array $message 提示信息
|
||||||
|
* @param bool $batch 是否批量验证
|
||||||
|
* @return array|string|true
|
||||||
|
* @throws ValidateException
|
||||||
|
*/
|
||||||
|
protected function validate(array $data, $validate, array $message = [], bool $batch = false)
|
||||||
|
{
|
||||||
|
if (is_array($validate)) {
|
||||||
|
$v = new Validate();
|
||||||
|
$v->rule($validate);
|
||||||
|
} else {
|
||||||
|
if (strpos($validate, '.')) {
|
||||||
|
// 支持场景
|
||||||
|
[$validate, $scene] = explode('.', $validate);
|
||||||
|
}
|
||||||
|
$class = false !== strpos($validate, '\\') ? $validate : $this->app->parseClass('validate', $validate);
|
||||||
|
$v = new $class();
|
||||||
|
if (!empty($scene)) {
|
||||||
|
$v->scene($scene);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$v->message($message);
|
||||||
|
|
||||||
|
// 是否批量验证
|
||||||
|
if ($batch || $this->batchValidate) {
|
||||||
|
$v->batch(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $v->failException(true)->check($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
58
app/ExceptionHandle.php
Normal file
58
app/ExceptionHandle.php
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<?php
|
||||||
|
namespace app;
|
||||||
|
|
||||||
|
use think\db\exception\DataNotFoundException;
|
||||||
|
use think\db\exception\ModelNotFoundException;
|
||||||
|
use think\exception\Handle;
|
||||||
|
use think\exception\HttpException;
|
||||||
|
use think\exception\HttpResponseException;
|
||||||
|
use think\exception\ValidateException;
|
||||||
|
use think\Response;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应用异常处理类
|
||||||
|
*/
|
||||||
|
class ExceptionHandle extends Handle
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 不需要记录信息(日志)的异常类列表
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $ignoreReport = [
|
||||||
|
HttpException::class,
|
||||||
|
HttpResponseException::class,
|
||||||
|
ModelNotFoundException::class,
|
||||||
|
DataNotFoundException::class,
|
||||||
|
ValidateException::class,
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 记录异常信息(包括日志或者其它方式记录)
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @param Throwable $exception
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function report(Throwable $exception): void
|
||||||
|
{
|
||||||
|
// 使用内置的方式记录异常日志
|
||||||
|
parent::report($exception);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Render an exception into an HTTP response.
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @param \think\Request $request
|
||||||
|
* @param Throwable $e
|
||||||
|
* @return Response
|
||||||
|
*/
|
||||||
|
public function render($request, Throwable $e): Response
|
||||||
|
{
|
||||||
|
// 添加自定义异常处理机制
|
||||||
|
|
||||||
|
// 其他错误交给系统处理
|
||||||
|
return parent::render($request, $e);
|
||||||
|
}
|
||||||
|
}
|
||||||
9
app/Request.php
Normal file
9
app/Request.php
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
namespace app;
|
||||||
|
|
||||||
|
// 应用请求对象类
|
||||||
|
class Request extends \think\Request
|
||||||
|
{
|
||||||
|
// 全局过滤规则
|
||||||
|
protected $filter = ['trim'];
|
||||||
|
}
|
||||||
28
app/adminapi/config/route.php
Normal file
28
app/adminapi/config/route.php
Normal file
@@ -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,
|
||||||
|
],
|
||||||
|
];
|
||||||
40
app/adminapi/controller/BaseAdminController.php
Normal file
40
app/adminapi/controller/BaseAdminController.php
Normal file
@@ -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'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
73
app/adminapi/controller/ConfigController.php
Normal file
73
app/adminapi/controller/ConfigController.php
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
<?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','getAgentConfig','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
|
||||||
|
* @author 段誉
|
||||||
|
* @date 2021/12/31 11:01
|
||||||
|
*/
|
||||||
|
public function getAgentConfig()
|
||||||
|
{
|
||||||
|
$data = ConfigLogic::getAgentConfig();
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
50
app/adminapi/controller/DownloadController.php
Normal file
50
app/adminapi/controller/DownloadController.php
Normal file
@@ -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']);
|
||||||
|
}
|
||||||
|
}
|
||||||
137
app/adminapi/controller/FileController.php
Normal file
137
app/adminapi/controller/FileController.php
Normal file
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
61
app/adminapi/controller/LoginController.php
Normal file
61
app/adminapi/controller/LoginController.php
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\adminapi\controller;
|
||||||
|
|
||||||
|
use app\adminapi\logic\LoginLogic;
|
||||||
|
use app\adminapi\validate\{LoginValidate,LoginAgentValidate};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管理员登录控制器
|
||||||
|
* Class LoginController
|
||||||
|
* @package app\adminapi\controller
|
||||||
|
*/
|
||||||
|
class LoginController extends BaseAdminController
|
||||||
|
{
|
||||||
|
public array $notNeedLogin = ['account','agentAccount'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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 代理账号登录
|
||||||
|
* @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 agentAccount()
|
||||||
|
{
|
||||||
|
$params = (new LoginAgentValidate())->post()->goCheck();
|
||||||
|
return $this->data((new LoginLogic())->loginAgent($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();
|
||||||
|
}
|
||||||
|
}
|
||||||
480
app/adminapi/controller/NotifyController.php
Normal file
480
app/adminapi/controller/NotifyController.php
Normal file
@@ -0,0 +1,480 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\adminapi\controller;
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\common\model\finance\{RechargeRecord};
|
||||||
|
use app\common\model\user\{UserUdun,User};
|
||||||
|
use app\common\model\setting\RechargeMethod;
|
||||||
|
use app\common\service\{UtilsService,ConfigService};
|
||||||
|
use app\common\model\lh\{LhCoin};
|
||||||
|
use app\common\enum\YesNoEnum;
|
||||||
|
use think\facade\Db;
|
||||||
|
use Exception;
|
||||||
|
|
||||||
|
//清空数据
|
||||||
|
use app\common\model\withdraw\{WithdrawWallet,WithdrawMethod};
|
||||||
|
use app\common\model\setting\OperationLog;
|
||||||
|
use app\common\model\finance\{WithdrawRecord,UserFinance,UserTransferRecord};
|
||||||
|
use app\common\model\user\{UserTron,UserSigninRecord,UserSession,UserRelation,UserRelationAgent,UserKadan,UserGroupRecord,UserRewardRecord,UserNotice,UserInfo,UserLog,UserMineRecord};
|
||||||
|
use app\common\model\member\{UserMemberRecord};
|
||||||
|
use app\common\model\mall\{MallGoodsRecord};
|
||||||
|
use app\common\model\notice\{SmsLog,NoticeRecord,EmailRecord};
|
||||||
|
use app\common\model\goods\{GoodsRecord};
|
||||||
|
use app\common\model\auth\{AdminSession,AdminRole,AdminJobs,AdminDept,Admin,SystemRole,SystemRoleMenu};
|
||||||
|
use app\common\model\lh\{LhRecord};
|
||||||
|
use app\common\model\feedback\{FeedbackRecord};
|
||||||
|
use app\common\model\item\{ItemRecord};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 回调理控制器
|
||||||
|
* Class NotifyController
|
||||||
|
* @package app\adminapi\controller
|
||||||
|
*/
|
||||||
|
class NotifyController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
public array $notNeedLogin = ['market','clear','notify','test'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 清空数据,开发用,请注释掉
|
||||||
|
* @return string
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/04/13 10:54
|
||||||
|
*/
|
||||||
|
// public function clear(){
|
||||||
|
// Db::startTrans();
|
||||||
|
// try {
|
||||||
|
// //用户提现钱包
|
||||||
|
// $withdrawWallets = WithdrawWallet::select()->toArray();
|
||||||
|
// foreach ($withdrawWallets as &$withdrawWallet) {
|
||||||
|
// WithdrawWallet::destroy($withdrawWallet['id'],true);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// //用户提现记录
|
||||||
|
// $withdrawRecords = WithdrawRecord::select()->toArray();
|
||||||
|
// foreach ($withdrawRecords as &$withdrawRecord) {
|
||||||
|
// WithdrawRecord::destroy($withdrawRecord['id'],true);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// //用户Udun
|
||||||
|
// $userUduns = UserUdun::select()->toArray();
|
||||||
|
// foreach ($userUduns as &$userUdun) {
|
||||||
|
// UserUdun::destroy($userUdun['id'],true);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// //用户波场钱包
|
||||||
|
// $userTrons = UserTron::select()->toArray();
|
||||||
|
// foreach ($userTrons as &$userTron) {
|
||||||
|
// UserTron::destroy($userTron['id'],true);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// //资金明细
|
||||||
|
// $userFinances = UserFinance::select()->toArray();
|
||||||
|
// foreach ($userFinances as &$userFinance) {
|
||||||
|
// UserFinance::destroy($userFinance['id'],true);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// //用户
|
||||||
|
// $users = User::select()->toArray();
|
||||||
|
// foreach ($users as &$user) {
|
||||||
|
// User::destroy($user['id'],true);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// //角色
|
||||||
|
// $systemRoles = SystemRole::where('id <> 6')->select()->toArray();
|
||||||
|
// foreach ($systemRoles as &$systemRole) {
|
||||||
|
// SystemRole::destroy($systemRole['id'],true);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// //短信记录
|
||||||
|
// $smsLogs = SmsLog::select()->toArray();
|
||||||
|
// foreach ($smsLogs as &$smsLog) {
|
||||||
|
// SmsLog::destroy($smsLog['id'],true);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// //充值记录
|
||||||
|
// $rechargeRecords = RechargeRecord::select()->toArray();
|
||||||
|
// foreach ($rechargeRecords as &$rechargeRecord) {
|
||||||
|
// RechargeRecord::destroy($rechargeRecord['id'],true);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// //通知记录
|
||||||
|
// $noticeRecords = NoticeRecord::select()->toArray();
|
||||||
|
// foreach ($noticeRecords as &$noticeRecord) {
|
||||||
|
// NoticeRecord::destroy($noticeRecord['id'],true);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// //量化记录
|
||||||
|
// $lhRecords = LhRecord::select()->toArray();
|
||||||
|
// foreach ($lhRecords as &$lhRecord) {
|
||||||
|
// LhRecord::destroy($lhRecord['id'],true);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // //管理员
|
||||||
|
// // $admins = Admin::select()->toArray();
|
||||||
|
// // foreach ($admins as &$admin) {
|
||||||
|
// // Admin::destroy($admin['id'],true);
|
||||||
|
// // }
|
||||||
|
// //用户转账记录
|
||||||
|
// UserTransferRecord::where('1 = 1')->delete();
|
||||||
|
// //用户签到
|
||||||
|
// UserSigninRecord::where('1 = 1')->delete();
|
||||||
|
// //用户会话
|
||||||
|
// UserSession::where('1 = 1')->delete();
|
||||||
|
// //奖励活动记录
|
||||||
|
// UserRewardRecord::where('1 = 1')->delete();
|
||||||
|
// //用户关系
|
||||||
|
// UserRelation::where('1 = 1')->delete();
|
||||||
|
// //用户代理关系
|
||||||
|
// UserRelationAgent::where('1 = 1')->delete();
|
||||||
|
// //用户消息
|
||||||
|
// UserNotice::where('1 = 1')->delete();
|
||||||
|
// //挖矿记录
|
||||||
|
// UserMineRecord::where('1 = 1')->delete();
|
||||||
|
// //会员记录
|
||||||
|
// UserMemberRecord::where('1 = 1')->delete();
|
||||||
|
// //用户操作
|
||||||
|
// UserLog::where('1 = 1')->delete();
|
||||||
|
// //卡单规则
|
||||||
|
// UserKadan::where('1 = 1')->delete();
|
||||||
|
// //用户信息
|
||||||
|
// UserInfo::where('1 = 1')->delete();
|
||||||
|
// //用户分组记录
|
||||||
|
// UserGroupRecord::where('1 = 1')->delete();
|
||||||
|
// //角色菜单关系
|
||||||
|
// SystemRoleMenu::where('role_id <> 6')->delete();
|
||||||
|
// //清空日志
|
||||||
|
// OperationLog::where('1 = 1')->delete();
|
||||||
|
// //奖品记录
|
||||||
|
// MallGoodsRecord::where('1 = 1')->delete();
|
||||||
|
// //抢单记录
|
||||||
|
// GoodsRecord::where('1 = 1')->delete();
|
||||||
|
// //项目记录
|
||||||
|
// ItemRecord::where('1 = 1')->delete();
|
||||||
|
// //意见反馈记录
|
||||||
|
// FeedbackRecord::where('1 = 1')->delete();
|
||||||
|
// //邮件发送记录
|
||||||
|
// EmailRecord::where('1 = 1')->delete();
|
||||||
|
// //管理员会话
|
||||||
|
// AdminSession::where('1 = 1')->delete();
|
||||||
|
// //角色关联
|
||||||
|
// AdminRole::where('role_id <> 0')->delete();
|
||||||
|
// //岗位关联
|
||||||
|
// AdminJobs::where('1 = 1')->delete();
|
||||||
|
// // //部门关联
|
||||||
|
// AdminDept::where('1 = 1')->delete();
|
||||||
|
|
||||||
|
// //波场配置
|
||||||
|
// ConfigService::set('website', 'tron', ['api_key'=>'','url'=>'']);
|
||||||
|
// //翻译配置
|
||||||
|
// $translation = ConfigService::get('website', 'translation');
|
||||||
|
// $translation['app_key'] = '';
|
||||||
|
// $translation['sec_key'] = '';
|
||||||
|
// ConfigService::set('website', 'translation', $translation);
|
||||||
|
// //短信宝配置
|
||||||
|
// $smsbao = ConfigService::get('sms', 'smsbao');
|
||||||
|
// $smsbao['sign'] = '';
|
||||||
|
// $smsbao['username'] = '';
|
||||||
|
// $smsbao['api_key'] = '';
|
||||||
|
// ConfigService::set('sms', 'smsbao', $smsbao);
|
||||||
|
// //邮箱配置
|
||||||
|
// ConfigService::set('website', 'email', ['host'=>'','port'=>'','smtp'=>'','charset'=>'','nickname'=>'','username'=>'','password'=>'']);
|
||||||
|
// //优盾配置
|
||||||
|
// ConfigService::set('website', 'udun', ['merchant_no'=>'','api_key'=>'','gateway_address'=>'','callUrl'=>'接口域名/adminapi/notify/notify','debug'=>'0','is_open_df'=>'0','pay_min'=>'10','pay_min'=>'10','pay_max'=>'100']);
|
||||||
|
// //前台链接
|
||||||
|
// ConfigService::set('website', 'front_link', '');
|
||||||
|
|
||||||
|
// Db::commit();
|
||||||
|
// return '清理成功';
|
||||||
|
// } catch (\Exception $e) {
|
||||||
|
// Db::rollback();
|
||||||
|
// print_r($e->getMessage());
|
||||||
|
// self::$error = $e->getMessage();
|
||||||
|
// return '清理失败,请查看日志';
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 更新行情数据
|
||||||
|
* @return string
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/04/13 10:54
|
||||||
|
*/
|
||||||
|
public function market()
|
||||||
|
{
|
||||||
|
Db::startTrans();
|
||||||
|
try {
|
||||||
|
$marketData = UtilsService::curl_request('https://api.huobi.pro/market/tickers',[],'GET');
|
||||||
|
$marketData = json_decode($marketData,true);
|
||||||
|
|
||||||
|
if('ok' != $marketData['status']){
|
||||||
|
throw new \Exception('获取API失败');
|
||||||
|
|
||||||
|
}
|
||||||
|
$marketData = $marketData['data'];
|
||||||
|
|
||||||
|
//实时行情
|
||||||
|
$market = ConfigService::get('website', 'market');
|
||||||
|
|
||||||
|
//挖矿货币
|
||||||
|
$mine = ConfigService::get('website', 'mine');
|
||||||
|
|
||||||
|
//充值方式
|
||||||
|
$rechargeMethods = RechargeMethod::where(['is_show' => 1])
|
||||||
|
->where(" symbol_rate != '' AND type IN (1,5,7) ")
|
||||||
|
->order(['sort' => 'desc', 'id' => 'desc'])
|
||||||
|
->select()
|
||||||
|
->toArray();
|
||||||
|
|
||||||
|
//提现方式
|
||||||
|
$withdrawMethods = WithdrawMethod::where(['is_show' => 1])
|
||||||
|
->where(" symbol_rate != '' AND type IN (1) ")
|
||||||
|
->order(['sort' => 'desc', 'id' => 'desc'])
|
||||||
|
->select()
|
||||||
|
->toArray();
|
||||||
|
|
||||||
|
foreach ($marketData as $market_data) {
|
||||||
|
|
||||||
|
foreach ($market as &$item) {
|
||||||
|
if($item['symbol'] == $market_data['symbol']){
|
||||||
|
$item['price'] = $market_data['close'];
|
||||||
|
$item['rise'] = round((($market_data['close']) - ($market_data['open']))/($market_data['open']) *100,2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($rechargeMethods as &$rechargeMethod) {
|
||||||
|
if($rechargeMethod['symbol_rate'] == $market_data['symbol']){
|
||||||
|
RechargeMethod::update([
|
||||||
|
'id' => $rechargeMethod['id'],
|
||||||
|
'rate' => 1/$market_data['close'],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($withdrawMethods as &$withdrawMethod) {
|
||||||
|
if($withdrawMethod['symbol_rate'] == $market_data['symbol']){
|
||||||
|
WithdrawMethod::update([
|
||||||
|
'id' => $withdrawMethod['id'],
|
||||||
|
'rate' => 1/$market_data['close'],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($mine['symbol_rate'] != '' & $mine['symbol_rate'] == $market_data['symbol']){
|
||||||
|
$mine['rate'] = 1/$market_data['close'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ConfigService::set('website', 'market', $market);
|
||||||
|
|
||||||
|
if($mine['symbol_rate'] != '') ConfigService::set('website', 'mine', $mine);
|
||||||
|
|
||||||
|
Db::commit();
|
||||||
|
return 'success';
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Db::rollback();
|
||||||
|
return $e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 优盾钱包交易回调
|
||||||
|
* @return string
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/04/13 10:54
|
||||||
|
*/
|
||||||
|
public function notify(){
|
||||||
|
Db::startTrans();
|
||||||
|
try {
|
||||||
|
$body = $_POST['body'];
|
||||||
|
$nonce = $_POST['nonce'];
|
||||||
|
$timestamp = $_POST['timestamp'];
|
||||||
|
$sign = $_POST['sign'];
|
||||||
|
//验证签名
|
||||||
|
$signCheck = UtilsService::udun_signature($body,$timestamp,$nonce);
|
||||||
|
if ($sign != $signCheck) {
|
||||||
|
throw new \Exception('签名错误');
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
$body = json_decode($body);
|
||||||
|
//$this->printLog("回调接收内容(tradeType):".$body->tradeType);
|
||||||
|
//$body->tradeType 1充币回调 2提币回调
|
||||||
|
if ($body->tradeType == 1) {
|
||||||
|
|
||||||
|
//$body->status 0待审核 1审核成功 2审核驳回 3交易成功 4交易失败
|
||||||
|
if($body->status == 3){
|
||||||
|
|
||||||
|
//业务处理
|
||||||
|
//查询钱包地址
|
||||||
|
$userUdun = UserUdun::where([
|
||||||
|
'address' => $body->address,
|
||||||
|
'main_coin_type' => $body->mainCoinType,
|
||||||
|
'coin_type' => $body->coinType
|
||||||
|
])
|
||||||
|
->findOrEmpty();
|
||||||
|
|
||||||
|
if ($userUdun->isEmpty()) {
|
||||||
|
throw new \Exception('地址不存在');
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
$method = RechargeMethod::where(['id' => $userUdun['method_id']])->findOrEmpty();
|
||||||
|
if ($method->isEmpty()) {
|
||||||
|
throw new \Exception('充值方式不存在');
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
$user = User::where(['id' => $userUdun['user_id']])->findOrEmpty();
|
||||||
|
if ($user->isEmpty()) {
|
||||||
|
throw new \Exception('用户不存在');
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
$money = ($body->amount) / pow(10,($body->decimals));
|
||||||
|
|
||||||
|
$order_amount_act = round($money / $method['rate'] , 2);
|
||||||
|
|
||||||
|
|
||||||
|
//判断最低充值金额
|
||||||
|
$config = ConfigService::get('website', 'trade');
|
||||||
|
if($order_amount_act < $config['recharge_min']){
|
||||||
|
return "success";
|
||||||
|
}
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'sn' => generate_sn(RechargeRecord::class, 'sn'),
|
||||||
|
'user_id' => $userUdun['user_id'],
|
||||||
|
'method_id' => $method['id'],
|
||||||
|
'amount' => $order_amount_act,
|
||||||
|
'amount_act' => round($money , $method['precision']),
|
||||||
|
'rate' => $method['rate'],
|
||||||
|
'symbol' => $method['symbol'],
|
||||||
|
'status' => 1,
|
||||||
|
];
|
||||||
|
|
||||||
|
$record = RechargeRecord::create($data);
|
||||||
|
|
||||||
|
//记录日志
|
||||||
|
UtilsService::user_finance_add(
|
||||||
|
$data['user_id'],
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
$data['amount'],
|
||||||
|
$data['sn'],
|
||||||
|
'',
|
||||||
|
1//冻结
|
||||||
|
);
|
||||||
|
|
||||||
|
//用户资金修改
|
||||||
|
UtilsService::user_money_change($data['user_id'], 1, $data['amount'],'user_money');
|
||||||
|
|
||||||
|
//充值金额增加
|
||||||
|
UtilsService::user_money_change($data['user_id'], 1, $data['amount'],'total_recharge');
|
||||||
|
|
||||||
|
//团队充值奖励
|
||||||
|
// UtilsService::team_reward_add($data['user_id'],$data['amount'],1);
|
||||||
|
|
||||||
|
//充值活动奖励
|
||||||
|
UtilsService::activity_reward_add($data['user_id'],$data['amount']);
|
||||||
|
|
||||||
|
//更新充值记录用户余额
|
||||||
|
$user = User::where(['id' => $data['user_id']])->findOrEmpty();
|
||||||
|
if ($user->isEmpty()) {
|
||||||
|
throw new \Exception('用户不存在');
|
||||||
|
}
|
||||||
|
|
||||||
|
//充值次数+1
|
||||||
|
User::update([
|
||||||
|
'id' => $user['id'],
|
||||||
|
'recharge_num' => $user['recharge_num'] + 1
|
||||||
|
]);
|
||||||
|
|
||||||
|
RechargeRecord::update([
|
||||||
|
'id' => $record['id'],
|
||||||
|
'user_money' => $user['user_money']
|
||||||
|
]);
|
||||||
|
|
||||||
|
Db::commit();
|
||||||
|
|
||||||
|
}
|
||||||
|
//无论业务方处理成功与否(success,failed),回调都认为成功
|
||||||
|
return "success";
|
||||||
|
}
|
||||||
|
elseif ($body->tradeType == 2) {
|
||||||
|
|
||||||
|
//$body->status 0待审核 1审核成功 2审核驳回 3交易成功 4交易失败
|
||||||
|
if($body->status == 0){
|
||||||
|
//业务处理
|
||||||
|
}
|
||||||
|
else if($body->status == 1){
|
||||||
|
//业务处理
|
||||||
|
}
|
||||||
|
else if($body->status == 3){
|
||||||
|
$record = WithdrawRecord::where(['account' => $body->address,'status' => 0,'status2' => 1,'sn' => $body->businessId])->findOrEmpty();
|
||||||
|
if ($record->isEmpty()) {
|
||||||
|
throw new \Exception('记录不存在');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
WithdrawRecord::update([
|
||||||
|
'id' => $record['id'],
|
||||||
|
'status' => 1
|
||||||
|
]);
|
||||||
|
//更新充值记录用户余额
|
||||||
|
$user = User::where(['id' => $record['user_id']])->findOrEmpty();
|
||||||
|
if (!$user->isEmpty()) {
|
||||||
|
//提现次数+1
|
||||||
|
User::update([
|
||||||
|
'id' => $user['id'],
|
||||||
|
'withdraw_num' => $user['withdraw_num'] + 1
|
||||||
|
]);
|
||||||
|
|
||||||
|
WithdrawRecord::update([
|
||||||
|
'id' => $record['id'],
|
||||||
|
'user_money' => $user['user_money'],
|
||||||
|
'remark_df' => '',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
Db::commit();
|
||||||
|
|
||||||
|
}
|
||||||
|
else if($body->status == 2 || $body->status == 4){
|
||||||
|
$record = WithdrawRecord::where(['account' => $body->address,'status' => 0,'status2' => 1,'sn' => $body->businessId])->findOrEmpty();
|
||||||
|
if ($record->isEmpty()) {
|
||||||
|
throw new \Exception('记录不存在');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
WithdrawRecord::update([
|
||||||
|
'id' => $record['id'],
|
||||||
|
'status2' => 0,
|
||||||
|
'remark_df' => 'udun代付失败',
|
||||||
|
]);
|
||||||
|
|
||||||
|
Db::commit();
|
||||||
|
}
|
||||||
|
//无论业务方处理成功与否(success,failed),回调都认为成功
|
||||||
|
return "success";
|
||||||
|
}
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Db::rollback();
|
||||||
|
self::setError($e->getMessage());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function test(){
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
63
app/adminapi/controller/UploadController.php
Normal file
63
app/adminapi/controller/UploadController.php
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
<?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());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
52
app/adminapi/controller/WorkbenchController.php
Normal file
52
app/adminapi/controller/WorkbenchController.php
Normal file
@@ -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;
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 代理工作台
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author 段誉
|
||||||
|
* @date 2021/12/29 17:01
|
||||||
|
*/
|
||||||
|
public function agent()
|
||||||
|
{
|
||||||
|
$params = $this->request->get();
|
||||||
|
$params['admin_id'] = $this->adminId;
|
||||||
|
$result = WorkbenchLogic::agent($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
134
app/adminapi/controller/article/ArticleCateController.php
Normal file
134
app/adminapi/controller/article/ArticleCateController.php
Normal file
@@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
126
app/adminapi/controller/article/ArticleController.php
Normal file
126
app/adminapi/controller/article/ArticleController.php
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
<?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');
|
||||||
|
ArticleLogic::add($params);
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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 BD
|
||||||
|
* @date 2024/03/17 17:01
|
||||||
|
*/
|
||||||
|
public function all()
|
||||||
|
{
|
||||||
|
$params = $this->request->get();
|
||||||
|
$result = ArticleLogic::all($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
163
app/adminapi/controller/auth/AdminController.php
Normal file
163
app/adminapi/controller/auth/AdminController.php
Normal file
@@ -0,0 +1,163 @@
|
|||||||
|
<?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);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取谷歌验证
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author 段誉
|
||||||
|
* @date 2021/12/29 11:07
|
||||||
|
*/
|
||||||
|
public function google()
|
||||||
|
{
|
||||||
|
$params['id'] = $this->adminId;
|
||||||
|
$result = AdminLogic::google($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 重置谷歌验证
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author 段誉
|
||||||
|
* @date 2021/12/29 11:07
|
||||||
|
*/
|
||||||
|
public function resetGoogle()
|
||||||
|
{
|
||||||
|
$params = $this->request->post();
|
||||||
|
$result = AdminLogic::resetGoogle($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('重置成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(AdminLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
143
app/adminapi/controller/auth/MenuController.php
Normal file
143
app/adminapi/controller/auth/MenuController.php
Normal file
@@ -0,0 +1,143 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
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
|
||||||
|
* @author 段誉
|
||||||
|
* @date 2022/7/6 17:04
|
||||||
|
*/
|
||||||
|
public function updateSort()
|
||||||
|
{
|
||||||
|
$params = (new MenuValidate())->post()->goCheck('sort');
|
||||||
|
MenuLogic::updateSort($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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
124
app/adminapi/controller/auth/RoleController.php
Normal file
124
app/adminapi/controller/auth/RoleController.php
Normal file
@@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
135
app/adminapi/controller/crontab/CrontabController.php
Normal file
135
app/adminapi/controller/crontab/CrontabController.php
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
<?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 获取规则执行时间
|
||||||
|
* @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);
|
||||||
|
}
|
||||||
|
}
|
||||||
120
app/adminapi/controller/decorate/DecorateHintController.php
Normal file
120
app/adminapi/controller/decorate/DecorateHintController.php
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
<?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\lists\decorate\DecorateHintLists;
|
||||||
|
use app\adminapi\logic\decorate\DecorateHintLogic;
|
||||||
|
use app\adminapi\validate\decorate\DecorateHintValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提示内容控制器
|
||||||
|
* Class DecorateHintController
|
||||||
|
* @package app\adminapi\controller\decorate
|
||||||
|
*/
|
||||||
|
class DecorateHintController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取提示内容列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/17 17:01
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new DecorateHintLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加提示内容
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/17 17:01
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new DecorateHintValidate())->post()->goCheck('add');
|
||||||
|
$result = DecorateHintLogic::add($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(DecorateHintLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑提示内容
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/17 17:01
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new DecorateHintValidate())->post()->goCheck('edit');
|
||||||
|
$result = DecorateHintLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(DecorateHintLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除提示内容
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/17 17:01
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new DecorateHintValidate())->post()->goCheck('delete');
|
||||||
|
DecorateHintLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取提示内容详情
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/17 17:01
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$params = (new DecorateHintValidate())->goCheck('detail');
|
||||||
|
$result = DecorateHintLogic::detail($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 消息列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/17 17:01
|
||||||
|
*/
|
||||||
|
public function allByType()
|
||||||
|
{
|
||||||
|
$params = $this->request->get();
|
||||||
|
$result = DecorateHintLogic::allByType($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
108
app/adminapi/controller/decorate/DecorateNavController.php
Normal file
108
app/adminapi/controller/decorate/DecorateNavController.php
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
<?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\lists\decorate\DecorateNavLists;
|
||||||
|
use app\adminapi\logic\decorate\DecorateNavLogic;
|
||||||
|
use app\adminapi\validate\decorate\DecorateNavValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 菜单按钮控制器
|
||||||
|
* Class DecorateNavController
|
||||||
|
* @package app\adminapi\controller\decorate
|
||||||
|
*/
|
||||||
|
class DecorateNavController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取菜单按钮列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/17 16:41
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new DecorateNavLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加菜单按钮
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/17 16:41
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new DecorateNavValidate())->post()->goCheck('add');
|
||||||
|
$result = DecorateNavLogic::add($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(DecorateNavLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑菜单按钮
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/17 16:41
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new DecorateNavValidate())->post()->goCheck('edit');
|
||||||
|
$result = DecorateNavLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(DecorateNavLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除菜单按钮
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/17 16:41
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new DecorateNavValidate())->post()->goCheck('delete');
|
||||||
|
DecorateNavLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取菜单按钮详情
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/17 16:41
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$params = (new DecorateNavValidate())->goCheck('detail');
|
||||||
|
$result = DecorateNavLogic::detail($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
108
app/adminapi/controller/decorate/DecorateSwiperController.php
Normal file
108
app/adminapi/controller/decorate/DecorateSwiperController.php
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
<?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\lists\decorate\DecorateSwiperLists;
|
||||||
|
use app\adminapi\logic\decorate\DecorateSwiperLogic;
|
||||||
|
use app\adminapi\validate\decorate\DecorateSwiperValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 轮播图控制器
|
||||||
|
* Class DecorateSwiperController
|
||||||
|
* @package app\adminapi\controller\decorate
|
||||||
|
*/
|
||||||
|
class DecorateSwiperController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取轮播图列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/16 17:34
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new DecorateSwiperLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加轮播图
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/16 17:34
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new DecorateSwiperValidate())->post()->goCheck('add');
|
||||||
|
$result = DecorateSwiperLogic::add($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(DecorateSwiperLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑轮播图
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/16 17:34
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new DecorateSwiperValidate())->post()->goCheck('edit');
|
||||||
|
$result = DecorateSwiperLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(DecorateSwiperLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除轮播图
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/16 17:34
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new DecorateSwiperValidate())->post()->goCheck('delete');
|
||||||
|
DecorateSwiperLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取轮播图详情
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/16 17:34
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$params = (new DecorateSwiperValidate())->goCheck('detail');
|
||||||
|
$result = DecorateSwiperLogic::detail($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
134
app/adminapi/controller/dept/DeptController.php
Normal file
134
app/adminapi/controller/dept/DeptController.php
Normal file
@@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
118
app/adminapi/controller/dept/JobsController.php
Normal file
118
app/adminapi/controller/dept/JobsController.php
Normal file
@@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
94
app/adminapi/controller/feedback/FeedbackCateController.php
Normal file
94
app/adminapi/controller/feedback/FeedbackCateController.php
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\adminapi\controller\feedback;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\feedback\FeedbackCateLists;
|
||||||
|
use app\adminapi\logic\feedback\FeedbackCateLogic;
|
||||||
|
use app\adminapi\validate\feedback\FeedbackCateValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 意见反馈类型控制器
|
||||||
|
* Class FeedbackCateController
|
||||||
|
* @package app\adminapi\controller\feedback
|
||||||
|
*/
|
||||||
|
class FeedbackCateController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取意见反馈类型列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/06/06 00:12
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new FeedbackCateLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加意见反馈类型
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/06/06 00:12
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new FeedbackCateValidate())->post()->goCheck('add');
|
||||||
|
$result = FeedbackCateLogic::add($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(FeedbackCateLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑意见反馈类型
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/06/06 00:12
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new FeedbackCateValidate())->post()->goCheck('edit');
|
||||||
|
$result = FeedbackCateLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(FeedbackCateLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除意见反馈类型
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/06/06 00:12
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new FeedbackCateValidate())->post()->goCheck('delete');
|
||||||
|
FeedbackCateLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取意见反馈类型详情
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/06/06 00:12
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$params = (new FeedbackCateValidate())->goCheck('detail');
|
||||||
|
$result = FeedbackCateLogic::detail($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\adminapi\controller\feedback;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\feedback\FeedbackRecordLists;
|
||||||
|
use app\adminapi\logic\feedback\FeedbackRecordLogic;
|
||||||
|
use app\adminapi\validate\feedback\FeedbackRecordValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 意见反馈记录控制器
|
||||||
|
* Class FeedbackRecordController
|
||||||
|
* @package app\adminapi\controller\feedback
|
||||||
|
*/
|
||||||
|
class FeedbackRecordController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取意见反馈记录列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/06/06 01:11
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new FeedbackRecordLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加意见反馈记录
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/06/06 01:11
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new FeedbackRecordValidate())->post()->goCheck('add');
|
||||||
|
$result = FeedbackRecordLogic::add($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(FeedbackRecordLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑意见反馈记录
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/06/06 01:11
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new FeedbackRecordValidate())->post()->goCheck('edit');
|
||||||
|
$result = FeedbackRecordLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(FeedbackRecordLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除意见反馈记录
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/06/06 01:11
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new FeedbackRecordValidate())->post()->goCheck('delete');
|
||||||
|
FeedbackRecordLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取意见反馈记录详情
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/06/06 01:11
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$params = (new FeedbackRecordValidate())->goCheck('detail');
|
||||||
|
$result = FeedbackRecordLogic::detail($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
163
app/adminapi/controller/finance/RechargeRecordController.php
Normal file
163
app/adminapi/controller/finance/RechargeRecordController.php
Normal file
@@ -0,0 +1,163 @@
|
|||||||
|
<?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\{RechargeRecordLists,AgentRechargeRecordLists};
|
||||||
|
use app\adminapi\logic\finance\RechargeRecordLogic;
|
||||||
|
use app\adminapi\validate\finance\RechargeRecordValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值记录控制器
|
||||||
|
* Class RechargeRecordController
|
||||||
|
* @package app\adminapi\controller\finance
|
||||||
|
*/
|
||||||
|
class RechargeRecordController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取充值记录列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author bd
|
||||||
|
* @date 2024/01/31 14:07
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new RechargeRecordLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取代理充值记录列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author bd
|
||||||
|
* @date 2024/01/31 14:07
|
||||||
|
*/
|
||||||
|
public function agentLists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new AgentRechargeRecordLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除充值记录
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author bd
|
||||||
|
* @date 2024/01/31 14:07
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new RechargeRecordValidate())->post()->goCheck('delete');
|
||||||
|
RechargeRecordLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 同意充值
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author bd
|
||||||
|
* @date 2024/01/31 14:07
|
||||||
|
*/
|
||||||
|
public function agree()
|
||||||
|
{
|
||||||
|
$params = (new RechargeRecordValidate())->post()->goCheck('agree');
|
||||||
|
$result = RechargeRecordLogic::agree($params['id']);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('同意成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(RechargeRecordLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 拒绝充值
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author bd
|
||||||
|
* @date 2024/01/31 14:07
|
||||||
|
*/
|
||||||
|
public function refuse()
|
||||||
|
{
|
||||||
|
$params = (new RechargeRecordValidate())->post()->goCheck('refuse');
|
||||||
|
$result = RechargeRecordLogic::refuse($params['id']);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('拒绝成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(RechargeRecordLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 备注
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author bd
|
||||||
|
* @date 2024/01/31 14:07
|
||||||
|
*/
|
||||||
|
public function remark()
|
||||||
|
{
|
||||||
|
$params = $this->request->post();
|
||||||
|
$params['admin_id'] = $this->adminId;
|
||||||
|
$result = RechargeRecordLogic::remark($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('备注成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(RechargeRecordLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 修改充值金额
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author bd
|
||||||
|
* @date 2024/01/31 14:07
|
||||||
|
*/
|
||||||
|
public function changeAmount()
|
||||||
|
{
|
||||||
|
$params = $this->request->post();
|
||||||
|
$result = RechargeRecordLogic::changeAmount($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('修改成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(RechargeRecordLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 新充值提现条数
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author bd
|
||||||
|
* @date 2024/01/31 14:07
|
||||||
|
*/
|
||||||
|
public function warmCount()
|
||||||
|
{
|
||||||
|
$result = RechargeRecordLogic::warmCount();
|
||||||
|
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 bd
|
||||||
|
* @date 2024/01/31 14:07
|
||||||
|
*/
|
||||||
|
public function stat()
|
||||||
|
{
|
||||||
|
$result = RechargeRecordLogic::stat();
|
||||||
|
return $this->success('', $result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
85
app/adminapi/controller/finance/UserFinanceController.php
Normal file
85
app/adminapi/controller/finance/UserFinanceController.php
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
<?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\{UserFinanceLists,AgentUserFinanceLists};
|
||||||
|
use app\adminapi\logic\finance\UserFinanceLogic;
|
||||||
|
use app\adminapi\validate\finance\UserFinanceValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资金明细控制器
|
||||||
|
* Class UserFinanceController
|
||||||
|
* @package app\adminapi\controller\finance
|
||||||
|
*/
|
||||||
|
class UserFinanceController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取资金明细列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/07 13:10
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new UserFinanceLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取代理资金明细列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author bd
|
||||||
|
* @date 2024/01/31 14:07
|
||||||
|
*/
|
||||||
|
public function agentLists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new AgentUserFinanceLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除资金明细
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/07 13:10
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new UserFinanceValidate())->post()->goCheck('delete');
|
||||||
|
UserFinanceLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 解冻
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author bd
|
||||||
|
* @date 2024/01/31 14:07
|
||||||
|
*/
|
||||||
|
public function unfrozen()
|
||||||
|
{
|
||||||
|
$params = (new UserFinanceValidate())->post()->goCheck('unfrozen');
|
||||||
|
$result = UserFinanceLogic::unfrozen($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('解冻成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(UserFinanceLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
199
app/adminapi/controller/finance/WithdrawRecordController.php
Normal file
199
app/adminapi/controller/finance/WithdrawRecordController.php
Normal file
@@ -0,0 +1,199 @@
|
|||||||
|
<?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\{WithdrawRecordLists,AgentWithdrawRecordLists};
|
||||||
|
use app\adminapi\logic\finance\WithdrawRecordLogic;
|
||||||
|
use app\adminapi\validate\finance\WithdrawRecordValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提现记录控制器
|
||||||
|
* Class WithdrawRecordController
|
||||||
|
* @package app\adminapi\controller\finance
|
||||||
|
*/
|
||||||
|
class WithdrawRecordController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取提现记录列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/02/25 12:35
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new WithdrawRecordLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取代理提现记录列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author bd
|
||||||
|
* @date 2024/01/31 14:07
|
||||||
|
*/
|
||||||
|
public function agentLists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new AgentWithdrawRecordLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加提现记录
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/02/25 12:35
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new WithdrawRecordValidate())->post()->goCheck('add');
|
||||||
|
$result = WithdrawRecordLogic::add($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(WithdrawRecordLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑提现记录
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/02/25 12:35
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new WithdrawRecordValidate())->post()->goCheck('edit');
|
||||||
|
$result = WithdrawRecordLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(WithdrawRecordLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除提现记录
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/02/25 12:35
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new WithdrawRecordValidate())->post()->goCheck('delete');
|
||||||
|
WithdrawRecordLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取提现记录详情
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/02/25 12:35
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$params = (new WithdrawRecordValidate())->goCheck('detail');
|
||||||
|
$result = WithdrawRecordLogic::detail($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes udun代付
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author bd
|
||||||
|
* @date 2024/01/31 14:07
|
||||||
|
*/
|
||||||
|
public function udunPay()
|
||||||
|
{
|
||||||
|
$params = (new WithdrawRecordValidate())->post()->goCheck('udunPay');
|
||||||
|
$result = WithdrawRecordLogic::udunPay($params);
|
||||||
|
if ('success' === $result) {
|
||||||
|
return $this->success('发起成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->fail(WithdrawRecordLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 同意提现
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author bd
|
||||||
|
* @date 2024/01/31 14:07
|
||||||
|
*/
|
||||||
|
public function agree()
|
||||||
|
{
|
||||||
|
$params = (new WithdrawRecordValidate())->post()->goCheck('agree');
|
||||||
|
$result = WithdrawRecordLogic::agree($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('同意成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(WithdrawRecordLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 拒绝提现
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author bd
|
||||||
|
* @date 2024/01/31 14:07
|
||||||
|
*/
|
||||||
|
public function refuse()
|
||||||
|
{
|
||||||
|
$params = (new WithdrawRecordValidate())->post()->goCheck('refuse');
|
||||||
|
$result = WithdrawRecordLogic::refuse($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('拒绝成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(WithdrawRecordLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 备注
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author bd
|
||||||
|
* @date 2024/01/31 14:07
|
||||||
|
*/
|
||||||
|
public function remark()
|
||||||
|
{
|
||||||
|
$params = $this->request->post();
|
||||||
|
$params['admin_id'] = $this->adminId;
|
||||||
|
$result = WithdrawRecordLogic::remark($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('备注成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(WithdrawRecordLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 提现统计
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
* @author bd
|
||||||
|
* @date 2024/01/31 14:07
|
||||||
|
*/
|
||||||
|
public function stat()
|
||||||
|
{
|
||||||
|
$result = WithdrawRecordLogic::stat();
|
||||||
|
return $this->success('', $result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
123
app/adminapi/controller/goods/GoodsCateController.php
Normal file
123
app/adminapi/controller/goods/GoodsCateController.php
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
<?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\goods;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\goods\GoodsCateLists;
|
||||||
|
use app\adminapi\logic\goods\GoodsCateLogic;
|
||||||
|
use app\adminapi\validate\goods\GoodsCateValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品分类控制器
|
||||||
|
* Class GoodsCateController
|
||||||
|
* @package app\adminapi\controller\goods
|
||||||
|
*/
|
||||||
|
class GoodsCateController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取商品分类列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/11 01:58
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new GoodsCateLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加商品分类
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/11 01:58
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new GoodsCateValidate())->post()->goCheck('add');
|
||||||
|
$result = GoodsCateLogic::add($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(GoodsCateLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑商品分类
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/11 01:58
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new GoodsCateValidate())->post()->goCheck('edit');
|
||||||
|
$result = GoodsCateLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(GoodsCateLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除商品分类
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/11 01:58
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new GoodsCateValidate())->post()->goCheck('delete');
|
||||||
|
GoodsCateLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取商品分类详情
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/11 01:58
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$params = (new GoodsCateValidate())->goCheck('detail');
|
||||||
|
$result = GoodsCateLogic::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 BD
|
||||||
|
* @date 2024/03/11 01:58
|
||||||
|
*/
|
||||||
|
public function all()
|
||||||
|
{
|
||||||
|
$result = GoodsCateLogic::getAllData();
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
108
app/adminapi/controller/goods/GoodsController.php
Normal file
108
app/adminapi/controller/goods/GoodsController.php
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
<?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\goods;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\goods\GoodsLists;
|
||||||
|
use app\adminapi\logic\goods\GoodsLogic;
|
||||||
|
use app\adminapi\validate\goods\GoodsValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品控制器
|
||||||
|
* Class GoodsController
|
||||||
|
* @package app\adminapi\controller\goods
|
||||||
|
*/
|
||||||
|
class GoodsController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取商品列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/11 01:58
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new GoodsLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加商品
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/11 01:58
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new GoodsValidate())->post()->goCheck('add');
|
||||||
|
$result = GoodsLogic::add($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(GoodsLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑商品
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/11 01:58
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new GoodsValidate())->post()->goCheck('edit');
|
||||||
|
$result = GoodsLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(GoodsLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除商品
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/11 01:58
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new GoodsValidate())->post()->goCheck('delete');
|
||||||
|
GoodsLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取商品详情
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/11 01:58
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$params = (new GoodsValidate())->goCheck('detail');
|
||||||
|
$result = GoodsLogic::detail($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
76
app/adminapi/controller/goods/GoodsRecordController.php
Normal file
76
app/adminapi/controller/goods/GoodsRecordController.php
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
<?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\goods;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\goods\GoodsRecordLists;
|
||||||
|
use app\adminapi\logic\goods\GoodsRecordLogic;
|
||||||
|
use app\adminapi\validate\goods\GoodsRecordValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 抢单记录控制器
|
||||||
|
* Class GoodsRecordController
|
||||||
|
* @package app\adminapi\controller\goods
|
||||||
|
*/
|
||||||
|
class GoodsRecordController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取抢单记录列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/19 02:29
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new GoodsRecordLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除抢单记录
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/19 02:29
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new GoodsRecordValidate())->post()->goCheck('delete');
|
||||||
|
GoodsRecordLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 派单
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/19 02:29
|
||||||
|
*/
|
||||||
|
public function dispatch()
|
||||||
|
{
|
||||||
|
$params = (new GoodsRecordValidate())->post()->goCheck('dispatch');
|
||||||
|
$result = GoodsRecordLogic::dispatch($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('派单成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(GoodsRecordLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
138
app/adminapi/controller/item/ItemCateController.php
Normal file
138
app/adminapi/controller/item/ItemCateController.php
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
<?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\item;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\item\ItemCateLists;
|
||||||
|
use app\adminapi\logic\item\ItemCateLogic;
|
||||||
|
use app\adminapi\validate\item\ItemCateValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目分类控制器
|
||||||
|
* Class ItemCateController
|
||||||
|
* @package app\adminapi\controller\item
|
||||||
|
*/
|
||||||
|
class ItemCateController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取项目分类列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/01/16 13:23
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new ItemCateLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加项目分类
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/01/16 13:23
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new ItemCateValidate())->post()->goCheck('add');
|
||||||
|
$result = ItemCateLogic::add($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(ItemCateLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑项目分类
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/01/16 13:23
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new ItemCateValidate())->post()->goCheck('edit');
|
||||||
|
$result = ItemCateLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(ItemCateLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除项目分类
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/01/16 13:23
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new ItemCateValidate())->post()->goCheck('delete');
|
||||||
|
ItemCateLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取项目分类详情
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/01/16 13:23
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$params = (new ItemCateValidate())->goCheck('detail');
|
||||||
|
$result = ItemCateLogic::detail($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 更改项目分类状态
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2022/2/21 10:15
|
||||||
|
*/
|
||||||
|
public function updateStatus()
|
||||||
|
{
|
||||||
|
$params = (new ItemCateValidate())->post()->goCheck('status');
|
||||||
|
$result = ItemCateLogic::updateStatus($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('修改成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(ItemCateLogic::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 = ItemCateLogic::getAllData();
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
124
app/adminapi/controller/item/ItemController.php
Normal file
124
app/adminapi/controller/item/ItemController.php
Normal file
@@ -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\item;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\item\ItemLists;
|
||||||
|
use app\adminapi\logic\item\ItemLogic;
|
||||||
|
use app\adminapi\validate\item\ItemValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目控制器
|
||||||
|
* Class ItemController
|
||||||
|
* @package app\adminapi\controller\item
|
||||||
|
*/
|
||||||
|
class ItemController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取项目列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/01/16 13:23
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new ItemLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加项目
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/01/16 13:23
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new ItemValidate())->post()->goCheck('add');
|
||||||
|
$result = ItemLogic::add($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(ItemLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑项目
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/01/16 13:23
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new ItemValidate())->post()->goCheck('edit');
|
||||||
|
$result = ItemLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(ItemLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除项目
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/01/16 13:23
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new ItemValidate())->post()->goCheck('delete');
|
||||||
|
ItemLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取项目详情
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/01/16 13:23
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$params = (new ItemValidate())->goCheck('detail');
|
||||||
|
$result = ItemLogic::detail($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 更改状态
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2323/2/22 10:18
|
||||||
|
*/
|
||||||
|
public function updateIndexStatus()
|
||||||
|
{
|
||||||
|
$params = $this->request->post();
|
||||||
|
$result = ItemLogic::updateIndexStatus($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('修改成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
94
app/adminapi/controller/item/ItemRecordController.php
Normal file
94
app/adminapi/controller/item/ItemRecordController.php
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\adminapi\controller\item;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\item\ItemRecordLists;
|
||||||
|
use app\adminapi\logic\item\ItemRecordLogic;
|
||||||
|
use app\adminapi\validate\item\ItemRecordValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目记录控制器
|
||||||
|
* Class ItemRecordController
|
||||||
|
* @package app\adminapi\controller\item
|
||||||
|
*/
|
||||||
|
class ItemRecordController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取项目记录列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/08/07 15:42
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new ItemRecordLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加项目记录
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/08/07 15:42
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new ItemRecordValidate())->post()->goCheck('add');
|
||||||
|
$result = ItemRecordLogic::add($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(ItemRecordLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑项目记录
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/08/07 15:42
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new ItemRecordValidate())->post()->goCheck('edit');
|
||||||
|
$result = ItemRecordLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(ItemRecordLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除项目记录
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/08/07 15:42
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new ItemRecordValidate())->post()->goCheck('delete');
|
||||||
|
ItemRecordLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取项目记录详情
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/08/07 15:42
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$params = (new ItemRecordValidate())->goCheck('detail');
|
||||||
|
$result = ItemRecordLogic::detail($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
94
app/adminapi/controller/lh/LhCoinController.php
Normal file
94
app/adminapi/controller/lh/LhCoinController.php
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\adminapi\controller\lh;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\lh\LhCoinLists;
|
||||||
|
use app\adminapi\logic\lh\LhCoinLogic;
|
||||||
|
use app\adminapi\validate\lh\LhCoinValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 量化货币控制器
|
||||||
|
* Class LhCoinController
|
||||||
|
* @package app\adminapi\controller\lh
|
||||||
|
*/
|
||||||
|
class LhCoinController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取量化货币列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/05/19 21:13
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new LhCoinLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加量化货币
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/05/19 21:13
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new LhCoinValidate())->post()->goCheck('add');
|
||||||
|
$result = LhCoinLogic::add($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(LhCoinLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑量化货币
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/05/19 21:13
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new LhCoinValidate())->post()->goCheck('edit');
|
||||||
|
$result = LhCoinLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(LhCoinLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除量化货币
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/05/19 21:13
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new LhCoinValidate())->post()->goCheck('delete');
|
||||||
|
LhCoinLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取量化货币详情
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/05/19 21:13
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$params = (new LhCoinValidate())->goCheck('detail');
|
||||||
|
$result = LhCoinLogic::detail($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
94
app/adminapi/controller/lh/LhRecordController.php
Normal file
94
app/adminapi/controller/lh/LhRecordController.php
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\adminapi\controller\lh;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\lh\LhRecordLists;
|
||||||
|
use app\adminapi\logic\lh\LhRecordLogic;
|
||||||
|
use app\adminapi\validate\lh\LhRecordValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 量化记录控制器
|
||||||
|
* Class LhRecordController
|
||||||
|
* @package app\adminapi\controller\lh
|
||||||
|
*/
|
||||||
|
class LhRecordController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取量化记录列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/05/19 21:13
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new LhRecordLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加量化记录
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/05/19 21:13
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new LhRecordValidate())->post()->goCheck('add');
|
||||||
|
$result = LhRecordLogic::add($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(LhRecordLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑量化记录
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/05/19 21:13
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new LhRecordValidate())->post()->goCheck('edit');
|
||||||
|
$result = LhRecordLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(LhRecordLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除量化记录
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/05/19 21:13
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new LhRecordValidate())->post()->goCheck('delete');
|
||||||
|
LhRecordLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取量化记录详情
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/05/19 21:13
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$params = (new LhRecordValidate())->goCheck('detail');
|
||||||
|
$result = LhRecordLogic::detail($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
94
app/adminapi/controller/mall/MallGoodsController.php
Normal file
94
app/adminapi/controller/mall/MallGoodsController.php
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\adminapi\controller\mall;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\mall\MallGoodsLists;
|
||||||
|
use app\adminapi\logic\mall\MallGoodsLogic;
|
||||||
|
use app\adminapi\validate\mall\MallGoodsValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分、抽奖奖品控制器
|
||||||
|
* Class MallGoodsController
|
||||||
|
* @package app\adminapi\controller\mall
|
||||||
|
*/
|
||||||
|
class MallGoodsController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取积分、抽奖奖品列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/10/14 23:57
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new MallGoodsLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加积分、抽奖奖品
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/10/14 23:57
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new MallGoodsValidate())->post()->goCheck('add');
|
||||||
|
$result = MallGoodsLogic::add($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(MallGoodsLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑积分、抽奖奖品
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/10/14 23:57
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new MallGoodsValidate())->post()->goCheck('edit');
|
||||||
|
$result = MallGoodsLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(MallGoodsLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除积分、抽奖奖品
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/10/14 23:57
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new MallGoodsValidate())->post()->goCheck('delete');
|
||||||
|
MallGoodsLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取积分、抽奖奖品详情
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/10/14 23:57
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$params = (new MallGoodsValidate())->goCheck('detail');
|
||||||
|
$result = MallGoodsLogic::detail($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
94
app/adminapi/controller/mall/MallGoodsRecordController.php
Normal file
94
app/adminapi/controller/mall/MallGoodsRecordController.php
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\adminapi\controller\mall;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\mall\MallGoodsRecordLists;
|
||||||
|
use app\adminapi\logic\mall\MallGoodsRecordLogic;
|
||||||
|
use app\adminapi\validate\mall\MallGoodsRecordValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 奖品记录控制器
|
||||||
|
* Class MallGoodsRecordController
|
||||||
|
* @package app\adminapi\controller\mall
|
||||||
|
*/
|
||||||
|
class MallGoodsRecordController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取奖品记录列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/10/15 14:00
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new MallGoodsRecordLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加奖品记录
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/10/15 14:00
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new MallGoodsRecordValidate())->post()->goCheck('add');
|
||||||
|
$result = MallGoodsRecordLogic::add($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(MallGoodsRecordLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑奖品记录
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/10/15 14:00
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new MallGoodsRecordValidate())->post()->goCheck('edit');
|
||||||
|
$result = MallGoodsRecordLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(MallGoodsRecordLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除奖品记录
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/10/15 14:00
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new MallGoodsRecordValidate())->post()->goCheck('delete');
|
||||||
|
MallGoodsRecordLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取奖品记录详情
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/10/15 14:00
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$params = (new MallGoodsRecordValidate())->goCheck('detail');
|
||||||
|
$result = MallGoodsRecordLogic::detail($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
138
app/adminapi/controller/member/UserMemberController.php
Normal file
138
app/adminapi/controller/member/UserMemberController.php
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
<?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\member;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\member\UserMemberLists;
|
||||||
|
use app\adminapi\logic\member\UserMemberLogic;
|
||||||
|
use app\adminapi\validate\member\UserMemberValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员等级控制器
|
||||||
|
* Class UserMemberController
|
||||||
|
* @package app\adminapi\controller\member
|
||||||
|
*/
|
||||||
|
class UserMemberController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取会员等级列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/14 00:28
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new UserMemberLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加会员等级
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/14 00:28
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new UserMemberValidate())->post()->goCheck('add');
|
||||||
|
$result = UserMemberLogic::add($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(UserMemberLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑会员等级
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/14 00:28
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new UserMemberValidate())->post()->goCheck('edit');
|
||||||
|
$result = UserMemberLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(UserMemberLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除会员等级
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/14 00:28
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new UserMemberValidate())->post()->goCheck('delete');
|
||||||
|
UserMemberLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取会员等级详情
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/14 00:28
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$params = (new UserMemberValidate())->goCheck('detail');
|
||||||
|
$result = UserMemberLogic::detail($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 设置用户会员等级
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/19 02:29
|
||||||
|
*/
|
||||||
|
public function setUserMember()
|
||||||
|
{
|
||||||
|
$params = $this->request->post();
|
||||||
|
$result = UserMemberLogic::setUserMember($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('修改成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(UserMemberLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取会员等级
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/11 01:58
|
||||||
|
*/
|
||||||
|
public function all()
|
||||||
|
{
|
||||||
|
$result = UserMemberLogic::getAllData();
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
70
app/adminapi/controller/notice/NoticeController.php
Normal file
70
app/adminapi/controller/notice/NoticeController.php
Normal file
@@ -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());
|
||||||
|
}
|
||||||
|
}
|
||||||
69
app/adminapi/controller/notice/SmsConfigController.php
Normal file
69
app/adminapi/controller/notice/SmsConfigController.php
Normal file
@@ -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,38 @@
|
|||||||
|
<?php
|
||||||
|
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 BD
|
||||||
|
* @date 2024/2/15 12:05 下午
|
||||||
|
*/
|
||||||
|
public function getConfig()
|
||||||
|
{
|
||||||
|
$result = CustomerServiceLogic::getConfig();
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 设置客服设置
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/2/15 12:11 下午
|
||||||
|
*/
|
||||||
|
public function setConfig()
|
||||||
|
{
|
||||||
|
$params = $this->request->post();
|
||||||
|
CustomerServiceLogic::setConfig($params);
|
||||||
|
return $this->success('设置成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
124
app/adminapi/controller/setting/LanguageController.php
Normal file
124
app/adminapi/controller/setting/LanguageController.php
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\adminapi\controller\setting;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\setting\LanguageLists;
|
||||||
|
use app\adminapi\logic\setting\LanguageLogic;
|
||||||
|
use app\adminapi\validate\setting\LanguageValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 语言包控制器
|
||||||
|
* Class LanguageController
|
||||||
|
* @package app\adminapi\controller\setting
|
||||||
|
*/
|
||||||
|
class LanguageController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取语言包列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2023/11/30 13:59
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new LanguageLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加语言包
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2023/11/30 13:59
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new LanguageValidate())->post()->goCheck('add');
|
||||||
|
$result = LanguageLogic::add($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(LanguageLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑语言包
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2023/11/30 13:59
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new LanguageValidate())->post()->goCheck('edit');
|
||||||
|
$result = LanguageLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(LanguageLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除语言包
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2023/11/30 13:59
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new LanguageValidate())->post()->goCheck('delete');
|
||||||
|
LanguageLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取语言详情
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2023/11/30 13:59
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$params = (new LanguageValidate())->goCheck('detail');
|
||||||
|
$result = LanguageLogic::detail($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 更改状态
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/2/22 10:18
|
||||||
|
*/
|
||||||
|
public function updateStatus()
|
||||||
|
{
|
||||||
|
$params = (new LanguageValidate())->post()->goCheck('status');
|
||||||
|
$result = LanguageLogic::updateStatus($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('修改成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(LanguageLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取所有语言
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/10/13 10:54
|
||||||
|
*/
|
||||||
|
public function all()
|
||||||
|
{
|
||||||
|
$result = LanguageLogic::getAllData();
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
122
app/adminapi/controller/setting/LanguagePagController.php
Normal file
122
app/adminapi/controller/setting/LanguagePagController.php
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\adminapi\controller\setting;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\setting\LanguagePagLists;
|
||||||
|
use app\adminapi\logic\setting\LanguagePagLogic;
|
||||||
|
use app\adminapi\validate\setting\LanguagePagValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 语言包控制器
|
||||||
|
* Class LanguagePagController
|
||||||
|
* @package app\adminapi\controller\setting
|
||||||
|
*/
|
||||||
|
class LanguagePagController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取语言包列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/01/14 13:50
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new LanguagePagLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加语言包
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/01/14 13:50
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new LanguagePagValidate())->post()->goCheck('add');
|
||||||
|
$result = LanguagePagLogic::add($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(LanguagePagLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑语言包
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/01/14 13:50
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new LanguagePagValidate())->post()->goCheck('edit');
|
||||||
|
$result = LanguagePagLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(LanguagePagLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除语言包
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/01/14 13:50
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new LanguagePagValidate())->post()->goCheck('delete');
|
||||||
|
LanguagePagLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取语言包详情
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/01/14 13:50
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$params = (new LanguagePagValidate())->goCheck('detail');
|
||||||
|
$result = LanguagePagLogic::detail($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 同步语言包
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/01/14 13:50
|
||||||
|
*/
|
||||||
|
public function sync()
|
||||||
|
{
|
||||||
|
$params = $this->request->post();
|
||||||
|
LanguagePagLogic::sync($params);
|
||||||
|
return $this->success('同步成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 翻译语言包
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/01/14 13:50
|
||||||
|
*/
|
||||||
|
public function trans()
|
||||||
|
{
|
||||||
|
$params = $this->request->post();
|
||||||
|
$result = LanguagePagLogic::trans($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('翻译成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(LanguagePagLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
125
app/adminapi/controller/setting/RechargeMethodController.php
Normal file
125
app/adminapi/controller/setting/RechargeMethodController.php
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\adminapi\controller\setting;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\setting\RechargeMethodLists;
|
||||||
|
use app\adminapi\logic\setting\RechargeMethodLogic;
|
||||||
|
use app\adminapi\validate\setting\RechargeMethodValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值方式控制器
|
||||||
|
* Class RechargeMethodController
|
||||||
|
* @package app\adminapi\controller\setting
|
||||||
|
*/
|
||||||
|
class RechargeMethodController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取充值方式列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2023/11/30 15:22
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new RechargeMethodLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加充值方式
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2023/11/30 15:22
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new RechargeMethodValidate())->post()->goCheck('add');
|
||||||
|
$result = RechargeMethodLogic::add($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(RechargeMethodLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑充值方式
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2023/11/30 15:22
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new RechargeMethodValidate())->post()->goCheck('edit');
|
||||||
|
$result = RechargeMethodLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(RechargeMethodLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除充值方式
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2023/11/30 15:22
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new RechargeMethodValidate())->post()->goCheck('delete');
|
||||||
|
RechargeMethodLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取充值方式详情
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2023/11/30 15:22
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$params = (new RechargeMethodValidate())->goCheck('detail');
|
||||||
|
$result = RechargeMethodLogic::detail($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 更改状态
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2323/2/22 10:18
|
||||||
|
*/
|
||||||
|
public function updateStatus()
|
||||||
|
{
|
||||||
|
$params = (new RechargeMethodValidate())->post()->goCheck('status');
|
||||||
|
$result = RechargeMethodLogic::updateStatus($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('修改成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(RechargeMethodLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取全部充值方式
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
* @author BD
|
||||||
|
* @date 2323/10/13 10:54
|
||||||
|
*/
|
||||||
|
public function all()
|
||||||
|
{
|
||||||
|
$result = RechargeMethodLogic::getAllData();
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
73
app/adminapi/controller/setting/StorageController.php
Normal file
73
app/adminapi/controller/setting/StorageController.php
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
<?php
|
||||||
|
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 BD
|
||||||
|
* @date 2023/4/20 16:13
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->success('获取成功', StorageLogic::lists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 存储配置信息
|
||||||
|
* @return Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2023/4/20 16:19
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$param = (new StorageValidate())->get()->goCheck('detail');
|
||||||
|
return $this->success('获取成功', StorageLogic::detail($param));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 设置存储参数
|
||||||
|
* @return Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2023/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 BD
|
||||||
|
* @date 2023/4/20 16:19
|
||||||
|
*/
|
||||||
|
public function change()
|
||||||
|
{
|
||||||
|
$params = (new StorageValidate())->post()->goCheck('change');
|
||||||
|
StorageLogic::change($params);
|
||||||
|
return $this->success('切换成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
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 BD
|
||||||
|
* @date 2023/2/15 11:40 上午
|
||||||
|
*/
|
||||||
|
public function getConfig()
|
||||||
|
{
|
||||||
|
$result = TransactionSettingsLogic::getConfig();
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 设置交易设置
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2023/2/15 11:50 上午
|
||||||
|
*/
|
||||||
|
public function setConfig()
|
||||||
|
{
|
||||||
|
$params = (new TransactionSettingsValidate())->post()->goCheck('setConfig');
|
||||||
|
TransactionSettingsLogic::setConfig($params);
|
||||||
|
return $this->success('操作成功',[],1,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
99
app/adminapi/controller/setting/dict/DictDataController.php
Normal file
99
app/adminapi/controller/setting/dict/DictDataController.php
Normal file
@@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
116
app/adminapi/controller/setting/dict/DictTypeController.php
Normal file
116
app/adminapi/controller/setting/dict/DictTypeController.php
Normal file
@@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
39
app/adminapi/controller/setting/system/CacheController.php
Normal file
39
app/adminapi/controller/setting/system/CacheController.php
Normal file
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
69
app/adminapi/controller/setting/system/LogController.php
Normal file
69
app/adminapi/controller/setting/system/LogController.php
Normal file
@@ -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\system;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\setting\system\LogLists;
|
||||||
|
use app\adminapi\logic\setting\system\OperationLogLogic;
|
||||||
|
use app\adminapi\validate\setting\OperationLogValidate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统日志
|
||||||
|
* 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());
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @notes 删除已选择的系统日志
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author 段誉
|
||||||
|
* @date 2022/6/15 19:00
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new OperationLogValidate())->post()->goCheck('id');
|
||||||
|
$result = OperationLogLogic::deleteTable($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('操作成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(OperationLogLogic::getError());
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @notes 删除系统日志
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author 段誉
|
||||||
|
* @date 2022/6/15 19:00
|
||||||
|
*/
|
||||||
|
public function deleteAll()
|
||||||
|
{
|
||||||
|
$result = OperationLogLogic::deleteAll();
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('操作成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(OperationLogLogic::getError());
|
||||||
|
}
|
||||||
|
}
|
||||||
42
app/adminapi/controller/setting/system/SystemController.php
Normal file
42
app/adminapi/controller/setting/system/SystemController.php
Normal file
@@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
72
app/adminapi/controller/setting/user/UserController.php
Normal file
72
app/adminapi/controller/setting/user/UserController.php
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
<?php
|
||||||
|
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 BD
|
||||||
|
* @date 2024/3/29 10:08
|
||||||
|
*/
|
||||||
|
public function getConfig()
|
||||||
|
{
|
||||||
|
$result = (new UserLogic())->getConfig();
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 设置用户设置
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/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 BD
|
||||||
|
* @date 2024/3/29 10:08
|
||||||
|
*/
|
||||||
|
public function getRegisterConfig()
|
||||||
|
{
|
||||||
|
$result = (new UserLogic())->getRegisterConfig();
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 设置注册配置
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/3/29 10:08
|
||||||
|
*/
|
||||||
|
public function setRegisterConfig()
|
||||||
|
{
|
||||||
|
$params = (new UserConfigValidate())->post()->goCheck('register');
|
||||||
|
(new UserLogic())->setRegisterConfig($params);
|
||||||
|
return $this->success('操作成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
142
app/adminapi/controller/setting/web/WebSettingController.php
Normal file
142
app/adminapi/controller/setting/web/WebSettingController.php
Normal file
@@ -0,0 +1,142 @@
|
|||||||
|
<?php
|
||||||
|
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 BD
|
||||||
|
* @date 2023/12/28 15:44
|
||||||
|
*/
|
||||||
|
public function getWebsite()
|
||||||
|
{
|
||||||
|
$result = WebSettingLogic::getWebsiteInfo();
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 设置网站信息
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2023/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 BD
|
||||||
|
* @date 2023/12/28 15:44
|
||||||
|
*/
|
||||||
|
public function getWebsiteProject()
|
||||||
|
{
|
||||||
|
$params = $this->request->get();
|
||||||
|
$result = WebSettingLogic::getWebsiteProject($params);
|
||||||
|
if ($result === false) {
|
||||||
|
return $this->fail(WebSettingLogic::getError());
|
||||||
|
}
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 设置网站配置
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2023/12/28 15:45
|
||||||
|
*/
|
||||||
|
public function setWebsiteProject()
|
||||||
|
{
|
||||||
|
$params = $this->request->post();
|
||||||
|
$result = WebSettingLogic::setWebsiteProject($params);
|
||||||
|
if (false === $result) {
|
||||||
|
return $this->fail(WebSettingLogic::getError() ?: '操作失败');
|
||||||
|
}
|
||||||
|
return $this->success('设置成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取国际区号
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2023/12/28 16:10
|
||||||
|
*/
|
||||||
|
public function getRegioncodeAll()
|
||||||
|
{
|
||||||
|
$result = WebSettingLogic::getRegioncodeAll();
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取备案信息
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2023/12/28 16:10
|
||||||
|
*/
|
||||||
|
public function getCopyright()
|
||||||
|
{
|
||||||
|
$result = WebSettingLogic::getCopyright();
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 设置备案信息
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2023/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 BD
|
||||||
|
* @date 2023/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 BD
|
||||||
|
* @date 2023/2/15 11:16 上午
|
||||||
|
*/
|
||||||
|
public function getAgreement()
|
||||||
|
{
|
||||||
|
$result = WebSettingLogic::getAgreement();
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
193
app/adminapi/controller/tools/GeneratorController.php
Normal file
193
app/adminapi/controller/tools/GeneratorController.php
Normal file
@@ -0,0 +1,193 @@
|
|||||||
|
<?php
|
||||||
|
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 BD
|
||||||
|
* @date 2023/6/14 10:57
|
||||||
|
*/
|
||||||
|
public function dataTable()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new DataTableLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取已选择的数据表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2023/6/14 10:57
|
||||||
|
*/
|
||||||
|
public function generateTable()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new GenerateTableLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 选择数据表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2023/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 BD
|
||||||
|
* @date 2023/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 BD
|
||||||
|
* @date 2023/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 BD
|
||||||
|
* @date 2023/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 BD
|
||||||
|
* @date 2023/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 BD
|
||||||
|
* @date 2023/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 BD
|
||||||
|
* @date 2023/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 BD
|
||||||
|
* @date 2023/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 BD
|
||||||
|
* @date 2023/12/14 11:07
|
||||||
|
*/
|
||||||
|
public function getModels()
|
||||||
|
{
|
||||||
|
$result = GeneratorLogic::getAllModels();
|
||||||
|
return $this->success('', $result, 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
<?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\translation;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\logic\translation\TranslationLogic;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 翻译控制器
|
||||||
|
* Class TranslationController
|
||||||
|
* @package app\adminapi\controller\translation
|
||||||
|
*/
|
||||||
|
class TranslationController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 翻译
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/14 00:28
|
||||||
|
*/
|
||||||
|
public function translation()
|
||||||
|
{
|
||||||
|
$params = $this->request->post();
|
||||||
|
$result = TranslationLogic::translation($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
298
app/adminapi/controller/user/UserController.php
Normal file
298
app/adminapi/controller/user/UserController.php
Normal file
@@ -0,0 +1,298 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\adminapi\controller\user;
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\user\{UserLists,UserAgentLists};
|
||||||
|
use app\adminapi\logic\user\UserLogic;
|
||||||
|
use app\adminapi\validate\user\{AdjustUserMoney,AddUserValidate,UserValidate};
|
||||||
|
use app\api\validate\RegisterValidate;
|
||||||
|
/**
|
||||||
|
* 用户控制器
|
||||||
|
* Class UserController
|
||||||
|
* @package app\adminapi\controller\user
|
||||||
|
*/
|
||||||
|
class UserController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 用户列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2023/9/22 16:16
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new UserLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 代理用户列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2023/9/22 16:16
|
||||||
|
*/
|
||||||
|
public function agentLists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new UserAgentLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加用户
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2023/9/22 16:34
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new AddUserValidate())->post()->goCheck('add');
|
||||||
|
$res = UserLogic::add($params);
|
||||||
|
if (true === $res) {
|
||||||
|
return $this->success('操作成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail($res);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 修改用户密码
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2023/9/22 16:34
|
||||||
|
*/
|
||||||
|
public function changePwd()
|
||||||
|
{
|
||||||
|
$params = (new UserValidate())->post()->goCheck('changePwd');
|
||||||
|
UserLogic::changePwd($params);
|
||||||
|
return $this->success('操作成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 重置支付密码
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2023/9/22 16:34
|
||||||
|
*/
|
||||||
|
public function resetPayPwd()
|
||||||
|
{
|
||||||
|
$params = $this->request->post();
|
||||||
|
UserLogic::resetPayPwd($params);
|
||||||
|
return $this->success('操作成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 修改邮箱
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2023/9/22 16:34
|
||||||
|
*/
|
||||||
|
public function changeEmail()
|
||||||
|
{
|
||||||
|
$params = (new UserValidate())->post()->goCheck('changeEmail');
|
||||||
|
UserLogic::changeEmail($params);
|
||||||
|
return $this->success('操作成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 重置邮箱验证
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2023/9/22 16:34
|
||||||
|
*/
|
||||||
|
public function resetEmail()
|
||||||
|
{
|
||||||
|
$params = $this->request->post();
|
||||||
|
UserLogic::resetEmail($params);
|
||||||
|
return $this->success('操作成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 重置谷歌验证
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2023/9/22 16:34
|
||||||
|
*/
|
||||||
|
public function resetGoogle()
|
||||||
|
{
|
||||||
|
$params = $this->request->post();
|
||||||
|
UserLogic::resetGoogle($params);
|
||||||
|
return $this->success('操作成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 调整用户余额
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @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 更改状态
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2323/2/22 10:18
|
||||||
|
*/
|
||||||
|
public function updateMemberStatus()
|
||||||
|
{
|
||||||
|
$params = $this->request->post();
|
||||||
|
$result = UserLogic::updateMemberStatus($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('修改成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(UserLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 更改状态
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2323/2/22 10:18
|
||||||
|
*/
|
||||||
|
public function updateLhStatus()
|
||||||
|
{
|
||||||
|
$params = $this->request->post();
|
||||||
|
$result = UserLogic::updateLhStatus($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('修改成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(UserLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 更改状态
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2323/2/22 10:18
|
||||||
|
*/
|
||||||
|
public function updateTransferStatus()
|
||||||
|
{
|
||||||
|
$params = $this->request->post();
|
||||||
|
$result = UserLogic::updateTransferStatus($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('修改成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(UserLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 更改状态
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2323/2/22 10:18
|
||||||
|
*/
|
||||||
|
public function updateSnStatus()
|
||||||
|
{
|
||||||
|
$params = $this->request->post();
|
||||||
|
$result = UserLogic::updateSnStatus($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('修改成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(UserLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 更改状态
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2323/2/22 10:18
|
||||||
|
*/
|
||||||
|
public function updateOpenStatus()
|
||||||
|
{
|
||||||
|
$params = $this->request->post();
|
||||||
|
$result = UserLogic::updateOpenStatus($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('修改成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(UserLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 更改状态
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2323/2/22 10:18
|
||||||
|
*/
|
||||||
|
public function updateAgentStatus()
|
||||||
|
{
|
||||||
|
$params = $this->request->post();
|
||||||
|
$result = UserLogic::updateAgentStatus($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('修改成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 修改代理名称
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2023/9/22 16:34
|
||||||
|
*/
|
||||||
|
public function changeAgentName()
|
||||||
|
{
|
||||||
|
$params = $this->request->post();
|
||||||
|
$result = UserLogic::changeAgentName($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('修改成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 发送站内信
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2323/2/22 10:18
|
||||||
|
*/
|
||||||
|
public function sendNotice()
|
||||||
|
{
|
||||||
|
$params = $this->request->post();
|
||||||
|
$res = UserLogic::sendNotice($params);
|
||||||
|
if (true === $res) {
|
||||||
|
return $this->success('发送成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail($res);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 彩金赠送
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2323/2/22 10:18
|
||||||
|
*/
|
||||||
|
public function caijin()
|
||||||
|
{
|
||||||
|
$params = $this->request->post();
|
||||||
|
$res = UserLogic::caijin($params);
|
||||||
|
if (true === $res) {
|
||||||
|
return $this->success('赠送成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail($res);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 备注
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author bd
|
||||||
|
* @date 2024/01/31 14:07
|
||||||
|
*/
|
||||||
|
public function remark()
|
||||||
|
{
|
||||||
|
$params = $this->request->post();
|
||||||
|
$params['admin_id'] = $this->adminId;
|
||||||
|
$result = UserLogic::remark($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('备注成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(UserLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
110
app/adminapi/controller/user/UserGroupController.php
Normal file
110
app/adminapi/controller/user/UserGroupController.php
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\adminapi\controller\user;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\user\UserGroupLists;
|
||||||
|
use app\adminapi\logic\user\UserGroupLogic;
|
||||||
|
use app\adminapi\validate\user\UserGroupValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户分组控制器
|
||||||
|
* Class UserGroupController
|
||||||
|
* @package app\adminapi\controller\user
|
||||||
|
*/
|
||||||
|
class UserGroupController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取用户分组列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/04/25 01:04
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new UserGroupLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加用户分组
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/04/25 01:04
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new UserGroupValidate())->post()->goCheck('add');
|
||||||
|
$result = UserGroupLogic::add($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(UserGroupLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑用户分组
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/04/25 01:04
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new UserGroupValidate())->post()->goCheck('edit');
|
||||||
|
$result = UserGroupLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(UserGroupLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除用户分组
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/04/25 01:04
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new UserGroupValidate())->post()->goCheck('delete');
|
||||||
|
UserGroupLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取用户分组详情
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/04/25 01:04
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$params = (new UserGroupValidate())->goCheck('detail');
|
||||||
|
$result = UserGroupLogic::detail($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 用户分组
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/19 02:29
|
||||||
|
*/
|
||||||
|
public function setUserGroup()
|
||||||
|
{
|
||||||
|
$params = $this->request->post();
|
||||||
|
$result = UserGroupLogic::setUserGroup($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('分组成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(UserGroupLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
94
app/adminapi/controller/user/UserGroupRuleController.php
Normal file
94
app/adminapi/controller/user/UserGroupRuleController.php
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\adminapi\controller\user;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\user\UserGroupRuleLists;
|
||||||
|
use app\adminapi\logic\user\UserGroupRuleLogic;
|
||||||
|
use app\adminapi\validate\user\UserGroupRuleValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分组规则控制器
|
||||||
|
* Class UserGroupRuleController
|
||||||
|
* @package app\adminapi\controller\user
|
||||||
|
*/
|
||||||
|
class UserGroupRuleController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取分组规则列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/04/25 01:30
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new UserGroupRuleLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加分组规则
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/04/25 01:30
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new UserGroupRuleValidate())->post()->goCheck('add');
|
||||||
|
$result = UserGroupRuleLogic::add($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(UserGroupRuleLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑分组规则
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/04/25 01:30
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new UserGroupRuleValidate())->post()->goCheck('edit');
|
||||||
|
$result = UserGroupRuleLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(UserGroupRuleLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除分组规则
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/04/25 01:30
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new UserGroupRuleValidate())->post()->goCheck('delete');
|
||||||
|
UserGroupRuleLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取分组规则详情
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/04/25 01:30
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$params = (new UserGroupRuleValidate())->goCheck('detail');
|
||||||
|
$result = UserGroupRuleLogic::detail($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
62
app/adminapi/controller/user/UserInfoController.php
Normal file
62
app/adminapi/controller/user/UserInfoController.php
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\adminapi\controller\user;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\user\UserInfoLists;
|
||||||
|
use app\adminapi\logic\user\UserInfoLogic;
|
||||||
|
use app\adminapi\validate\user\UserInfoValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户信息控制器
|
||||||
|
* Class UserInfoController
|
||||||
|
* @package app\adminapi\controller\user
|
||||||
|
*/
|
||||||
|
class UserInfoController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取用户信息列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/06/08 17:51
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new UserInfoLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 同意实名
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/06/08 17:51
|
||||||
|
*/
|
||||||
|
public function agree()
|
||||||
|
{
|
||||||
|
$params = $this->request->post();
|
||||||
|
$result = UserInfoLogic::agree($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('同意成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(UserInfoLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 拒绝实名
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/06/08 17:51
|
||||||
|
*/
|
||||||
|
public function refuse()
|
||||||
|
{
|
||||||
|
$params = $this->request->post();
|
||||||
|
$result = UserInfoLogic::refuse($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('拒绝成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(UserInfoLogic::getError());
|
||||||
|
}
|
||||||
|
}
|
||||||
94
app/adminapi/controller/user/UserKadanController.php
Normal file
94
app/adminapi/controller/user/UserKadanController.php
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\adminapi\controller\user;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\user\UserKadanLists;
|
||||||
|
use app\adminapi\logic\user\UserKadanLogic;
|
||||||
|
use app\adminapi\validate\user\UserKadanValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 卡单规则控制器
|
||||||
|
* Class UserKadanController
|
||||||
|
* @package app\adminapi\controller\user
|
||||||
|
*/
|
||||||
|
class UserKadanController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取卡单规则列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/04/24 17:00
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new UserKadanLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加卡单规则
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/04/24 17:00
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new UserKadanValidate())->post()->goCheck('add');
|
||||||
|
$result = UserKadanLogic::add($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(UserKadanLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑卡单规则
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/04/24 17:00
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new UserKadanValidate())->post()->goCheck('edit');
|
||||||
|
$result = UserKadanLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(UserKadanLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除卡单规则
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/04/24 17:00
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new UserKadanValidate())->post()->goCheck('delete');
|
||||||
|
UserKadanLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取卡单规则详情
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/04/24 17:00
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$params = (new UserKadanValidate())->goCheck('detail');
|
||||||
|
$result = UserKadanLogic::detail($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
94
app/adminapi/controller/user/UserMineRecordController.php
Normal file
94
app/adminapi/controller/user/UserMineRecordController.php
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\adminapi\controller\user;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\user\UserMineRecordLists;
|
||||||
|
use app\adminapi\logic\user\UserMineRecordLogic;
|
||||||
|
use app\adminapi\validate\user\UserMineRecordValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 挖矿记录控制器
|
||||||
|
* Class UserMineRecordController
|
||||||
|
* @package app\adminapi\controller\user
|
||||||
|
*/
|
||||||
|
class UserMineRecordController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取挖矿记录列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2025/01/01 15:47
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new UserMineRecordLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加挖矿记录
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2025/01/01 15:47
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new UserMineRecordValidate())->post()->goCheck('add');
|
||||||
|
$result = UserMineRecordLogic::add($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(UserMineRecordLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑挖矿记录
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2025/01/01 15:47
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new UserMineRecordValidate())->post()->goCheck('edit');
|
||||||
|
$result = UserMineRecordLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(UserMineRecordLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除挖矿记录
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2025/01/01 15:47
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new UserMineRecordValidate())->post()->goCheck('delete');
|
||||||
|
UserMineRecordLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取挖矿记录详情
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2025/01/01 15:47
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$params = (new UserMineRecordValidate())->goCheck('detail');
|
||||||
|
$result = UserMineRecordLogic::detail($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
94
app/adminapi/controller/user/UserNoticeController.php
Normal file
94
app/adminapi/controller/user/UserNoticeController.php
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\adminapi\controller\user;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\user\UserNoticeLists;
|
||||||
|
use app\adminapi\logic\user\UserNoticeLogic;
|
||||||
|
use app\adminapi\validate\user\UserNoticeValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户消息控制器
|
||||||
|
* Class UserNoticeController
|
||||||
|
* @package app\adminapi\controller\user
|
||||||
|
*/
|
||||||
|
class UserNoticeController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取用户消息列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/05/26 00:36
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new UserNoticeLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加用户消息
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/05/26 00:36
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new UserNoticeValidate())->post()->goCheck('add');
|
||||||
|
$result = UserNoticeLogic::add($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(UserNoticeLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑用户消息
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/05/26 00:36
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new UserNoticeValidate())->post()->goCheck('edit');
|
||||||
|
$result = UserNoticeLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(UserNoticeLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除用户消息
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/05/26 00:36
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new UserNoticeValidate())->post()->goCheck('delete');
|
||||||
|
UserNoticeLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取用户消息详情
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/05/26 00:36
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$params = (new UserNoticeValidate())->goCheck('detail');
|
||||||
|
$result = UserNoticeLogic::detail($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
30
app/adminapi/controller/user/UserRelationController.php
Normal file
30
app/adminapi/controller/user/UserRelationController.php
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\adminapi\controller\user;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\user\UserRelationLists;
|
||||||
|
use app\adminapi\logic\user\UserRelationLogic;
|
||||||
|
use app\adminapi\validate\user\UserRelationValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户关系控制器
|
||||||
|
* Class UserRelationController
|
||||||
|
* @package app\adminapi\controller\user
|
||||||
|
*/
|
||||||
|
class UserRelationController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取用户关系列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/01/12 17:21
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new UserRelationLists());
|
||||||
|
}
|
||||||
|
}
|
||||||
150
app/adminapi/controller/user/UserTronController.php
Normal file
150
app/adminapi/controller/user/UserTronController.php
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\adminapi\controller\user;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\user\UserTronLists;
|
||||||
|
use app\adminapi\logic\user\UserTronLogic;
|
||||||
|
use app\adminapi\validate\user\UserTronValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 波场钱包控制器
|
||||||
|
* Class UserTronController
|
||||||
|
* @package app\adminapi\controller\user
|
||||||
|
*/
|
||||||
|
class UserTronController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取波场钱包列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/05/04 23:38
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new UserTronLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 创建波场钱包
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/05/04 23:38
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$result = UserTronLogic::add();
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('创建成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(UserTronLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑波场钱包
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/05/04 23:38
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new UserTronValidate())->post()->goCheck('edit');
|
||||||
|
$result = UserTronLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(UserTronLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除波场钱包
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/05/04 23:38
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new UserTronValidate())->post()->goCheck('delete');
|
||||||
|
UserTronLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取波场钱包详情
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/05/04 23:38
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$params = (new UserTronValidate())->goCheck('detail');
|
||||||
|
$result = UserTronLogic::detail($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 更新排序
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/05/04 23:38
|
||||||
|
*/
|
||||||
|
public function updateSort()
|
||||||
|
{
|
||||||
|
$params = $this->request->post();
|
||||||
|
UserTronLogic::updateSort($params);
|
||||||
|
return $this->success('更新成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 更新金额
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/05/04 23:38
|
||||||
|
*/
|
||||||
|
public function updateMoney()
|
||||||
|
{
|
||||||
|
$params = $this->request->post();
|
||||||
|
UserTronLogic::updateMoney($params);
|
||||||
|
return $this->success('更新成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 转账
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/05/04 23:38
|
||||||
|
*/
|
||||||
|
public function tran()
|
||||||
|
{
|
||||||
|
$params = (new UserTronValidate())->post()->goCheck('tran');
|
||||||
|
$res = UserTronLogic::tran($params);
|
||||||
|
if (true === $res) {
|
||||||
|
return $this->success('转账成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail($res);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 资金归集
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/05/04 23:38
|
||||||
|
*/
|
||||||
|
public function tranAll()
|
||||||
|
{
|
||||||
|
$params = (new UserTronValidate())->post()->goCheck('tranAll');
|
||||||
|
$res = UserTronLogic::tranAll($params);
|
||||||
|
if (true === $res) {
|
||||||
|
return $this->success('归集完成', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail($res);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
110
app/adminapi/controller/withdraw/WithdrawBankController.php
Normal file
110
app/adminapi/controller/withdraw/WithdrawBankController.php
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\adminapi\controller\withdraw;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\withdraw\WithdrawBankLists;
|
||||||
|
use app\adminapi\logic\withdraw\WithdrawBankLogic;
|
||||||
|
use app\adminapi\validate\withdraw\WithdrawBankValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 可提现银行控制器
|
||||||
|
* Class WithdrawBankController
|
||||||
|
* @package app\adminapi\controller\withdraw
|
||||||
|
*/
|
||||||
|
class WithdrawBankController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取可提现银行列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/02/25 12:19
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new WithdrawBankLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加可提现银行
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/02/25 12:19
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new WithdrawBankValidate())->post()->goCheck('add');
|
||||||
|
$result = WithdrawBankLogic::add($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(WithdrawBankLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑可提现银行
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/02/25 12:19
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new WithdrawBankValidate())->post()->goCheck('edit');
|
||||||
|
$result = WithdrawBankLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(WithdrawBankLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除可提现银行
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/02/25 12:19
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new WithdrawBankValidate())->post()->goCheck('delete');
|
||||||
|
WithdrawBankLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取可提现银行详情
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/02/25 12:19
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$params = (new WithdrawBankValidate())->goCheck('detail');
|
||||||
|
$result = WithdrawBankLogic::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 BD
|
||||||
|
* @date 2024/02/25 12:19
|
||||||
|
*/
|
||||||
|
public function allByLang()
|
||||||
|
{
|
||||||
|
$params = (new WithdrawBankValidate())->goCheck('allByLang');
|
||||||
|
$result = WithdrawBankLogic::allByLang($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
108
app/adminapi/controller/withdraw/WithdrawMethodController.php
Normal file
108
app/adminapi/controller/withdraw/WithdrawMethodController.php
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\adminapi\controller\withdraw;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\withdraw\WithdrawMethodLists;
|
||||||
|
use app\adminapi\logic\withdraw\WithdrawMethodLogic;
|
||||||
|
use app\adminapi\validate\withdraw\WithdrawMethodValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提现方式控制器
|
||||||
|
* Class WithdrawMethodController
|
||||||
|
* @package app\adminapi\controller\withdraw
|
||||||
|
*/
|
||||||
|
class WithdrawMethodController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取提现方式列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/02/23 14:34
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new WithdrawMethodLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加提现方式
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/02/23 14:34
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new WithdrawMethodValidate())->post()->goCheck('add');
|
||||||
|
$result = WithdrawMethodLogic::add($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(WithdrawMethodLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑提现方式
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/02/23 14:34
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new WithdrawMethodValidate())->post()->goCheck('edit');
|
||||||
|
$result = WithdrawMethodLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(WithdrawMethodLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除提现方式
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/02/23 14:34
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new WithdrawMethodValidate())->post()->goCheck('delete');
|
||||||
|
WithdrawMethodLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取提现方式详情
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/02/23 14:34
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$params = (new WithdrawMethodValidate())->goCheck('detail');
|
||||||
|
$result = WithdrawMethodLogic::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 BD
|
||||||
|
* @date 2024/02/23 14:34
|
||||||
|
*/
|
||||||
|
public function all()
|
||||||
|
{
|
||||||
|
$result = WithdrawMethodLogic::getAllData();
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\adminapi\controller\withdraw;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\withdraw\WithdrawWalletLists;
|
||||||
|
use app\adminapi\logic\withdraw\WithdrawWalletLogic;
|
||||||
|
use app\adminapi\validate\withdraw\WithdrawWalletValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户提现钱包控制器
|
||||||
|
* Class WithdrawWalletController
|
||||||
|
* @package app\adminapi\controller\withdraw
|
||||||
|
*/
|
||||||
|
class WithdrawWalletController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取用户提现钱包列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/02/26 13:32
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new WithdrawWalletLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑用户提现钱包
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/02/26 13:32
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new WithdrawWalletValidate())->post()->goCheck('edit');
|
||||||
|
$result = WithdrawWalletLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(WithdrawWalletLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除用户提现钱包
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/02/26 13:32
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new WithdrawWalletValidate())->post()->goCheck('delete');
|
||||||
|
WithdrawWalletLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
23
app/adminapi/event.php
Normal file
23
app/adminapi/event.php
Normal file
@@ -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' => [],
|
||||||
|
]
|
||||||
|
];
|
||||||
89
app/adminapi/http/middleware/AuthMiddleware.php
Normal file
89
app/adminapi/http/middleware/AuthMiddleware.php
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
<?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 (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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
50
app/adminapi/http/middleware/CheckDemoMiddleware.php
Normal file
50
app/adminapi/http/middleware/CheckDemoMiddleware.php
Normal file
@@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
114
app/adminapi/http/middleware/EncryDemoDataMiddleware.php
Normal file
114
app/adminapi/http/middleware/EncryDemoDataMiddleware.php
Normal file
@@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
57
app/adminapi/http/middleware/InitMiddleware.php
Normal file
57
app/adminapi/http/middleware/InitMiddleware.php
Normal file
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
78
app/adminapi/http/middleware/LoginMiddleware.php
Normal file
78
app/adminapi/http/middleware/LoginMiddleware.php
Normal file
@@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
89
app/adminapi/listener/OperationLog.php
Normal file
89
app/adminapi/listener/OperationLog.php
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
namespace app\adminapi\listener;
|
||||||
|
|
||||||
|
|
||||||
|
use ReflectionClass;
|
||||||
|
use think\Exception;
|
||||||
|
use app\common\service\ConfigService;
|
||||||
|
|
||||||
|
class OperationLog
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @notes 管理员操作日志
|
||||||
|
* @param $response
|
||||||
|
* @return bool|void
|
||||||
|
* @throws \ReflectionException
|
||||||
|
* @author 段誉
|
||||||
|
* @date 2022/4/8 17:09
|
||||||
|
*/
|
||||||
|
public function handle($response)
|
||||||
|
{
|
||||||
|
$request = request();
|
||||||
|
|
||||||
|
//判断是否记录日志
|
||||||
|
$request_type = $request->isGet() ? 1 : 2;
|
||||||
|
$log_way = ConfigService::get('website', 'log_way');
|
||||||
|
if (!in_array($request_type, $log_way)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//需要登录的接口,无效访问时不记录
|
||||||
|
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['password_pay'])) {
|
||||||
|
$params['password_pay'] = "******";
|
||||||
|
}
|
||||||
|
//过滤密钥参数
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
39
app/adminapi/lists/BaseAdminDataLists.php
Normal file
39
app/adminapi/lists/BaseAdminDataLists.php
Normal file
@@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
98
app/adminapi/lists/article/ArticleCateLists.php
Normal file
98
app/adminapi/lists/article/ArticleCateLists.php
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
<?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
|
||||||
|
{
|
||||||
|
$ArticleCateLists = ArticleCate::where($this->searchWhere)
|
||||||
|
->append(['is_show_desc'])
|
||||||
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
|
->order($this->sortOrder)
|
||||||
|
->append(['article_count'])
|
||||||
|
->select()
|
||||||
|
->toArray();
|
||||||
|
|
||||||
|
return $ArticleCateLists;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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 [];
|
||||||
|
}
|
||||||
|
}
|
||||||
99
app/adminapi/lists/article/ArticleLists.php
Normal file
99
app/adminapi/lists/article/ArticleLists.php
Normal file
@@ -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']
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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 [];
|
||||||
|
}
|
||||||
|
}
|
||||||
208
app/adminapi/lists/auth/AdminLists.php
Normal file
208
app/adminapi/lists/auth/AdminLists.php
Normal file
@@ -0,0 +1,208 @@
|
|||||||
|
<?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', 'google_key', 'google_qrcode',
|
||||||
|
'login_time', 'login_ip', 'multipoint_login', 'avatar'
|
||||||
|
];
|
||||||
|
|
||||||
|
$adminLists = Admin::field($field)
|
||||||
|
->where(['is_agent' => 0])
|
||||||
|
->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(['is_agent' => 0])
|
||||||
|
->where($this->searchWhere)
|
||||||
|
->where($this->queryWhere())
|
||||||
|
->count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function extend()
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
58
app/adminapi/lists/auth/MenuLists.php
Normal file
58
app/adminapi/lists/auth/MenuLists.php
Normal file
@@ -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();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
94
app/adminapi/lists/auth/RoleLists.php
Normal file
94
app/adminapi/lists/auth/RoleLists.php
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
<?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')
|
||||||
|
->where("id <> 6")
|
||||||
|
->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::where("id <> 6")->count();
|
||||||
|
}
|
||||||
|
}
|
||||||
61
app/adminapi/lists/crontab/CrontabLists.php
Normal file
61
app/adminapi/lists/crontab/CrontabLists.php
Normal file
@@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
95
app/adminapi/lists/decorate/DecorateHintLists.php
Normal file
95
app/adminapi/lists/decorate/DecorateHintLists.php
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
<?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\model\decorate\DecorateHint;
|
||||||
|
use app\common\lists\ListsSearchInterface;
|
||||||
|
use app\common\service\FileService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提示内容列表
|
||||||
|
* Class DecorateHintLists
|
||||||
|
* @package app\adminapi\listsdecorate
|
||||||
|
*/
|
||||||
|
class DecorateHintLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 设置搜索条件
|
||||||
|
* @return \string[][]
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/17 17:01
|
||||||
|
*/
|
||||||
|
public function setSearch(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取提示内容列表
|
||||||
|
* @return array
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/17 17:01
|
||||||
|
*/
|
||||||
|
public function lists(): array
|
||||||
|
{
|
||||||
|
$items = DecorateHint::where($this->searchWhere)
|
||||||
|
->field(['id', 'cid', 'title', 'text', 'content', 'is_show', 'sort', 'image', 'contract_y_logo', 'contract_b_logo', 'langs', 'create_time'])
|
||||||
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
|
->order(['sort' => 'desc','cid' => 'desc','id' => 'desc'])
|
||||||
|
->select()
|
||||||
|
->toArray();
|
||||||
|
|
||||||
|
foreach ($items as &$item) {
|
||||||
|
$item['langs'] = json_decode($item['langs'], JSON_UNESCAPED_UNICODE);
|
||||||
|
foreach ($item['langs'] as &$content_lang) {
|
||||||
|
if(isset($content_lang['image'])){
|
||||||
|
$content_lang['image'] = FileService::getFileUrl($content_lang['image']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$content_lang['content'] = get_file_domain($content_lang['content']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($item['id'] == 23){
|
||||||
|
$item['contract_y_logo'] = FileService::getFileUrl($item['contract_y_logo']);
|
||||||
|
$item['contract_b_logo'] = FileService::getFileUrl($item['contract_b_logo']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $items;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取提示内容数量
|
||||||
|
* @return int
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/17 17:01
|
||||||
|
*/
|
||||||
|
public function count(): int
|
||||||
|
{
|
||||||
|
return DecorateHint::where($this->searchWhere)->count();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
83
app/adminapi/lists/decorate/DecorateNavLists.php
Normal file
83
app/adminapi/lists/decorate/DecorateNavLists.php
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
<?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\model\decorate\DecorateNav;
|
||||||
|
use app\common\lists\ListsSearchInterface;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 菜单按钮列表
|
||||||
|
* Class DecorateNavLists
|
||||||
|
* @package app\adminapi\listsdecorate
|
||||||
|
*/
|
||||||
|
class DecorateNavLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 设置搜索条件
|
||||||
|
* @return \string[][]
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/17 16:41
|
||||||
|
*/
|
||||||
|
public function setSearch(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取菜单按钮列表
|
||||||
|
* @return array
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/17 16:41
|
||||||
|
*/
|
||||||
|
public function lists(): array
|
||||||
|
{
|
||||||
|
$items = DecorateNav::where($this->searchWhere)
|
||||||
|
->field(['id', 'name', 'image', 'image_ext', 'link', 'loca', 'is_show', 'sort', 'langs'])
|
||||||
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
|
->order(['sort' => 'desc','id' => 'desc'])
|
||||||
|
->select()
|
||||||
|
->toArray();
|
||||||
|
|
||||||
|
foreach ($items as &$item) {
|
||||||
|
$item['langs'] = json_decode($item['langs'], JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $items;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取菜单按钮数量
|
||||||
|
* @return int
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/17 16:41
|
||||||
|
*/
|
||||||
|
public function count(): int
|
||||||
|
{
|
||||||
|
return DecorateNav::where($this->searchWhere)->count();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
88
app/adminapi/lists/decorate/DecorateSwiperLists.php
Normal file
88
app/adminapi/lists/decorate/DecorateSwiperLists.php
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
<?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\model\decorate\DecorateSwiper;
|
||||||
|
use app\common\lists\ListsSearchInterface;
|
||||||
|
use app\common\service\FileService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 轮播图列表
|
||||||
|
* Class DecorateSwiperLists
|
||||||
|
* @package app\adminapi\lists\decorate
|
||||||
|
*/
|
||||||
|
class DecorateSwiperLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 设置搜索条件
|
||||||
|
* @return \string[][]
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/16 17:34
|
||||||
|
*/
|
||||||
|
public function setSearch(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取轮播图列表
|
||||||
|
* @return array
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/16 17:34
|
||||||
|
*/
|
||||||
|
public function lists(): array
|
||||||
|
{
|
||||||
|
$DecorateSwipers = DecorateSwiper::where($this->searchWhere)
|
||||||
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
|
->order(['sort' => 'desc','id' => 'desc'])
|
||||||
|
->select()
|
||||||
|
->toArray();
|
||||||
|
|
||||||
|
foreach ($DecorateSwipers as &$item) {
|
||||||
|
$item['langs'] = json_decode($item['langs'], JSON_UNESCAPED_UNICODE);
|
||||||
|
|
||||||
|
foreach ($item['langs'] as &$content_lang) {
|
||||||
|
$content_lang['image'] = FileService::getFileUrl($content_lang['image']);
|
||||||
|
// if(!isset($content_lang['image_ext'])) $content_lang['image_ext'] = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $DecorateSwipers;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取轮播图数量
|
||||||
|
* @return int
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/16 17:34
|
||||||
|
*/
|
||||||
|
public function count(): int
|
||||||
|
{
|
||||||
|
return DecorateSwiper::where($this->searchWhere)->count();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
105
app/adminapi/lists/dept/JobsLists.php
Normal file
105
app/adminapi/lists/dept/JobsLists.php
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
<?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\dept;
|
||||||
|
|
||||||
|
use app\adminapi\lists\BaseAdminDataLists;
|
||||||
|
use app\common\lists\ListsExcelInterface;
|
||||||
|
use app\common\lists\ListsSearchInterface;
|
||||||
|
use app\common\model\dept\Jobs;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 岗位列表
|
||||||
|
* Class JobsLists
|
||||||
|
* @package app\adminapi\lists\dept
|
||||||
|
*/
|
||||||
|
class JobsLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExcelInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 设置搜索条件
|
||||||
|
* @return \string[][]
|
||||||
|
* @author 段誉
|
||||||
|
* @date 2022/5/26 9:46
|
||||||
|
*/
|
||||||
|
public function setSearch(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'%like%' => ['name'],
|
||||||
|
'=' => ['code', 'status']
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取管理列表
|
||||||
|
* @return array
|
||||||
|
* @author heshihu
|
||||||
|
* @date 2022/2/21 17:11
|
||||||
|
*/
|
||||||
|
public function lists(): array
|
||||||
|
{
|
||||||
|
$lists = Jobs::where($this->searchWhere)
|
||||||
|
->append(['status_desc'])
|
||||||
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
|
->order(['sort' => 'desc', 'id' => 'desc'])
|
||||||
|
->select()
|
||||||
|
->toArray();
|
||||||
|
|
||||||
|
return $lists;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取数量
|
||||||
|
* @return int
|
||||||
|
* @author 段誉
|
||||||
|
* @date 2022/5/26 9:48
|
||||||
|
*/
|
||||||
|
public function count(): int
|
||||||
|
{
|
||||||
|
return Jobs::where($this->searchWhere)->count();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 导出文件名
|
||||||
|
* @return string
|
||||||
|
* @author 段誉
|
||||||
|
* @date 2022/11/24 16:17
|
||||||
|
*/
|
||||||
|
public function setFileName(): string
|
||||||
|
{
|
||||||
|
return '岗位列表';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 导出字段
|
||||||
|
* @return string[]
|
||||||
|
* @author 段誉
|
||||||
|
* @date 2022/11/24 16:17
|
||||||
|
*/
|
||||||
|
public function setExcelFields(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'code' => '岗位编码',
|
||||||
|
'name' => '岗位名称',
|
||||||
|
'remark' => '备注',
|
||||||
|
'status_desc' => '状态',
|
||||||
|
'create_time' => '添加时间',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
70
app/adminapi/lists/feedback/FeedbackCateLists.php
Normal file
70
app/adminapi/lists/feedback/FeedbackCateLists.php
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\adminapi\lists\feedback;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\lists\BaseAdminDataLists;
|
||||||
|
use app\common\model\feedback\FeedbackCate;
|
||||||
|
use app\common\lists\ListsSearchInterface;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 意见反馈类型列表
|
||||||
|
* Class FeedbackCateLists
|
||||||
|
* @package app\adminapi\listsfeedback
|
||||||
|
*/
|
||||||
|
class FeedbackCateLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 设置搜索条件
|
||||||
|
* @return \string[][]
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/06/06 00:12
|
||||||
|
*/
|
||||||
|
public function setSearch(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'=' => ['name', 'sort', 'is_show'],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取意见反馈类型列表
|
||||||
|
* @return array
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/06/06 00:12
|
||||||
|
*/
|
||||||
|
public function lists(): array
|
||||||
|
{
|
||||||
|
$cates = FeedbackCate::where($this->searchWhere)
|
||||||
|
->field(['id', 'name', 'sort', 'is_show', 'langs'])
|
||||||
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
|
->order(['sort' => 'desc','id' => 'desc'])
|
||||||
|
->select()
|
||||||
|
->toArray();
|
||||||
|
|
||||||
|
foreach ($cates as $k => $v) {
|
||||||
|
$cates[$k]['langs'] = json_decode($v['langs'], JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $cates;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取意见反馈类型数量
|
||||||
|
* @return int
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/06/06 00:12
|
||||||
|
*/
|
||||||
|
public function count(): int
|
||||||
|
{
|
||||||
|
return FeedbackCate::where($this->searchWhere)->count();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
74
app/adminapi/lists/feedback/FeedbackRecordLists.php
Normal file
74
app/adminapi/lists/feedback/FeedbackRecordLists.php
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\adminapi\lists\feedback;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\lists\BaseAdminDataLists;
|
||||||
|
use app\common\model\feedback\FeedbackRecord;
|
||||||
|
use app\common\lists\ListsSearchInterface;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 意见反馈记录列表
|
||||||
|
* Class FeedbackRecordLists
|
||||||
|
* @package app\adminapi\listsfeedback
|
||||||
|
*/
|
||||||
|
class FeedbackRecordLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 设置搜索条件
|
||||||
|
* @return \string[][]
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/06/06 01:11
|
||||||
|
*/
|
||||||
|
public function setSearch(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取意见反馈记录列表
|
||||||
|
* @return array
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/06/06 01:11
|
||||||
|
*/
|
||||||
|
public function lists(): array
|
||||||
|
{
|
||||||
|
$field = 'fr.id,fr.cid,fr.content,fr.create_time';
|
||||||
|
$field .= ',u.account,u.sn as u_sn,u.mobile';
|
||||||
|
|
||||||
|
return FeedbackRecord::alias('fr')
|
||||||
|
->field($field)
|
||||||
|
->join('user u', 'u.id = fr.user_id')
|
||||||
|
->append(['cate_name'])
|
||||||
|
->where($this->searchWhere)
|
||||||
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
|
->order(['id' => 'desc'])
|
||||||
|
->select()
|
||||||
|
->toArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取意见反馈记录数量
|
||||||
|
* @return int
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/06/06 01:11
|
||||||
|
*/
|
||||||
|
public function count(): int
|
||||||
|
{
|
||||||
|
|
||||||
|
return FeedbackRecord::alias('fr')
|
||||||
|
->join('user u', 'u.id = fr.user_id')
|
||||||
|
->where($this->searchWhere)
|
||||||
|
->count();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
73
app/adminapi/lists/file/FileCateLists.php
Normal file
73
app/adminapi/lists/file/FileCateLists.php
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
<?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\file;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\lists\BaseAdminDataLists;
|
||||||
|
use app\common\lists\ListsSearchInterface;
|
||||||
|
use app\common\model\file\FileCate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件分类列表
|
||||||
|
* Class FileCateLists
|
||||||
|
* @package app\adminapi\lists\file
|
||||||
|
*/
|
||||||
|
class FileCateLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 文件分类搜素条件
|
||||||
|
* @return \string[][]
|
||||||
|
* @author 段誉
|
||||||
|
* @date 2021/12/29 14:24
|
||||||
|
*/
|
||||||
|
public function setSearch(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'=' => ['type']
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取文件分类列表
|
||||||
|
* @return array
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
* @author 段誉
|
||||||
|
* @date 2021/12/29 14:24
|
||||||
|
*/
|
||||||
|
public function lists(): array
|
||||||
|
{
|
||||||
|
$lists = (new FileCate())->field(['id,pid,type,name'])
|
||||||
|
->where($this->searchWhere)
|
||||||
|
->select()->toArray();
|
||||||
|
|
||||||
|
return linear_to_tree($lists, 'children');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取文件分类数量
|
||||||
|
* @return int
|
||||||
|
* @author 段誉
|
||||||
|
* @date 2021/12/29 14:24
|
||||||
|
*/
|
||||||
|
public function count(): int
|
||||||
|
{
|
||||||
|
return (new FileCate())->where($this->searchWhere)->count();
|
||||||
|
}
|
||||||
|
}
|
||||||
86
app/adminapi/lists/file/FileLists.php
Normal file
86
app/adminapi/lists/file/FileLists.php
Normal file
@@ -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\lists\file;
|
||||||
|
|
||||||
|
use app\adminapi\lists\BaseAdminDataLists;
|
||||||
|
use app\common\enum\FileEnum;
|
||||||
|
use app\common\lists\ListsSearchInterface;
|
||||||
|
use app\common\model\file\File;
|
||||||
|
use app\common\service\FileService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件列表
|
||||||
|
* Class FileLists
|
||||||
|
* @package app\adminapi\lists\file
|
||||||
|
*/
|
||||||
|
class FileLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 文件搜索条件
|
||||||
|
* @return \string[][]
|
||||||
|
* @author 段誉
|
||||||
|
* @date 2021/12/29 14:27
|
||||||
|
*/
|
||||||
|
public function setSearch(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'=' => ['type', 'cid'],
|
||||||
|
'%like%' => ['name']
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取文件列表
|
||||||
|
* @return array
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
* @author 段誉
|
||||||
|
* @date 2021/12/29 14:27
|
||||||
|
*/
|
||||||
|
public function lists(): array
|
||||||
|
{
|
||||||
|
$lists = (new File())->field(['id,cid,type,name,uri,create_time'])
|
||||||
|
->order('id', 'desc')
|
||||||
|
->where($this->searchWhere)
|
||||||
|
->where('source', FileEnum::SOURCE_ADMIN)
|
||||||
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
|
->select()
|
||||||
|
->toArray();
|
||||||
|
|
||||||
|
foreach ($lists as &$item) {
|
||||||
|
$item['url'] = $item['uri'];
|
||||||
|
$item['uri'] = FileService::getFileUrl($item['uri']);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $lists;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取文件数量
|
||||||
|
* @return int
|
||||||
|
* @author 段誉
|
||||||
|
* @date 2021/12/29 14:29
|
||||||
|
*/
|
||||||
|
public function count(): int
|
||||||
|
{
|
||||||
|
return (new File())->where($this->searchWhere)
|
||||||
|
->where('source', FileEnum::SOURCE_ADMIN)
|
||||||
|
->count();
|
||||||
|
}
|
||||||
|
}
|
||||||
276
app/adminapi/lists/finance/AgentRechargeRecordLists.php
Normal file
276
app/adminapi/lists/finance/AgentRechargeRecordLists.php
Normal file
@@ -0,0 +1,276 @@
|
|||||||
|
<?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\finance;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\lists\BaseAdminDataLists;
|
||||||
|
use app\common\model\finance\RechargeRecord;
|
||||||
|
use app\common\model\user\{User,UserRelation,UserRelationAgent};
|
||||||
|
use app\common\lists\ListsSearchInterface;
|
||||||
|
use app\common\lists\ListsExtendInterface;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值记录列表
|
||||||
|
* Class AgentRechargeRecordLists
|
||||||
|
* @package app\adminapi\listsfinance
|
||||||
|
*/
|
||||||
|
class AgentRechargeRecordLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExtendInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 设置搜索条件
|
||||||
|
* @return \string[][]
|
||||||
|
* @author bd
|
||||||
|
* @date 2024/01/31 14:07
|
||||||
|
*/
|
||||||
|
public function setSearch(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'=' => [ 'rr.sn', 'rr.method_id', 'rr.status'],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 搜索条件
|
||||||
|
* @author 段誉
|
||||||
|
* @date 2023/2/24 16:08
|
||||||
|
*/
|
||||||
|
public function queryWhere()
|
||||||
|
{
|
||||||
|
$where = [];
|
||||||
|
// 用户编号
|
||||||
|
if (!empty($this->params['user_info'])) {
|
||||||
|
$where[] = ['u.sn|u.account|u.mobile', '=', $this->params['user_info']];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 用户编号
|
||||||
|
if (!empty($this->params['u_sn'])) {
|
||||||
|
$where[] = ['u.sn', '=', $this->params['u_sn']];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 所在代数
|
||||||
|
if (!empty($this->params['level'])) {
|
||||||
|
$where[] = ['ur.level', '=', $this->params['level']];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 下单时间
|
||||||
|
if (!empty($this->params['start_time']) && !empty($this->params['end_time'])) {
|
||||||
|
$time = [strtotime($this->params['start_time']), strtotime($this->params['end_time'])];
|
||||||
|
$where[] = ['rr.create_time', 'between', $time];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $where;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取充值记录列表
|
||||||
|
* @return array
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
* @author bd
|
||||||
|
* @date 2024/01/31 14:07
|
||||||
|
*/
|
||||||
|
public function lists(): array
|
||||||
|
{
|
||||||
|
//根据管理员ID获取代理
|
||||||
|
$user = User::where(['agent_id' => $this->adminId])->findOrEmpty();
|
||||||
|
|
||||||
|
$where = " 1 = 1 ";
|
||||||
|
|
||||||
|
if (!$user->isEmpty()) {
|
||||||
|
$top_id = $user['id'];
|
||||||
|
$parent_id = $user['id'];
|
||||||
|
//查询伞下用户
|
||||||
|
if(isset($this->params['parent_sn']) && $this->params['parent_sn'] !=""){
|
||||||
|
$userParent = User::where(['sn' => $this->params['parent_sn']]) -> findOrEmpty();
|
||||||
|
if (!$userParent->isEmpty()){
|
||||||
|
$parent_id = $userParent['id'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$where .= " AND ur.top_id = $top_id AND ur.parent_id = $parent_id ";
|
||||||
|
}else{
|
||||||
|
$where .= " AND 1 = 2 ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 金额范围
|
||||||
|
if (!empty($this->params['money_min'])) {
|
||||||
|
$money_min = $this->params['money_min'];
|
||||||
|
$where .= " AND rr.amount >= $money_min ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 金额范围
|
||||||
|
if (!empty($this->params['money_max'])) {
|
||||||
|
$money_max = $this->params['money_max'];
|
||||||
|
$where .= " AND rr.amount <= $money_max ";
|
||||||
|
}
|
||||||
|
|
||||||
|
$field = 'rr.id,rr.sn,rr.user_id,rr.method_id,rr.amount,rr.amount_act,rr.account as method_account,rr.voucher,rr.rate,rr.symbol,rr.status,rr.user_money,rr.remark,rr.remark2,rr.create_time,rr.update_time';
|
||||||
|
$field .= ',u.account,u.sn as u_sn,u.mobile,u.country_code,u.recharge_num,u.withdraw_num';
|
||||||
|
$field .= ',ur.level';
|
||||||
|
|
||||||
|
|
||||||
|
return RechargeRecord::alias('rr')
|
||||||
|
->join('user u', 'u.id = rr.user_id')
|
||||||
|
->join('user_relation_agent ur', 'rr.user_id = ur.user_id')
|
||||||
|
->field($field)
|
||||||
|
->append(['method','status_text','team_top'])
|
||||||
|
->where($where)
|
||||||
|
->where($this->queryWhere())
|
||||||
|
->where($this->searchWhere)
|
||||||
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
|
->order(['rr.id' => 'desc'])
|
||||||
|
->select()
|
||||||
|
->toArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取充值记录数量
|
||||||
|
* @return int
|
||||||
|
* @author bd
|
||||||
|
* @date 2024/01/31 14:07
|
||||||
|
*/
|
||||||
|
public function count(): int
|
||||||
|
{
|
||||||
|
//根据管理员ID获取代理
|
||||||
|
$user = User::where(['agent_id' => $this->adminId])->findOrEmpty();
|
||||||
|
|
||||||
|
$where = " 1 = 1 ";
|
||||||
|
|
||||||
|
if (!$user->isEmpty()) {
|
||||||
|
$top_id = $user['id'];
|
||||||
|
$parent_id = $user['id'];
|
||||||
|
//查询伞下用户
|
||||||
|
if(isset($this->params['parent_sn']) && $this->params['parent_sn'] !=""){
|
||||||
|
$userParent = User::where(['sn' => $this->params['parent_sn']]) -> findOrEmpty();
|
||||||
|
if (!$userParent->isEmpty()){
|
||||||
|
$parent_id = $userParent['id'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$where .= " AND ur.top_id = $top_id AND ur.parent_id = $parent_id ";
|
||||||
|
}else{
|
||||||
|
$where .= " AND 1 = 2 ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 金额范围
|
||||||
|
if (!empty($this->params['money_min'])) {
|
||||||
|
$money_min = $this->params['money_min'];
|
||||||
|
$where .= " AND rr.amount >= $money_min ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 金额范围
|
||||||
|
if (!empty($this->params['money_max'])) {
|
||||||
|
$money_max = $this->params['money_max'];
|
||||||
|
$where .= " AND rr.amount <= $money_max ";
|
||||||
|
}
|
||||||
|
|
||||||
|
return RechargeRecord::alias('rr')
|
||||||
|
->join('user u', 'u.id = rr.user_id')
|
||||||
|
->join('user_relation_agent ur', 'rr.user_id = ur.user_id')
|
||||||
|
->where($where)
|
||||||
|
->where($this->queryWhere())
|
||||||
|
->where($this->searchWhere)
|
||||||
|
->count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function extend(): array
|
||||||
|
{
|
||||||
|
//根据管理员ID获取代理
|
||||||
|
$user = User::where(['agent_id' => $this->adminId])->findOrEmpty();
|
||||||
|
|
||||||
|
$where = " 1 = 1 ";
|
||||||
|
|
||||||
|
if (!$user->isEmpty()) {
|
||||||
|
$top_id = $user['id'];
|
||||||
|
$parent_id = $user['id'];
|
||||||
|
//查询伞下用户
|
||||||
|
if(isset($this->params['parent_sn']) && $this->params['parent_sn'] !=""){
|
||||||
|
$userParent = User::where(['sn' => $this->params['parent_sn']]) -> findOrEmpty();
|
||||||
|
if (!$userParent->isEmpty()){
|
||||||
|
$parent_id = $userParent['id'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$where .= " AND ur.top_id = $top_id AND ur.parent_id = $parent_id ";
|
||||||
|
}else{
|
||||||
|
$where .= " AND 1 = 2 ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 金额范围
|
||||||
|
if (!empty($this->params['money_min'])) {
|
||||||
|
$money_min = $this->params['money_min'];
|
||||||
|
$where .= " AND rr.amount >= $money_min ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 金额范围
|
||||||
|
if (!empty($this->params['money_max'])) {
|
||||||
|
$money_max = $this->params['money_max'];
|
||||||
|
$where .= " AND rr.amount <= $money_max ";
|
||||||
|
}
|
||||||
|
|
||||||
|
$total = RechargeRecord::alias('rr')
|
||||||
|
->join('user u', 'u.id = rr.user_id')
|
||||||
|
->join('user_relation_agent ur', 'rr.user_id = ur.user_id')
|
||||||
|
->where($where)
|
||||||
|
->where($this->queryWhere())
|
||||||
|
->where($this->searchWhere)
|
||||||
|
->sum('rr.amount');
|
||||||
|
$ing = RechargeRecord::alias('rr')
|
||||||
|
->join('user u', 'u.id = rr.user_id')
|
||||||
|
->join('user_relation_agent ur', 'rr.user_id = ur.user_id')
|
||||||
|
->where($where)
|
||||||
|
->where(['status' => 0])
|
||||||
|
->where($this->queryWhere())
|
||||||
|
->where($this->searchWhere)
|
||||||
|
->sum('rr.amount');
|
||||||
|
$success = RechargeRecord::alias('rr')
|
||||||
|
->join('user u', 'u.id = rr.user_id')
|
||||||
|
->join('user_relation_agent ur', 'rr.user_id = ur.user_id')
|
||||||
|
->where($where)
|
||||||
|
->where(['status' => 1])
|
||||||
|
->where($this->queryWhere())
|
||||||
|
->where($this->searchWhere)
|
||||||
|
->sum('rr.amount');
|
||||||
|
|
||||||
|
$success_count = RechargeRecord::alias('rr')
|
||||||
|
->join('user u', 'u.id = rr.user_id')
|
||||||
|
->join('user_relation_agent ur', 'rr.user_id = ur.user_id')
|
||||||
|
->where($where)
|
||||||
|
->where(['status' => 1])
|
||||||
|
->where($this->queryWhere())
|
||||||
|
->where($this->searchWhere)
|
||||||
|
->count();
|
||||||
|
|
||||||
|
$error = RechargeRecord::alias('rr')
|
||||||
|
->join('user u', 'u.id = rr.user_id')
|
||||||
|
->join('user_relation_agent ur', 'rr.user_id = ur.user_id')
|
||||||
|
->where($where)
|
||||||
|
->where(['status' => 2])
|
||||||
|
->where($this->queryWhere())
|
||||||
|
->where($this->searchWhere)
|
||||||
|
->sum('rr.amount');
|
||||||
|
|
||||||
|
return [
|
||||||
|
'total' => round($total, 2),
|
||||||
|
'ing' => round($ing, 2),
|
||||||
|
'success' => round($success, 2),
|
||||||
|
'success_count' => $success_count,
|
||||||
|
'error' => round($error, 2),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
160
app/adminapi/lists/finance/AgentUserFinanceLists.php
Normal file
160
app/adminapi/lists/finance/AgentUserFinanceLists.php
Normal file
@@ -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\lists\finance;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\lists\BaseAdminDataLists;
|
||||||
|
use app\common\model\finance\UserFinance;
|
||||||
|
use app\common\model\user\{User,UserRelation,UserRelationAgent};
|
||||||
|
use app\common\lists\ListsSearchInterface;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资金明细列表
|
||||||
|
* Class AgentUserFinanceLists
|
||||||
|
* @package app\adminapi\listsfinance
|
||||||
|
*/
|
||||||
|
class AgentUserFinanceLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 设置搜索条件
|
||||||
|
* @return \string[][]
|
||||||
|
* @author bd
|
||||||
|
* @date 2024/01/31 14:07
|
||||||
|
*/
|
||||||
|
public function setSearch(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'=' => [ 'uf.sn', 'uf.change_type'],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 搜索条件
|
||||||
|
* @author 段誉
|
||||||
|
* @date 2023/2/24 16:08
|
||||||
|
*/
|
||||||
|
public function queryWhere()
|
||||||
|
{
|
||||||
|
$where = [];
|
||||||
|
// 用户编号
|
||||||
|
if (!empty($this->params['user_info'])) {
|
||||||
|
$where[] = ['u.sn|u.account|u.mobile', '=', $this->params['user_info']];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 所在代数
|
||||||
|
if (!empty($this->params['level'])) {
|
||||||
|
$where[] = ['ur.level', '=', $this->params['level']];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 下单时间
|
||||||
|
if (!empty($this->params['start_time']) && !empty($this->params['end_time'])) {
|
||||||
|
$time = [strtotime($this->params['start_time']), strtotime($this->params['end_time'])];
|
||||||
|
$where[] = ['uf.create_time', 'between', $time];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $where;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取资金明细列表
|
||||||
|
* @return array
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/07 13:10
|
||||||
|
*/
|
||||||
|
public function lists(): array
|
||||||
|
{
|
||||||
|
//根据管理员ID获取代理
|
||||||
|
$user = User::where(['agent_id' => $this->adminId])->findOrEmpty();
|
||||||
|
|
||||||
|
$where = " 1 = 1 ";
|
||||||
|
|
||||||
|
if (!$user->isEmpty()) {
|
||||||
|
$top_id = $user['id'];
|
||||||
|
$parent_id = $user['id'];
|
||||||
|
//查询伞下用户
|
||||||
|
if(isset($this->params['parent_sn']) && $this->params['parent_sn'] !=""){
|
||||||
|
$userParent = User::where(['sn' => $this->params['parent_sn']]) -> findOrEmpty();
|
||||||
|
if (!$userParent->isEmpty()){
|
||||||
|
$parent_id = $userParent['id'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$where .= " AND ur.top_id = $top_id AND ur.parent_id = $parent_id ";
|
||||||
|
}else{
|
||||||
|
$where .= " AND 1 = 2 ";
|
||||||
|
}
|
||||||
|
|
||||||
|
$field = 'uf.id,uf.sn,uf.user_id,uf.change_type,uf.action,uf.change_amount,uf.left_amount,uf.source_sn,uf.remark,uf.create_time';
|
||||||
|
$field .= ',u.account,u.sn as u_sn,u.mobile,u.country_code';
|
||||||
|
$field .= ',ur.level';
|
||||||
|
|
||||||
|
return UserFinance::alias('uf')
|
||||||
|
->join('user u', 'u.id = uf.user_id')
|
||||||
|
->join('user_relation_agent ur', 'uf.user_id = ur.user_id')
|
||||||
|
->field($field)
|
||||||
|
->append(['team_top'])
|
||||||
|
->where($where)
|
||||||
|
->where($this->queryWhere())
|
||||||
|
->where($this->searchWhere)
|
||||||
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
|
->order(['uf.id' => 'desc'])
|
||||||
|
->select()
|
||||||
|
->toArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取资金明细数量
|
||||||
|
* @return int
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/03/07 13:10
|
||||||
|
*/
|
||||||
|
public function count(): int
|
||||||
|
{
|
||||||
|
//根据管理员ID获取代理
|
||||||
|
$user = User::where(['agent_id' => $this->adminId])->findOrEmpty();
|
||||||
|
|
||||||
|
$where = " 1 = 1 ";
|
||||||
|
|
||||||
|
if (!$user->isEmpty()) {
|
||||||
|
$top_id = $user['id'];
|
||||||
|
$parent_id = $user['id'];
|
||||||
|
//查询伞下用户
|
||||||
|
if(isset($this->params['parent_sn']) && $this->params['parent_sn'] !=""){
|
||||||
|
$userParent = User::where(['sn' => $this->params['parent_sn']]) -> findOrEmpty();
|
||||||
|
if (!$userParent->isEmpty()){
|
||||||
|
$parent_id = $userParent['id'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$where .= " AND ur.top_id = $top_id AND ur.parent_id = $parent_id ";
|
||||||
|
}else{
|
||||||
|
$where .= " AND 1 = 2 ";
|
||||||
|
}
|
||||||
|
|
||||||
|
return UserFinance::alias('uf')
|
||||||
|
->join('user u', 'u.id = uf.user_id')
|
||||||
|
->join('user_relation_agent ur', 'uf.user_id = ur.user_id')
|
||||||
|
->where($where)
|
||||||
|
->where($this->queryWhere())
|
||||||
|
->where($this->searchWhere)
|
||||||
|
->count();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
280
app/adminapi/lists/finance/AgentWithdrawRecordLists.php
Normal file
280
app/adminapi/lists/finance/AgentWithdrawRecordLists.php
Normal file
@@ -0,0 +1,280 @@
|
|||||||
|
<?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\finance;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\lists\BaseAdminDataLists;
|
||||||
|
use app\common\model\finance\WithdrawRecord;
|
||||||
|
use app\common\model\user\{User,UserRelation,UserRelationAgent};
|
||||||
|
use app\common\lists\ListsSearchInterface;
|
||||||
|
use app\common\lists\ListsExtendInterface;
|
||||||
|
use app\common\model\withdraw\WithdrawWallet;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提现记录列表
|
||||||
|
* Class AgentWithdrawRecordLists
|
||||||
|
* @package app\adminapi\listsfinance
|
||||||
|
*/
|
||||||
|
class AgentWithdrawRecordLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExtendInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 设置搜索条件
|
||||||
|
* @return \string[][]
|
||||||
|
* @author bd
|
||||||
|
* @date 2024/01/31 14:07
|
||||||
|
*/
|
||||||
|
public function setSearch(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'=' => [ 'wr.sn', 'wr.method_id', 'wr.status'],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 搜索条件
|
||||||
|
* @author 段誉
|
||||||
|
* @date 2023/2/24 16:08
|
||||||
|
*/
|
||||||
|
public function queryWhere()
|
||||||
|
{
|
||||||
|
$where = [];
|
||||||
|
// 用户编号
|
||||||
|
if (!empty($this->params['user_info'])) {
|
||||||
|
$where[] = ['u.sn|u.account|u.mobile', '=', $this->params['user_info']];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 用户编号
|
||||||
|
if (!empty($this->params['u_sn'])) {
|
||||||
|
$where[] = ['u.sn', '=', $this->params['u_sn']];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 所在代数
|
||||||
|
if (!empty($this->params['level'])) {
|
||||||
|
$where[] = ['ur.level', '=', $this->params['level']];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 下单时间
|
||||||
|
if (!empty($this->params['start_time']) && !empty($this->params['end_time'])) {
|
||||||
|
$time = [strtotime($this->params['start_time']), strtotime($this->params['end_time'])];
|
||||||
|
$where[] = ['wr.create_time', 'between', $time];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $where;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取提现记录列表
|
||||||
|
* @return array
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/02/25 12:35
|
||||||
|
*/
|
||||||
|
public function lists(): array
|
||||||
|
{
|
||||||
|
//根据管理员ID获取代理
|
||||||
|
$user = User::where(['agent_id' => $this->adminId])->findOrEmpty();
|
||||||
|
|
||||||
|
$where = " 1 = 1 ";
|
||||||
|
|
||||||
|
if (!$user->isEmpty()) {
|
||||||
|
$top_id = $user['id'];
|
||||||
|
$parent_id = $user['id'];
|
||||||
|
//查询伞下用户
|
||||||
|
if(isset($this->params['parent_sn']) && $this->params['parent_sn'] !=""){
|
||||||
|
$userParent = User::where(['sn' => $this->params['parent_sn']]) -> findOrEmpty();
|
||||||
|
if (!$userParent->isEmpty()){
|
||||||
|
$parent_id = $userParent['id'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$where .= " AND ur.top_id = $top_id AND ur.parent_id = $parent_id ";
|
||||||
|
}else{
|
||||||
|
$where .= " AND 1 = 2 ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 金额范围
|
||||||
|
if (!empty($this->params['money_min'])) {
|
||||||
|
$money_min = $this->params['money_min'];
|
||||||
|
$where .= " AND wr.amount >= $money_min ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 金额范围
|
||||||
|
if (!empty($this->params['money_max'])) {
|
||||||
|
$money_max = $this->params['money_max'];
|
||||||
|
$where .= " AND wr.amount <= $money_max ";
|
||||||
|
}
|
||||||
|
|
||||||
|
$field = 'wr.id,wr.sn,wr.user_id,wr.method_id,wr.wallet_id,wr.amount,wr.amount_act,wr.rate,wr.symbol,wr.status,wr.status2,wr.charge,wr.remark,wr.user_money,wr.create_time,wr.update_time';
|
||||||
|
|
||||||
|
$field .= ',wr.type,wr.name,wr.bank_name,wr.account,wr.img';
|
||||||
|
$field .= ',u.account as u_account,u.sn as u_sn,u.mobile,u.country_code,u.recharge_num,u.withdraw_num,u.remark2';
|
||||||
|
$field .= ',ur.level';
|
||||||
|
|
||||||
|
$lists = WithdrawRecord::alias('wr')
|
||||||
|
->join('user u', 'u.id = wr.user_id')
|
||||||
|
->join('user_relation_agent ur', 'wr.user_id = ur.user_id')
|
||||||
|
->field($field)
|
||||||
|
->append(['method_name','status_text','act_amount','team_top'])
|
||||||
|
->where($where)
|
||||||
|
->where($this->queryWhere())
|
||||||
|
->where($this->searchWhere)
|
||||||
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
|
->order(['wr.id' => 'desc'])
|
||||||
|
->select()
|
||||||
|
->toArray();
|
||||||
|
|
||||||
|
return $lists;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取提现记录数量
|
||||||
|
* @return int
|
||||||
|
* @author BD
|
||||||
|
* @date 2024/02/25 12:35
|
||||||
|
*/
|
||||||
|
public function count(): int
|
||||||
|
{
|
||||||
|
//根据管理员ID获取代理
|
||||||
|
$user = User::where(['agent_id' => $this->adminId])->findOrEmpty();
|
||||||
|
|
||||||
|
$where = " 1 = 1 ";
|
||||||
|
|
||||||
|
if (!$user->isEmpty()) {
|
||||||
|
$top_id = $user['id'];
|
||||||
|
$parent_id = $user['id'];
|
||||||
|
//查询伞下用户
|
||||||
|
if(isset($this->params['parent_sn']) && $this->params['parent_sn'] !=""){
|
||||||
|
$userParent = User::where(['sn' => $this->params['parent_sn']]) -> findOrEmpty();
|
||||||
|
if (!$userParent->isEmpty()){
|
||||||
|
$parent_id = $userParent['id'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$where .= " AND ur.top_id = $top_id AND ur.parent_id = $parent_id ";
|
||||||
|
}else{
|
||||||
|
$where .= " AND 1 = 2 ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 金额范围
|
||||||
|
if (!empty($this->params['money_min'])) {
|
||||||
|
$money_min = $this->params['money_min'];
|
||||||
|
$where .= " AND wr.amount >= $money_min ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 金额范围
|
||||||
|
if (!empty($this->params['money_max'])) {
|
||||||
|
$money_max = $this->params['money_max'];
|
||||||
|
$where .= " AND wr.amount <= $money_max ";
|
||||||
|
}
|
||||||
|
|
||||||
|
return WithdrawRecord::alias('wr')
|
||||||
|
->join('user u', 'u.id = wr.user_id')
|
||||||
|
->join('user_relation_agent ur', 'wr.user_id = ur.user_id')
|
||||||
|
->where($where)
|
||||||
|
->where($this->queryWhere())
|
||||||
|
->where($this->searchWhere)
|
||||||
|
->count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function extend(): array
|
||||||
|
{
|
||||||
|
//根据管理员ID获取代理
|
||||||
|
$user = User::where(['agent_id' => $this->adminId])->findOrEmpty();
|
||||||
|
|
||||||
|
$where = " 1 = 1 ";
|
||||||
|
|
||||||
|
if (!$user->isEmpty()) {
|
||||||
|
$top_id = $user['id'];
|
||||||
|
$parent_id = $user['id'];
|
||||||
|
//查询伞下用户
|
||||||
|
if(isset($this->params['parent_sn']) && $this->params['parent_sn'] !=""){
|
||||||
|
$userParent = User::where(['sn' => $this->params['parent_sn']]) -> findOrEmpty();
|
||||||
|
if (!$userParent->isEmpty()){
|
||||||
|
$parent_id = $userParent['id'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$where .= " AND ur.top_id = $top_id AND ur.parent_id = $parent_id ";
|
||||||
|
}else{
|
||||||
|
$where .= " AND 1 = 2 ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 金额范围
|
||||||
|
if (!empty($this->params['money_min'])) {
|
||||||
|
$money_min = $this->params['money_min'];
|
||||||
|
$where .= " AND wr.amount >= $money_min ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 金额范围
|
||||||
|
if (!empty($this->params['money_max'])) {
|
||||||
|
$money_max = $this->params['money_max'];
|
||||||
|
$where .= " AND wr.amount <= $money_max ";
|
||||||
|
}
|
||||||
|
|
||||||
|
$total = WithdrawRecord::alias('wr')
|
||||||
|
->join('user u', 'u.id = wr.user_id')
|
||||||
|
->join('user_relation_agent ur', 'wr.user_id = ur.user_id')
|
||||||
|
->where($where)
|
||||||
|
->where($this->queryWhere())
|
||||||
|
->where($this->searchWhere)
|
||||||
|
->sum('wr.amount');
|
||||||
|
$ing = WithdrawRecord::alias('wr')
|
||||||
|
->join('user u', 'u.id = wr.user_id')
|
||||||
|
->join('user_relation_agent ur', 'wr.user_id = ur.user_id')
|
||||||
|
->where($where)
|
||||||
|
->where(['status' => 0])
|
||||||
|
->where($this->queryWhere())
|
||||||
|
->where($this->searchWhere)
|
||||||
|
->sum('wr.amount');
|
||||||
|
$success = WithdrawRecord::alias('wr')
|
||||||
|
->join('user u', 'u.id = wr.user_id')
|
||||||
|
->join('user_relation_agent ur', 'wr.user_id = ur.user_id')
|
||||||
|
->where($where)
|
||||||
|
->where(['status' => 1])
|
||||||
|
->where($this->queryWhere())
|
||||||
|
->where($this->searchWhere)
|
||||||
|
->sum('wr.amount');
|
||||||
|
|
||||||
|
$success_count = WithdrawRecord::alias('wr')
|
||||||
|
->join('user u', 'u.id = wr.user_id')
|
||||||
|
->join('user_relation_agent ur', 'wr.user_id = ur.user_id')
|
||||||
|
->where($where)
|
||||||
|
->where(['status' => 1])
|
||||||
|
->where($this->queryWhere())
|
||||||
|
->where($this->searchWhere)
|
||||||
|
->count();
|
||||||
|
|
||||||
|
$error = WithdrawRecord::alias('wr')
|
||||||
|
->join('user u', 'u.id = wr.user_id')
|
||||||
|
->join('user_relation_agent ur', 'wr.user_id = ur.user_id')
|
||||||
|
->where($where)
|
||||||
|
->where(['status' => 2])
|
||||||
|
->where($this->queryWhere())
|
||||||
|
->where($this->searchWhere)
|
||||||
|
->sum('wr.amount');
|
||||||
|
|
||||||
|
return [
|
||||||
|
'total' => round($total, 2),
|
||||||
|
'ing' => round($ing, 2),
|
||||||
|
'success' => round($success, 2),
|
||||||
|
'success_count' => $success_count,
|
||||||
|
'error' => round($error, 2),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user