first commit

This commit is contained in:
Your Name
2026-01-19 14:19:22 +08:00
commit fe2d9c1868
4777 changed files with 665503 additions and 0 deletions

View 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;
}
}

View 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 [];
}
}

View 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 [];
}
}

View 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 [];
}
}

View 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();
}
}

View 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();
}
}

View 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();
}
}

View 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();
}
}

View 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();
}
}

View 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();
}
}

View 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' => '添加时间',
];
}
}

View 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();
}
}

View 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();
}
}

View 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();
}
}

View 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();
}
}

View 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),
];
}
}

View 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();
}
}

View 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),
];
}
}

View File

@@ -0,0 +1,310 @@
<?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\ListsExcelInterface;
use app\common\lists\ListsExtendInterface;
/**
* 充值记录列表
* Class RechargeRecordLists
* @package app\adminapi\listsfinance
*/
class RechargeRecordLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExcelInterface,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['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
{
$where = " 1 = 1 ";
// 金额范围
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';
$join_table = "user t";
$join_require = 't.id = rr.user_id';
if(isset($this->params['parent_sn']) && $this->params['parent_sn'] !=""){
$join_table = "user_relation_agent ur";
$join_require = 'rr.user_id = ur.user_id';
$user = User::where(['sn' => $this->params['parent_sn']]) -> findOrEmpty();
$parent_id = 0;
if (!$user->isEmpty()) $parent_id = $user['id'];
$where .= " AND ur.parent_id = $parent_id ";
if(isset($this->params['level']) && $this->params['level'] !=""){
$level = $this->params['level'];
$where .= " AND ur.level = $level ";
}
$field .= ',ur.level';
}
$lists = RechargeRecord::alias('rr')
->join('user u', 'u.id = rr.user_id')
->join($join_table, $join_require)
->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();
foreach ($lists as &$item) {
if(isset($item['level']) && isset($item['team_top']['level'])){
$item['team_top']['level'] = $item['level'];
}
}
return $lists;
}
/**
* @notes 获取充值记录数量
* @return int
* @author bd
* @date 2024/01/31 14:07
*/
public function count(): int
{
$where = " 1 = 1 ";
// 金额范围
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 ";
}
$join_table = "user t";
$join_require = 't.id = rr.user_id';
if(isset($this->params['parent_sn']) && $this->params['parent_sn'] !=""){
$join_table = "user_relation_agent ur";
$join_require = 'rr.user_id = ur.user_id';
$user = User::where(['sn' => $this->params['parent_sn']]) -> findOrEmpty();
$parent_id = 0;
if (!$user->isEmpty()) $parent_id = $user['id'];
$where .= " AND ur.parent_id = $parent_id ";
if(isset($this->params['level']) && $this->params['level'] !=""){
$level = $this->params['level'];
$where .= " AND ur.level = $level ";
}
}
return RechargeRecord::alias('rr')
->join('user u', 'u.id = rr.user_id')
->join($join_table, $join_require)
->where($where)
->where($this->queryWhere())
->where($this->searchWhere)
->count();
}
public function extend(): array
{
$where = " 1 = 1 ";
// 金额范围
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 ";
}
$join_table = "user t";
$join_require = 't.id = rr.user_id';
if(isset($this->params['parent_sn']) && $this->params['parent_sn'] !=""){
$join_table = "user_relation_agent ur";
$join_require = 'rr.user_id = ur.user_id';
$user = User::where(['sn' => $this->params['parent_sn']]) -> findOrEmpty();
$parent_id = 0;
if (!$user->isEmpty()) $parent_id = $user['id'];
$where .= " AND ur.parent_id = $parent_id ";
if(isset($this->params['level']) && $this->params['level'] !=""){
$level = $this->params['level'];
$where .= " AND ur.level = $level ";
}
}
$total = RechargeRecord::alias('rr')
->join('user u', 'u.id = rr.user_id')
->join($join_table, $join_require)
->where($where)
->where($this->queryWhere())
->where($this->searchWhere)
->sum('rr.amount');
$ing = RechargeRecord::alias('rr')
->join('user u', 'u.id = rr.user_id')
->join($join_table, $join_require)
->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($join_table, $join_require)
->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($join_table, $join_require)
->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($join_table, $join_require)
->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),
];
}
/**
* @notes 导出文件名
* @return string
* @author bd
* @date 2024/01/31 14:07
*/
public function setFileName(): string
{
return '充值记录';
}
/**
* @notes 导出字段
* @return string[]
* @author bd
* @date 2024/01/31 14:07
*/
public function setExcelFields(): array
{
return [
'account' => '用户账号',
'sn' => '订单编号',
'method_name' => '充值方式',
'amount' => '充值金额',
'status_text' => '状态',
'create_time' => '下单时间',
];
}
}

View File

@@ -0,0 +1,161 @@
<?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 UserFinanceLists
* @package app\adminapi\listsfinance
*/
class UserFinanceLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author bd
* @date 2024/01/31 14:07
*/
public function setSearch(): array
{
return [
'=' => [ 'uf.sn', 'uf.frozen', '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['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
{
$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,uf.thaw_time,uf.frozen';
$field .= ',u.account,u.sn as u_sn,u.mobile,u.country_code';
$where = " 1 = 1 ";
$join_table = "user t";
$join_require = 't.id = uf.user_id';
if(isset($this->params['parent_sn']) && $this->params['parent_sn'] !=""){
$join_table = "user_relation_agent ur";
$join_require = 'uf.user_id = ur.user_id';
$user = User::where(['sn' => $this->params['parent_sn']]) -> findOrEmpty();
$parent_id = 0;
if (!$user->isEmpty()) $parent_id = $user['id'];
$where .= " AND ur.parent_id = $parent_id ";
if(isset($this->params['level']) && $this->params['level'] !=""){
$level = $this->params['level'];
$where .= " AND ur.level = $level ";
}
$field .= ',ur.level';
}
$lists = UserFinance::alias('uf')
->join('user u', 'u.id = uf.user_id')
->join($join_table, $join_require)
->field($field)
->append(['team_top'])
->where($where)
->where($this->queryWhere())
->where($this->searchWhere)
->limit($this->limitOffset, $this->limitLength)
->order(['uf.id' => 'desc'])
->select()
->toArray();
foreach ($lists as &$item) {
if(isset($item['level']) && isset($item['team_top']['level'])){
$item['team_top']['level'] = $item['level'];
}
}
return $lists;
}
/**
* @notes 获取资金明细数量
* @return int
* @author BD
* @date 2024/03/07 13:10
*/
public function count(): int
{
$where = " 1 = 1 ";
$join_table = "user t";
$join_require = 't.id = uf.user_id';
if(isset($this->params['parent_sn']) && $this->params['parent_sn'] !=""){
$join_table = "user_relation_agent ur";
$join_require = 'uf.user_id = ur.user_id';
$user = User::where(['sn' => $this->params['parent_sn']]) -> findOrEmpty();
$parent_id = 0;
if (!$user->isEmpty()) $parent_id = $user['id'];
$where .= " AND ur.parent_id = $parent_id ";
if(isset($this->params['level']) && $this->params['level'] !=""){
$level = $this->params['level'];
$where .= " AND ur.level = $level ";
}
}
return UserFinance::alias('uf')
->join('user u', 'u.id = uf.user_id')
->join($join_table, $join_require)
->where($where)
->where($this->queryWhere())
->where($this->searchWhere)
->count();
}
}

View File

@@ -0,0 +1,313 @@
<?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\ListsExcelInterface;
use app\common\lists\ListsExtendInterface;
use app\common\model\withdraw\WithdrawWallet;
/**
* 提现记录列表
* Class WithdrawRecordLists
* @package app\adminapi\listsfinance
*/
class WithdrawRecordLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExcelInterface,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['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
{
$where = " 1 = 1 ";
// 金额范围
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.remark_df,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';
$join_table = "user t";
$join_require = 't.id = wr.user_id';
if(isset($this->params['parent_sn']) && $this->params['parent_sn'] !=""){
$join_table = "user_relation_agent ur";
$join_require = 'wr.user_id = ur.user_id';
$user = User::where(['sn' => $this->params['parent_sn']]) -> findOrEmpty();
$parent_id = 0;
if (!$user->isEmpty()) $parent_id = $user['id'];
$where .= " AND ur.parent_id = $parent_id ";
if(isset($this->params['level']) && $this->params['level'] !=""){
$level = $this->params['level'];
$where .= " AND ur.level = $level ";
}
$field .= ',ur.level';
}
$lists = WithdrawRecord::alias('wr')
->join('user u', 'u.id = wr.user_id')
->join($join_table, $join_require)
->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();
foreach ($lists as &$item) {
if(isset($item['level']) && isset($item['team_top']['level'])){
$item['team_top']['level'] = $item['level'];
}
}
return $lists;
}
/**
* @notes 获取提现记录数量
* @return int
* @author BD
* @date 2024/02/25 12:35
*/
public function count(): int
{
$where = " 1 = 1 ";
// 金额范围
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 ";
}
$join_table = "user t";
$join_require = 't.id = wr.user_id';
if(isset($this->params['parent_sn']) && $this->params['parent_sn'] !=""){
$join_table = "user_relation_agent ur";
$join_require = 'wr.user_id = ur.user_id';
$user = User::where(['sn' => $this->params['parent_sn']]) -> findOrEmpty();
$parent_id = 0;
if (!$user->isEmpty()) $parent_id = $user['id'];
$where .= " AND ur.parent_id = $parent_id ";
if(isset($this->params['level']) && $this->params['level'] !=""){
$level = $this->params['level'];
$where .= " AND ur.level = $level ";
}
}
return WithdrawRecord::alias('wr')
->join('user u', 'u.id = wr.user_id')
->join($join_table, $join_require)
->where($where)
->where($this->queryWhere())
->where($this->searchWhere)
->count();
}
public function extend(): array
{
$where = " 1 = 1 ";
// 金额范围
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 ";
}
$join_table = "user t";
$join_require = 't.id = wr.user_id';
if(isset($this->params['parent_sn']) && $this->params['parent_sn'] !=""){
$join_table = "user_relation_agent ur";
$join_require = 'wr.user_id = ur.user_id';
$user = User::where(['sn' => $this->params['parent_sn']]) -> findOrEmpty();
$parent_id = 0;
if (!$user->isEmpty()) $parent_id = $user['id'];
$where .= " AND ur.parent_id = $parent_id ";
if(isset($this->params['level']) && $this->params['level'] !=""){
$level = $this->params['level'];
$where .= " AND ur.level = $level ";
}
}
$total = WithdrawRecord::alias('wr')
->join('user u', 'u.id = wr.user_id')
->join($join_table, $join_require)
->where($where)
->where($this->queryWhere())
->where($this->searchWhere)
->sum('wr.amount');
$ing = WithdrawRecord::alias('wr')
->join('user u', 'u.id = wr.user_id')
->join($join_table, $join_require)
->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($join_table, $join_require)
->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($join_table, $join_require)
->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($join_table, $join_require)
->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),
];
}
/**
* @notes 导出文件名
* @return string
* @author bd
* @date 2024/01/31 14:07
*/
public function setFileName(): string
{
return '提现记录';
}
/**
* @notes 导出字段
* @return string[]
* @author bd
* @date 2024/01/31 14:07
*/
public function setExcelFields(): array
{
return [
'account' => '用户账号',
'sn' => '订单编号',
'method_name' => '提现方式',
'amount' => '提现金额',
'charge' => '手续费',
'status_text' => '状态',
'create_time' => '下单时间',
];
}
}

View 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\goods;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\goods\GoodsCate;
use app\common\lists\ListsSearchInterface;
/**
* 商品分类列表
* Class GoodsCateLists
* @package app\adminapi\listsgoods
*/
class GoodsCateLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author BD
* @date 2024/03/11 01:58
*/
public function setSearch(): array
{
return [
'=' => ['name', 'is_show'],
];
}
/**
* @notes 获取商品分类列表
* @return array
* @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 lists(): array
{
$cates = GoodsCate::where($this->searchWhere)
->field(['id', 'name', 'sort', 'is_show', 'langs'])
->limit($this->limitOffset, $this->limitLength)
->order(['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/03/11 01:58
*/
public function count(): int
{
return GoodsCate::where($this->searchWhere)->count();
}
}

View 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\goods;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\goods\Goods;
use app\common\lists\ListsSearchInterface;
use app\common\service\FileService;
/**
* 商品列表
* Class GoodsLists
* @package app\adminapi\listsgoods
*/
class GoodsLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author BD
* @date 2024/03/11 01:58
*/
public function setSearch(): array
{
return [
'=' => ['cid', 'title', 'is_show'],
];
}
/**
* @notes 获取商品列表
* @return array
* @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 lists(): array
{
$goods = Goods::where($this->searchWhere)
->append(['cate_name'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
->toArray();
foreach ($goods as &$item) {
$item['num'] = 1;
$item['langs'] = json_decode($item['langs'], JSON_UNESCAPED_UNICODE);
// foreach ($item['langs'] as &$content_lang) {
// $content_lang['image'] = FileService::getFileUrl($content_lang['image']);
// }
}
return $goods;
}
/**
* @notes 获取商品数量
* @return int
* @author BD
* @date 2024/03/11 01:58
*/
public function count(): int
{
return Goods::where($this->searchWhere)->count();
}
}

View 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\lists\goods;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\goods\GoodsRecord;
use app\common\lists\ListsSearchInterface;
/**
* 抢单记录列表
* Class GoodsRecordLists
* @package app\adminapi\listsgoods
*/
class GoodsRecordLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author BD
* @date 2024/03/19 02:29
*/
public function setSearch(): array
{
return [
'=' => ['gr.sn', 'gr.status', 'gr.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['start_time']) && !empty($this->params['end_time'])) {
$time = [strtotime($this->params['start_time']), strtotime($this->params['end_time'])];
$where[] = ['gr.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/19 02:29
*/
public function lists(): array
{
$field = 'gr.id,gr.sn,gr.user_id,gr.goods_title,gr.goods_image,gr.money,gr.commission,gr.status,gr.type,gr.create_time,gr.pay_time';
$field .= ',u.account,u.sn as u_sn,u.mobile';
return GoodsRecord::alias('gr')
->join('user u', 'u.id = gr.user_id')
->field($field)
->where($this->queryWhere())
->where($this->searchWhere)
->limit($this->limitOffset, $this->limitLength)
->order(['gr.id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取抢单记录数量
* @return int
* @author BD
* @date 2024/03/19 02:29
*/
public function count(): int
{
return GoodsRecord::alias('gr')
->join('user u', 'u.id = gr.user_id')
->where($this->queryWhere())
->where($this->searchWhere)
->count();
}
}

View 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\item;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\item\ItemCate;
use app\common\lists\ListsSearchInterface;
/**
* 项目分类列表
* Class ItemCateLists
* @package app\adminapi\listsitem
*/
class ItemCateLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author likeadmin
* @date 2024/01/16 13:23
*/
public function setSearch(): array
{
return [
];
}
/**
* @notes 获取项目分类列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author likeadmin
* @date 2024/01/16 13:23
*/
public function lists(): array
{
$itemCate = ItemCate::where($this->searchWhere)
->field(['id', 'name', 'sort', 'is_show', 'langs'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
->toArray();
foreach ($itemCate as $k => $v) {
$itemCate[$k]['langs'] = json_decode($v['langs'], JSON_UNESCAPED_UNICODE);
}
return $itemCate;
}
/**
* @notes 获取项目分类数量
* @return int
* @author likeadmin
* @date 2024/01/16 13:23
*/
public function count(): int
{
return ItemCate::where($this->searchWhere)->count();
}
}

View File

@@ -0,0 +1,90 @@
<?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\item;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\item\Item;
use app\common\lists\ListsSearchInterface;
use app\common\service\FileService;
/**
* 项目列表
* Class ItemLists
* @package app\adminapi\listsitem
*/
class ItemLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author BD
* @date 2024/01/16 13:23
*/
public function setSearch(): array
{
return [
'=' => ['type', 'is_show'],
'%like%' => ['title'],
];
}
/**
* @notes 获取项目列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author BD
* @date 2024/01/16 13:23
*/
public function lists(): array
{
$items = Item::where($this->searchWhere)
->append(['vip_name'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
->toArray();
foreach ($items 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']);
$content_lang['content'] = get_file_domain($content_lang['content']);
}
}
return $items;
}
/**
* @notes 获取项目数量
* @return int
* @author BD
* @date 2024/01/16 13:23
*/
public function count(): int
{
return Item::where($this->searchWhere)->count();
}
}

View File

@@ -0,0 +1,101 @@
<?php
namespace app\adminapi\lists\item;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\item\ItemRecord;
use app\common\lists\ListsSearchInterface;
/**
* 项目记录列表
* Class ItemRecordLists
* @package app\adminapi\listsitem
*/
class ItemRecordLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author bd
* @date 2024/01/31 14:07
*/
public function setSearch(): array
{
return [
'=' => ['ir.sn', 'ir.contract_no', 'ir.type', 'ir.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['start_time_create']) && !empty($this->params['end_time_create'])) {
$time = [strtotime($this->params['start_time_create']), strtotime($this->params['end_time_create'])];
$where[] = ['ir.create_time', 'between', $time];
}
// 到期时间
if (!empty($this->params['start_time_end']) && !empty($this->params['end_time_end'])) {
$time = [strtotime($this->params['start_time_end']), strtotime($this->params['end_time_end'])];
$where[] = ['ir.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/08/07 15:42
*/
public function lists(): array
{
$field = 'ir.id,ir.sn,ir.contract_no,ir.user_id,ir.item_id,ir.item_title,ir.item_image,ir.item_langs,ir.money,ir.point,ir.rate,ir.cycle,ir.total_num,ir.wait_num,ir.total_income,ir.type,ir.status,ir.remark,ir.end_time,ir.create_time';
$field .= ',u.account,u.sn as u_sn,u.mobile';
return ItemRecord::alias('ir')
->join('user u', 'u.id = ir.user_id')
->field($field)
->append(['team_top'])
->where($this->queryWhere())
->where($this->searchWhere)
->limit($this->limitOffset, $this->limitLength)
->order(['ir.id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取项目记录数量
* @return int
* @author BD
* @date 2024/08/07 15:42
*/
public function count(): int
{
return ItemRecord::alias('ir')
->join('user u', 'u.id = ir.user_id')
->where($this->queryWhere())
->where($this->searchWhere)
->count();
}
}

View File

@@ -0,0 +1,64 @@
<?php
namespace app\adminapi\lists\lh;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\lh\LhCoin;
use app\common\lists\ListsSearchInterface;
/**
* 量化货币列表
* Class LhCoinLists
* @package app\adminapi\listslh
*/
class LhCoinLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author BD
* @date 2024/05/19 21:13
*/
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/05/19 21:13
*/
public function lists(): array
{
return LhCoin::where($this->searchWhere)
->field(['id', 'name', 'logo', 'symbol', 'symbol_market', 'price', 'buy_name', 'sale_name', 'is_show', 'sort'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取量化货币数量
* @return int
* @author BD
* @date 2024/05/19 21:13
*/
public function count(): int
{
return LhCoin::where($this->searchWhere)->count();
}
}

View File

@@ -0,0 +1,96 @@
<?php
namespace app\adminapi\lists\lh;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\lh\LhRecord;
use app\common\lists\ListsSearchInterface;
/**
* 量化记录列表
* Class LhRecordLists
* @package app\adminapi\listslh
*/
class LhRecordLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author bd
* @date 2024/01/31 14:07
*/
public function setSearch(): array
{
return [
'=' => [ 'lr.sn', 'lr.coin_name'],
];
}
/**
* @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['start_time']) && !empty($this->params['end_time'])) {
$time = [strtotime($this->params['start_time']), strtotime($this->params['end_time'])];
$where[] = ['lr.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/05/19 21:13
*/
public function lists(): array
{
$field = 'lr.id,lr.sn,lr.user_id,lr.coin_name,lr.coin_logo,lr.coin_symbol,lr.coin_buy_name,lr.coin_sale_name,lr.money,lr.income,lr.money_buy,lr.money_sale,lr.create_time';
$field .= ',u.account,u.sn as u_sn,u.mobile';
$record = LhRecord::alias('lr')
->join('user u', 'u.id = lr.user_id')
->field($field)
->where($this->queryWhere())
->where($this->searchWhere)
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
->toArray();
return $record;
}
/**
* @notes 获取量化记录数量
* @return int
* @author BD
* @date 2024/05/19 21:13
*/
public function count(): int
{
return LhRecord::alias('lr')
->join('user u', 'u.id = lr.user_id')
->where($this->queryWhere())
->where($this->searchWhere)
->count();
}
}

View File

@@ -0,0 +1,69 @@
<?php
namespace app\adminapi\lists\mall;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\mall\MallGoods;
use app\common\lists\ListsSearchInterface;
/**
* 积分、抽奖奖品列表
* Class MallGoodsLists
* @package app\adminapi\listsmall
*/
class MallGoodsLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author BD
* @date 2024/10/14 23:57
*/
public function setSearch(): array
{
return [
'=' => ['title', 'type', 'type2', 'is_show', 'create_time'],
];
}
/**
* @notes 获取积分、抽奖奖品列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author BD
* @date 2024/10/14 23:57
*/
public function lists(): array
{
$items = MallGoods::where($this->searchWhere)
->field(['id', 'title', 'image', 'price', 'content', 'money', 'point', 'win_rate', 'num', 'type', 'type2', 'is_show', 'sort', 'langs', 'create_time'])
->limit($this->limitOffset, $this->limitLength)
->order(['type' => 'desc','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/10/14 23:57
*/
public function count(): int
{
return MallGoods::where($this->searchWhere)->count();
}
}

View File

@@ -0,0 +1,94 @@
<?php
namespace app\adminapi\lists\mall;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\mall\MallGoodsRecord;
use app\common\lists\ListsSearchInterface;
/**
* 奖品记录列表
* Class MallGoodsRecordLists
* @package app\adminapi\listsmall
*/
class MallGoodsRecordLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author BD
* @date 2024/03/19 02:29
*/
public function setSearch(): array
{
return [
'=' => ['mgr.sn', 'mgr.type2', 'mgr.type'],
];
}
/**
* @notes 搜索条件
* @author BD
* @date 2024/03/19 02:29
*/
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['start_time']) && !empty($this->params['end_time'])) {
$time = [strtotime($this->params['start_time']), strtotime($this->params['end_time'])];
$where[] = ['mgr.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/10/15 14:00
*/
public function lists(): array
{
$field = 'mgr.id,mgr.sn,mgr.user_id,mgr.m_goods_title,mgr.m_goods_image,mgr.price,mgr.type,mgr.type2,mgr.remark,mgr.create_time';
$field .= ',u.account,u.sn as u_sn,u.mobile';
return MallGoodsRecord::alias('mgr')
->join('user u', 'u.id = mgr.user_id')
->field($field)
->where($this->queryWhere())
->where($this->searchWhere)
->limit($this->limitOffset, $this->limitLength)
->order(['mgr.id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取奖品记录数量
* @return int
* @author BD
* @date 2024/10/15 14:00
*/
public function count(): int
{
return MallGoodsRecord::alias('mgr')
->join('user u', 'u.id = mgr.user_id')
->where($this->queryWhere())
->where($this->searchWhere)
->count();
}
}

View File

@@ -0,0 +1,82 @@
<?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\member;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\member\UserMember;
use app\common\lists\ListsSearchInterface;
use app\common\service\FileService;
/**
* 会员等级列表
* Class UserMemberLists
* @package app\adminapi\listsmember
*/
class UserMemberLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author BD
* @date 2024/03/14 00:28
*/
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/14 00:28
*/
public function lists(): array
{
$member = UserMember::where($this->searchWhere)
->field(['id', 'name', 'logo', 'bg_img', 'text_color', 'money', 'level1_num', 'level1_vip_id', 'item_num', 'item_add_rate', 'mine_speed', 'is_show'])
->append(['vip_name'])
// ->where(['is_show' => 1])
->limit($this->limitOffset, $this->limitLength)
->order(['money' => 'desc','id' => 'desc'])
->select()
->toArray();
return $member;
}
/**
* @notes 获取会员等级数量
* @return int
* @author BD
* @date 2024/03/14 00:28
*/
public function count(): int
{
return UserMember::where($this->searchWhere)->where(['is_show' => 1])->count();
}
}

View File

@@ -0,0 +1,71 @@
<?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\notice;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\lists\ListsSearchInterface;
use app\common\model\notice\NoticeSetting;
/**
* 通知设置
* Class NoticeSettingLists
* @package app\adminapi\lists\notice
*/
class NoticeSettingLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 搜索条件
* @return \string[][]
* @author ljj
* @date 2022/2/17 2:21 下午
*/
public function setSearch(): array
{
return [
'=' => ['recipient', 'type']
];
}
/**
* @notes 通知设置列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author ljj
* @date 2022/2/16 3:18 下午
*/
public function lists(): array
{
$lists = (new NoticeSetting())->field('id,scene_name,sms_notice,type')
->append(['sms_status_desc','type_desc'])
->where($this->searchWhere)
->select()
->toArray();
return $lists;
}
/**
* @notes 通知设置数量
* @return int
* @author ljj
* @date 2022/2/16 3:18 下午
*/
public function count(): int
{
return (new NoticeSetting())->where($this->searchWhere)->count();
}
}

View File

@@ -0,0 +1,100 @@
<?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\setting;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\setting\Language;
use app\common\lists\ListsSearchInterface;
use app\common\lists\ListsSortInterface;
/**
* 语言包列表
* Class LanguageLists
* @package app\adminapi\listssetting
*/
class LanguageLists extends BaseAdminDataLists implements ListsSearchInterface,ListsSortInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author likeadmin
* @date 2023/11/30 13:59
*/
public function setSearch(): array
{
return [
'=' => ['name', '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
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author likeadmin
* @date 2023/11/30 13:59
*/
public function lists(): array
{
return Language::where($this->searchWhere)
->field(['id', 'name', 'name_loc','symbol','trans_symbol' , 'logo', 'precision', 'time_format', 'is_show', 'sort'])
->limit($this->limitOffset, $this->limitLength)
->order($this->sortOrder)
->select()
->toArray();
}
/**
* @notes 获取语言包数量
* @return int
* @author likeadmin
* @date 2023/11/30 13:59
*/
public function count(): int
{
return Language::where($this->searchWhere)->count();
}
}

View 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
// +----------------------------------------------------------------------
namespace app\adminapi\lists\setting;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\setting\LanguagePag;
use app\common\lists\ListsSearchInterface;
/**
* 语言包列表
* Class LanguagePagLists
* @package app\adminapi\listssetting
*/
class LanguagePagLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author likeadmin
* @date 2024/01/14 13:50
*/
public function setSearch(): array
{
return [
'=' => ['type', 'name', 'value','lang'],
];
}
/**
* @notes 获取语言包列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author likeadmin
* @date 2024/01/14 13:50
*/
public function lists(): array
{
return LanguagePag::where($this->searchWhere)
->field(['id', 'type', 'name', 'value','lang'])
->append(['from_value'])
->limit($this->limitOffset, $this->limitLength)
->order(['type' => 'asc','name' => 'asc'])
->select()
->toArray();
}
/**
* @notes 获取语言包数量
* @return int
* @author likeadmin
* @date 2024/01/14 13:50
*/
public function count(): int
{
return LanguagePag::where($this->searchWhere)->count();
}
}

View File

@@ -0,0 +1,87 @@
<?php
namespace app\adminapi\lists\setting;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\setting\RechargeMethod;
use app\common\lists\ListsSearchInterface;
use app\common\lists\ListsSortInterface;
/**
* 充值方式列表
* Class RechargeMethodLists
* @package app\adminapi\listssetting
*/
class RechargeMethodLists extends BaseAdminDataLists implements ListsSearchInterface,ListsSortInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author BD
* @date 2023/11/30 15:22
*/
public function setSearch(): array
{
return [
'=' => ['lang_id', 'type', 'name', 'is_show'],
];
}
/**
* @notes 设置支持排序字段
* @return array
* @author BD
* @date 2022/2/9 15:11
*/
public function setSortFields(): array
{
return ['create_time' => 'create_time', 'id' => 'id'];
}
/**
* @notes 设置默认排序
* @return array
* @author BD
* @date 2022/2/9 15:08
*/
public function setDefaultOrder(): array
{
return ['sort' => 'desc', 'id' => 'desc'];
}
/**
* @notes 获取充值方式列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author BD
* @date 2023/11/30 15:22
*/
public function lists(): array
{
return RechargeMethod::where($this->searchWhere)
->append(['lang_name','vip_name'])
->field(['id', 'lang_id', 'type', 'name', 'logo', 'account', 'img', 'bank_name', 'bank_username', 'main_coin_type', 'coin_type', 'protocol', 'address', 'member_id', 'avail_num', 'rate', 'symbol_rate','precision', 'symbol' ,'is_show' ,'is_voucher', 'sort'])
->limit($this->limitOffset, $this->limitLength)
->order($this->sortOrder)
->select()
->toArray();
}
/**
* @notes 获取充值方式数量
* @return int
* @author BD
* @date 2023/11/30 15:22
*/
public function count(): int
{
return RechargeMethod::where($this->searchWhere)->count();
}
}

View 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\lists\setting\dict;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\lists\ListsSearchInterface;
use app\common\model\dict\DictData;
/**
* 字典数据列表
* Class DictDataLists
* @package app\adminapi\lists\dict
*/
class DictDataLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author 段誉
* @date 2022/6/20 16:29
*/
public function setSearch(): array
{
return [
'%like%' => ['name', 'type_value'],
'=' => ['status', 'type_id']
];
}
/**
* @notes 获取列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 段誉
* @date 2022/6/20 16:35
*/
public function lists(): array
{
return DictData::where($this->searchWhere)
->append(['status_desc'])
->limit($this->limitOffset, $this->limitLength)
->order(['sort' => 'desc', 'id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取数量
* @return int
* @author 段誉
* @date 2022/6/20 16:35
*/
public function count(): int
{
return DictData::where($this->searchWhere)->count();
}
}

View 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\lists\setting\dict;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\lists\ListsSearchInterface;
use app\common\model\dict\DictType;
/**
* 字典类型列表
* Class DictTypeLists
* @package app\adminapi\lists\dictionary
*/
class DictTypeLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author 段誉
* @date 2022/6/20 15:53
*/
public function setSearch(): array
{
return [
'%like%' => ['name', 'type'],
'=' => ['status']
];
}
/**
* @notes 获取列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 段誉
* @date 2022/6/20 15:54
*/
public function lists(): array
{
return DictType::where($this->searchWhere)
->limit($this->limitOffset, $this->limitLength)
->append(['status_desc'])
->order(['id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取数量
* @return int
* @author 段誉
* @date 2022/6/20 15:54
*/
public function count(): int
{
return DictType::where($this->searchWhere)->count();
}
}

View File

@@ -0,0 +1,62 @@
<?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\setting\pay;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\pay\PayConfig;
/**
* 支付配置列表
* Class PayConfigLists
* @package app\adminapi\lists\setting\pay
*/
class PayConfigLists extends BaseAdminDataLists
{
/**
* @notes 获取列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 段誉
* @date 2023/2/23 16:15
*/
public function lists(): array
{
$lists = PayConfig::field('id,name,pay_way,icon,sort')
->append(['pay_way_name'])
->order('sort','asc')
->select()
->toArray();
return $lists;
}
/**
* @notes 获取数量
* @return int
* @author 段誉
* @date 2023/2/23 16:15
*/
public function count(): int
{
return PayConfig::count();
}
}

View 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\lists\setting\system;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\lists\ListsExcelInterface;
use app\common\lists\ListsSearchInterface;
use app\common\model\OperationLog;
/**
* 日志列表
* Class LogLists
* @package app\adminapi\lists\setting\system
*/
class LogLists extends BaseAdminDataLists implements ListsSearchInterface, ListsExcelInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author ljj
* @date 2021/8/3 4:21 下午
*/
public function setSearch(): array
{
return [
'%like%' => ['admin_name','url','ip','type'],
'between_time' => 'create_time',
];
}
/**
* @notes 查看系统日志列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author ljj
* @date 2021/8/3 4:21 下午
*/
public function lists(): array
{
$lists = OperationLog::field('id,action,admin_name,admin_id,url,type,params,ip,create_time')
->where($this->searchWhere)
->limit($this->limitOffset, $this->limitLength)
->order('id','desc')
->select()
->toArray();
return $lists;
}
/**
* @notes 查看系统日志总数
* @return int
* @author ljj
* @date 2021/8/3 4:23 下午
*/
public function count(): int
{
return OperationLog::where($this->searchWhere)->count();
}
/**
* @notes 设置导出字段
* @return string[]
* @author ljj
* @date 2021/8/3 4:48 下午
*/
public function setExcelFields(): array
{
return [
// '数据库字段名(支持别名) => 'Excel表字段名'
'id' => '记录ID',
'action' => '操作',
'admin_name' => '管理员',
'admin_id' => '管理员ID',
'url' => '访问链接',
'type' => '访问方式',
'params' => '访问参数',
'ip' => '来源IP',
'create_time' => '日志时间',
];
}
/**
* @notes 设置默认表名
* @return string
* @author ljj
* @date 2021/8/3 4:48 下午
*/
public function setFileName(): string
{
return '系统日志';
}
}

View File

@@ -0,0 +1,74 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\adminapi\lists\tools;
use app\adminapi\lists\BaseAdminDataLists;
use think\facade\Db;
/**
* 数据表列表
* Class GeneratorLists
* @package app\adminapi\lists\tools
*/
class DataTableLists extends BaseAdminDataLists
{
/**
* @notes 查询结果
* @return mixed
* @author 段誉
* @date 2022/6/13 18:54
*/
public function queryResult()
{
$sql = 'SHOW TABLE STATUS WHERE 1=1 ';
if (!empty($this->params['name'])) {
$sql .= "AND name LIKE '%" . $this->params['name'] . "%'";
}
if (!empty($this->params['comment'])) {
$sql .= "AND comment LIKE '%" . $this->params['comment'] . "%'";
}
return Db::query($sql);
}
/**
* @notes 处理列表
* @return array
* @author 段誉
* @date 2022/6/13 18:54
*/
public function lists(): array
{
$lists = array_map("array_change_key_case", $this->queryResult());
$offset = max(0, ($this->pageNo - 1) * $this->pageSize);
$lists = array_slice($lists, $offset, $this->pageSize, true);
return array_values($lists);
}
/**
* @notes 获取数量
* @return int
* @author 段誉
* @date 2022/6/13 18:54
*/
public function count(): int
{
return count($this->queryResult());
}
}

View File

@@ -0,0 +1,75 @@
<?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\tools;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\lists\ListsSearchInterface;
use app\common\model\tools\GenerateTable;
/**
* 代码生成所选数据表列表
* Class GenerateTableLists
* @package app\adminapi\lists\tools
*/
class GenerateTableLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author 段誉
* @date 2022/6/14 10:55
*/
public function setSearch(): array
{
return [
'%like%' => ['table_name', 'table_comment']
];
}
/**
* @notes 查询列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 段誉
* @date 2022/6/14 10:55
*/
public function lists(): array
{
return GenerateTable::where($this->searchWhere)
->order(['id' => 'desc'])
->append(['template_type_desc'])
->limit($this->limitOffset, $this->limitLength)
->select()
->toArray();
}
/**
* @notes 获取数量
* @return int
* @author 段誉
* @date 2022/6/14 10:55
*/
public function count(): int
{
return GenerateTable::count();
}
}

View File

@@ -0,0 +1,299 @@
<?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\user;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\enum\user\UserTerminalEnum;
use app\common\lists\{ListsSearchInterface,ListsExtendInterface};
use app\common\model\user\{User,UserInfo};
use app\common\model\finance\{RechargeRecord,WithdrawRecord};
/**
* 用户列表
* Class UserAgentLists
* @package app\adminapi\lists\user
*/
class UserAgentLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExtendInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author bd
* @date 2024/01/31 14:07
*/
public function setSearch(): array
{
return [
'=' => ['u.sn','u.is_open','u.is_agent','u.country_code','u.register_ip','u.login_ip'],
];
}
/**
* @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['member_id'])) {
$where[] = ['umr.member_id', '=', $this->params['member_id']];
}
// 邮箱地址
if (!empty($this->params['email'])) {
$where[] = ['ui.email', '=', $this->params['email']];
}
// 邮箱认证
if (!empty($this->params['auth_email'])) {
$where[] = ['ui.auth_email', '=', $this->params['auth_email']];
}
// 所在代数
if (!empty($this->params['level'])) {
$where[] = ['ur.level', '=', $this->params['level']];
}
// 下单时间
if (!empty($this->params['create_time_start']) && !empty($this->params['create_time_end'])) {
$time = [strtotime($this->params['create_time_start']), strtotime($this->params['create_time_end'])];
$where[] = ['u.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 段誉
* @date 2022/9/22 15:50
*/
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['recharge_withdraw_min'])) {
$recharge_withdraw_min = $this->params['recharge_withdraw_min'];
$where .= " AND u.total_recharge - u.total_withdraw >= $recharge_withdraw_min ";
}
// 金额范围
if (!empty($this->params['recharge_withdraw_max'])) {
$recharge_withdraw_max = $this->params['recharge_withdraw_max'];
$where .= " AND u.total_recharge - u.total_withdraw <= $recharge_withdraw_max ";
}
$field = "u.id,u.sn,u.nickname,u.sex,u.avatar,u.account,u.mobile,u.country_code,u.auto_member,u.is_lh,u.is_sn,u.is_open,u.is_agent,u.channel,u.user_money,u.user_point,u.total_recharge,u.total_withdraw,u.total_income,u.total_income_invest,u.total_invest,u.create_time,u.register_ip,u.register_isp,u.remark2,u.login_ip,u.login_time";
$field .= ',ui.email,ui.auth_email';
$field .= ',ur.level';
$lists = User::alias('u')
->join('user_info ui', 'u.id = ui.user_id')
->join('user_relation_agent ur', 'u.id = ur.user_id')
->leftjoin('user_member_record umr', 'u.id = umr.user_id')
->field($field)
->append(['team_num','team_recharge','team_withdraw','item_num','today_item_num','vip_name','unused_money','team_report','agent_team_top','register_ip_num','login_ip_num','mine'])
->where($where)
->where($this->queryWhere())
->where($this->searchWhere)
->limit($this->limitOffset, $this->limitLength)
->order('u.id desc')
->select()
->toArray();
// foreach ($lists as &$item) {
// $item['total_recharge_ing'] = round(RechargeRecord::where(['status' => 0,'user_id' => $item['id']])->sum('amount'), 2);
// $item['total_withdraw_ing'] = round(WithdrawRecord::where(['status' => 0,'user_id' => $item['id']])->sum('amount'), 2);
// }
return $lists;
}
/**
* @notes 获取数量
* @return int
* @author 段誉
* @date 2022/9/22 15:51
*/
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['recharge_withdraw_min'])) {
$recharge_withdraw_min = $this->params['recharge_withdraw_min'];
$where .= " AND u.total_recharge - u.total_withdraw >= $recharge_withdraw_min ";
}
// 金额范围
if (!empty($this->params['recharge_withdraw_max'])) {
$recharge_withdraw_max = $this->params['recharge_withdraw_max'];
$where .= " AND u.total_recharge - u.total_withdraw <= $recharge_withdraw_max ";
}
return User::alias('u')
->join('user_info ui', 'u.id = ui.user_id')
->join('user_relation_agent ur', 'u.id = ur.user_id')
->leftjoin('user_member_record umr', 'u.id = umr.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['recharge_withdraw_min'])) {
$recharge_withdraw_min = $this->params['recharge_withdraw_min'];
$where .= " AND u.total_recharge - u.total_withdraw >= $recharge_withdraw_min ";
}
// 金额范围
if (!empty($this->params['recharge_withdraw_max'])) {
$recharge_withdraw_max = $this->params['recharge_withdraw_max'];
$where .= " AND u.total_recharge - u.total_withdraw <= $recharge_withdraw_max ";
}
$total_recharge = User::alias('u')
->join('user_info ui', 'u.id = ui.user_id')
->join('user_relation_agent ur', 'u.id = ur.user_id')
->leftjoin('user_member_record umr', 'u.id = umr.user_id')
->where($where)
->where($this->queryWhere())
->where($this->searchWhere)
->sum('u.total_recharge');
$total_withdraw = User::alias('u')
->join('user_info ui', 'u.id = ui.user_id')
->join('user_relation_agent ur', 'u.id = ur.user_id')
->leftjoin('user_member_record umr', 'u.id = umr.user_id')
->where($where)
->where($this->queryWhere())
->where($this->searchWhere)
->sum('u.total_withdraw');
$total_money = User::alias('u')
->join('user_info ui', 'u.id = ui.user_id')
->join('user_relation_agent ur', 'u.id = ur.user_id')
->leftjoin('user_member_record umr', 'u.id = umr.user_id')
->where($where)
->where($this->queryWhere())
->where($this->searchWhere)
->sum('u.user_money');
$recharge_ing = User::alias('u')
->join('user_info ui', 'u.id = ui.user_id')
->join('user_relation_agent ur', 'u.id = ur.user_id')
->join('recharge_record rr', 'u.id = rr.user_id')
->leftjoin('user_member_record umr', 'u.id = umr.user_id')
->where($where)
->where(['rr.status' => 0])
->where($this->queryWhere())
->where($this->searchWhere)
->sum('rr.amount');
$withdraw_ing = User::alias('u')
->join('user_info ui', 'u.id = ui.user_id')
->join('user_relation_agent ur', 'u.id = ur.user_id')
->join('withdraw_record wr', 'u.id = wr.user_id')
->leftjoin('user_member_record umr', 'u.id = umr.user_id')
->where($where)
->where(['wr.status' => 0])
->where($this->queryWhere())
->where($this->searchWhere)
->sum('wr.amount');
return [
'total_money' => round($total_money, 2),
'total_recharge' => round($total_recharge, 2),
'total_withdraw' => round($total_withdraw, 2),
'recharge_withdraw' => round($total_recharge - $total_withdraw, 2),
'recharge_ing' => round($recharge_ing, 2),
'withdraw_ing' => round($withdraw_ing, 2),
];
}
}

View File

@@ -0,0 +1,65 @@
<?php
namespace app\adminapi\lists\user;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\user\UserGroup;
use app\common\lists\ListsSearchInterface;
/**
* 用户分组列表
* Class UserGroupLists
* @package app\adminapi\listsuser
*/
class UserGroupLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author BD
* @date 2024/04/25 01:04
*/
public function setSearch(): array
{
return [
'=' => ['name'],
];
}
/**
* @notes 获取用户分组列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author BD
* @date 2024/04/25 01:04
*/
public function lists(): array
{
return UserGroup::where($this->searchWhere)
->field(['id', 'name'])
->append(['rule_num','user_num'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取用户分组数量
* @return int
* @author BD
* @date 2024/04/25 01:04
*/
public function count(): int
{
return UserGroup::where($this->searchWhere)->count();
}
}

View File

@@ -0,0 +1,64 @@
<?php
namespace app\adminapi\lists\user;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\user\UserGroupRule;
use app\common\lists\ListsSearchInterface;
/**
* 分组规则列表
* Class UserGroupRuleLists
* @package app\adminapi\listsuser
*/
class UserGroupRuleLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author BD
* @date 2024/04/25 01:30
*/
public function setSearch(): array
{
return [
'=' => ['group_id'],
];
}
/**
* @notes 获取分组规则列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author BD
* @date 2024/04/25 01:30
*/
public function lists(): array
{
return UserGroupRule::where($this->searchWhere)
->field(['id', 'group_id', 'num', 'money_type', 'money', 'money_percentage', 'commission_type', 'commission', 'commission_percentage'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取分组规则数量
* @return int
* @author BD
* @date 2024/04/25 01:30
*/
public function count(): int
{
return UserGroupRule::where($this->searchWhere)->count();
}
}

View File

@@ -0,0 +1,98 @@
<?php
namespace app\adminapi\lists\user;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\user\UserInfo;
use app\common\lists\ListsSearchInterface;
/**
* 用户信息列表
* Class UserInfoLists
* @package app\adminapi\listsuser
*/
class UserInfoLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author BD
* @date 2024/06/08 17:51
*/
public function setSearch(): array
{
return [
'=' => ['ui.user_id', 'ui.email', 'ui.google_key', 'ui.card_name', 'ui.card_num', 'ui.auth_email', 'ui.auth_google', 'ui.auth_card', 'ui.create_time'],
];
}
/**
* @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['start_time']) && !empty($this->params['end_time'])) {
$time = [strtotime($this->params['start_time']), strtotime($this->params['end_time'])];
$where[] = ['ui.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/06/08 17:51
*/
public function lists(): array
{
$field = 'ui.id,ui.user_id,ui.email,ui.google_key,ui.google_qrcode,ui.card_name,ui.card_num,ui.card_img1,ui.card_img2,ui.card_img3,ui.auth_email,ui.auth_google,ui.auth_card,ui.create_time,ui.card_time';
$field .= ',u.account,u.sn as u_sn,u.mobile';
return UserInfo::alias('ui')
->join('user u', 'u.id = ui.user_id')
->field($field)
->where("auth_card != 0")
->where($this->queryWhere())
->where($this->searchWhere)
->limit($this->limitOffset, $this->limitLength)
->order(['ui.card_time' => 'desc' ,'ui.id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取用户信息数量
* @return int
* @author BD
* @date 2024/06/08 17:51
*/
public function count(): int
{
return UserInfo::alias('ui')
->join('user u', 'u.id = ui.user_id')
->where("auth_card != 0")
->where($this->queryWhere())
->where($this->searchWhere)
->count();
}
}

View File

@@ -0,0 +1,64 @@
<?php
namespace app\adminapi\lists\user;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\user\UserKadan;
use app\common\lists\ListsSearchInterface;
/**
* 卡单规则列表
* Class UserKadanLists
* @package app\adminapi\listsuser
*/
class UserKadanLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author BD
* @date 2024/04/24 17:00
*/
public function setSearch(): array
{
return [
'=' => [ 'user_id'],
];
}
/**
* @notes 获取卡单规则列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author BD
* @date 2024/04/24 17:00
*/
public function lists(): array
{
return UserKadan::where($this->searchWhere)
->field(['id', 'user_id', 'sn', 'num', 'money', 'commission', 'status', 'create_time', 'finish_time'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取卡单规则数量
* @return int
* @author BD
* @date 2024/04/24 17:00
*/
public function count(): int
{
return UserKadan::where($this->searchWhere)->count();
}
}

View File

@@ -0,0 +1,341 @@
<?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\user;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\enum\user\UserTerminalEnum;
use app\common\lists\{ListsExcelInterface,ListsSearchInterface,ListsExtendInterface};
use app\common\model\user\{User,UserInfo,UserMineRecord};
use app\common\model\finance\{RechargeRecord,WithdrawRecord};
/**
* 用户列表
* Class UserLists
* @package app\adminapi\lists\user
*/
class UserLists extends BaseAdminDataLists implements ListsExcelInterface,ListsSearchInterface,ListsExtendInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author bd
* @date 2024/01/31 14:07
*/
public function setSearch(): array
{
return [
'=' => ['u.sn','u.is_open','u.is_agent','u.country_code','u.register_ip','u.login_ip'],
];
}
/**
* @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['member_id'])) {
$where[] = ['umr.member_id', '=', $this->params['member_id']];
}
// 邮箱地址
if (!empty($this->params['email'])) {
$where[] = ['ui.email', '=', $this->params['email']];
}
// 邮箱认证
if (!empty($this->params['auth_email'])) {
$where[] = ['ui.auth_email', '=', $this->params['auth_email']];
}
// 下单时间
if (!empty($this->params['create_time_start']) && !empty($this->params['create_time_end'])) {
$time = [strtotime($this->params['create_time_start']), strtotime($this->params['create_time_end'])];
$where[] = ['u.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 段誉
* @date 2022/9/22 15:50
*/
public function lists(): array
{
$where = " 1 = 1 ";
// 金额范围
if (!empty($this->params['recharge_withdraw_min'])) {
$recharge_withdraw_min = $this->params['recharge_withdraw_min'];
$where .= " AND u.total_recharge - u.total_withdraw >= $recharge_withdraw_min ";
}
// 金额范围
if (!empty($this->params['recharge_withdraw_max'])) {
$recharge_withdraw_max = $this->params['recharge_withdraw_max'];
$where .= " AND u.total_recharge - u.total_withdraw <= $recharge_withdraw_max ";
}
$field = "u.id,u.sn,u.nickname,u.sex,u.avatar,u.account,u.mobile,u.country_code,u.auto_member,u.is_lh,u.is_transfer,u.is_sn,u.is_open,u.is_agent,u.agent_name,u.channel,u.user_money,u.user_point,u.total_recharge,u.total_withdraw,u.total_income_invest,u.total_invest,u.total_income_mine,u.create_time,u.register_ip,u.register_isp,u.remark2,u.login_ip,u.login_time";
$field .= ',ui.email,ui.auth_email';
$join_table = "user_info t";
$join_require = 't.user_id = u.id';
if(isset($this->params['parent_sn']) && $this->params['parent_sn'] !=""){
$join_table = "user_relation_agent ur";
$join_require = 'u.id = ur.user_id';
$user = User::where(['sn' => $this->params['parent_sn']]) -> findOrEmpty();
$parent_id = 0;
if (!$user->isEmpty()) $parent_id = $user['id'];
$where .= " AND ur.parent_id = $parent_id ";
if(isset($this->params['level']) && $this->params['level'] !=""){
$level = $this->params['level'];
$where .= " AND ur.level = $level ";
}
$field .= ',ur.level';
}
$lists = User::alias('u')
->join('user_info ui', 'u.id = ui.user_id')
->join($join_table, $join_require)
->leftjoin('user_member_record umr', 'u.id = umr.user_id')
->field($field)
->append(['team_num','team_recharge','team_withdraw','item_num','today_item_num','vip_name','unused_money','team_report','team_top','register_ip_num','login_ip_num','register_country','mine'])
->where($where)
->where($this->queryWhere())
->where($this->searchWhere)
->limit($this->limitOffset, $this->limitLength)
->order('u.id desc')
->select()
->toArray();
foreach ($lists as &$item) {
$item['channel'] = UserTerminalEnum::getTermInalDesc($item['channel']);
$item['recharge_withdraw'] = round($item['total_recharge'] - $item['total_withdraw'], 2);
if(isset($item['level']) && isset($item['team_top']['level'])){
$item['team_top']['level'] = $item['level'];
}
}
return $lists;
}
/**
* @notes 获取数量
* @return int
* @author 段誉
* @date 2022/9/22 15:51
*/
public function count(): int
{
$where = " 1 = 1 ";
// 金额范围
if (!empty($this->params['recharge_withdraw_min'])) {
$recharge_withdraw_min = $this->params['recharge_withdraw_min'];
$where .= " AND u.total_recharge - u.total_withdraw >= $recharge_withdraw_min ";
}
// 金额范围
if (!empty($this->params['recharge_withdraw_max'])) {
$recharge_withdraw_max = $this->params['recharge_withdraw_max'];
$where .= " AND u.total_recharge - u.total_withdraw <= $recharge_withdraw_max ";
}
$join_table = "user_info t";
$join_require = 't.user_id = u.id';
if(isset($this->params['parent_sn']) && $this->params['parent_sn'] !=""){
$join_table = "user_relation_agent ur";
$join_require = 'u.id = ur.user_id';
$user = User::where(['sn' => $this->params['parent_sn']]) -> findOrEmpty();
$parent_id = 0;
if (!$user->isEmpty()) $parent_id = $user['id'];
$where .= " AND ur.parent_id = $parent_id ";
if(isset($this->params['level']) && $this->params['level'] !=""){
$level = $this->params['level'];
$where .= " AND ur.level = $level ";
}
}
return User::alias('u')
->join('user_info ui', 'u.id = ui.user_id')
->join($join_table, $join_require)
->leftjoin('user_member_record umr', 'u.id = umr.user_id')
->where($where)
->where($this->queryWhere())
->where($this->searchWhere)
->count();
}
public function extend(): array
{
$where = " 1 = 1 ";
// 金额范围
if (!empty($this->params['recharge_withdraw_min'])) {
$recharge_withdraw_min = $this->params['recharge_withdraw_min'];
$where .= " AND u.total_recharge - u.total_withdraw >= $recharge_withdraw_min ";
}
// 金额范围
if (!empty($this->params['recharge_withdraw_max'])) {
$recharge_withdraw_max = $this->params['recharge_withdraw_max'];
$where .= " AND u.total_recharge - u.total_withdraw <= $recharge_withdraw_max ";
}
$join_table = "user_info t";
$join_require = 't.user_id = u.id';
if(isset($this->params['parent_sn']) && $this->params['parent_sn'] !=""){
$join_table = "user_relation_agent ur";
$join_require = 'u.id = ur.user_id';
$user = User::where(['sn' => $this->params['parent_sn']]) -> findOrEmpty();
$parent_id = 0;
if (!$user->isEmpty()) $parent_id = $user['id'];
$where .= " AND ur.parent_id = $parent_id ";
if(isset($this->params['level']) && $this->params['level'] !=""){
$level = $this->params['level'];
$where .= " AND ur.level = $level ";
}
}
$total_recharge = User::alias('u')
->join('user_info ui', 'u.id = ui.user_id')
->join($join_table, $join_require)
->leftjoin('user_member_record umr', 'u.id = umr.user_id')
->where($where)
->where($this->queryWhere())
->where($this->searchWhere)
->sum('u.total_recharge');
$total_withdraw = User::alias('u')
->join('user_info ui', 'u.id = ui.user_id')
->join($join_table, $join_require)
->leftjoin('user_member_record umr', 'u.id = umr.user_id')
->where($where)
->where($this->queryWhere())
->where($this->searchWhere)
->sum('u.total_withdraw');
$total_money = User::alias('u')
->join('user_info ui', 'u.id = ui.user_id')
->join($join_table, $join_require)
->leftjoin('user_member_record umr', 'u.id = umr.user_id')
->where($where)
->where($this->queryWhere())
->where($this->searchWhere)
->sum('u.user_money');
$recharge_ing = User::alias('u')
->join('user_info ui', 'u.id = ui.user_id')
->join($join_table, $join_require)
->join('recharge_record rr', 'u.id = rr.user_id')
->leftjoin('user_member_record umr', 'u.id = umr.user_id')
->where($where)
->where(['rr.status' => 0])
->where($this->queryWhere())
->where($this->searchWhere)
->sum('rr.amount');
$withdraw_ing = User::alias('u')
->join('user_info ui', 'u.id = ui.user_id')
->join($join_table, $join_require)
->join('withdraw_record wr', 'u.id = wr.user_id')
->leftjoin('user_member_record umr', 'u.id = umr.user_id')
->where($where)
->where(['wr.status' => 0])
->where($this->queryWhere())
->where($this->searchWhere)
->sum('wr.amount');
return [
'total_money' => round($total_money, 2),
'total_recharge' => round($total_recharge, 2),
'total_withdraw' => round($total_withdraw, 2),
'recharge_withdraw' => round($total_recharge - $total_withdraw, 2),
'recharge_ing' => round($recharge_ing, 2),
'withdraw_ing' => round($withdraw_ing, 2),
];
}
/**
* @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 [
'sn' => '用户ID',
'country_code' => '国家区号',
'account' => '手机号',
'sn' => '邀请码',
'email' => '邮箱',
'vip_name' => '会员等级',
'level_top_account' => '一代',
'level_level' => '用户层级',
'team_level1' => '推广情况1级',
'team_level2' => '推广情况2级',
'team_level3' => '推广情况3级',
'total_recharge' => '总充值',
'total_withdraw' => '总提现',
'recharge_withdraw' => '充提差',
'channel' => '注册来源',
'create_time' => '注册时间',
];
}
}

View File

@@ -0,0 +1,97 @@
<?php
namespace app\adminapi\lists\user;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\user\UserMineRecord;
use app\common\lists\ListsSearchInterface;
/**
* 挖矿记录列表
* Class UserMineRecordLists
* @package app\adminapi\listsuser
*/
class UserMineRecordLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author BD
* @date 2025/01/01 15:47
*/
public function setSearch(): array
{
return [
'=' => ['umr.sn'],
];
}
/**
* @notes 搜索条件
* @author BD
* @date 2024/03/19 02:29
*/
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['start_time']) && !empty($this->params['end_time'])) {
$time = [strtotime($this->params['start_time']), strtotime($this->params['end_time'])];
$where[] = ['umr.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 2025/01/01 15:47
*/
public function lists(): array
{
$field = 'umr.*';
$field .= ',u.account,u.sn as u_sn,u.mobile';
$records = UserMineRecord::alias('umr')
->join('user u', 'u.id = umr.user_id')
->field($field)
->where($this->queryWhere())
->where($this->searchWhere)
->limit($this->limitOffset, $this->limitLength)
->order(['umr.id' => 'desc'])
->select()
->toArray();
return $records;
}
/**
* @notes 获取挖矿记录数量
* @return int
* @author BD
* @date 2025/01/01 15:47
*/
public function count(): int
{
return UserMineRecord::alias('umr')
->join('user u', 'u.id = umr.user_id')
->where($this->queryWhere())
->where($this->searchWhere)
->count();
}
}

View File

@@ -0,0 +1,96 @@
<?php
namespace app\adminapi\lists\user;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\user\UserNotice;
use app\common\lists\ListsSearchInterface;
/**
* 用户消息列表
* Class UserNoticeLists
* @package app\adminapi\listsuser
*/
class UserNoticeLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author BD
* @date 2024/05/26 00:36
*/
public function setSearch(): array
{
return [
'=' => ['un.title', 'un.read', 'un.notice_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['start_time']) && !empty($this->params['end_time'])) {
$time = [strtotime($this->params['start_time']), strtotime($this->params['end_time'])];
$where[] = ['un.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/05/26 00:36
*/
public function lists(): array
{
$field = 'un.id,un.user_id,un.title,un.content,un.read,un.notice_type,un.create_time';
$field .= ',u.account,u.sn as u_sn,u.mobile';
return UserNotice::alias('un')
->join('user u', 'u.id = un.user_id')
->field($field)
->where($this->queryWhere())
->where($this->searchWhere)
->limit($this->limitOffset, $this->limitLength)
->order(['un.id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取用户消息数量
* @return int
* @author BD
* @date 2024/05/26 00:36
*/
public function count(): int
{
return UserNotice::alias('un')
->join('user u', 'u.id = un.user_id')
->where($this->queryWhere())
->where($this->searchWhere)
->count();
}
}

View File

@@ -0,0 +1,109 @@
<?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\user;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\user\{UserRelation,UserRelationAgent};
use app\common\lists\ListsSearchInterface;
/**
* 用户关系列表
* Class UserRelationLists
* @package app\adminapi\listsuser
*/
class UserRelationLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author BD
* @date 2024/01/12 17:21
*/
public function setSearch(): array
{
return [
'=' => ['a1.level'],
];
}
/**
* @notes 搜索条件
* @author 段誉
* @date 2023/2/24 15:26
*/
public function queryWhere()
{
$where = [];
if (!empty($this->params['user_info'])) {
$where[] = ['u1.sn|u1.account|u1.mobile', '=', $this->params['user_info']];
}
if (!empty($this->params['parent_info'])) {
$where[] = ['u2.sn|u2.account|u2.mobile', '=', $this->params['parent_info']];
}
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/12 17:21
*/
public function lists(): array
{
$field = 'a1.id,a1.user_id,a1.parent_id,a1.level,a1.create_time,u1.sn as u1_sn,u1.account as u1_account,u1.mobile as u1_mobile,u1.user_money as u1_user_money,u1.total_recharge as u1_total_recharge,u1.total_withdraw u1_total_withdraw,u2.sn as u2_sn,u2.account as u2_account,u2.mobile as u2_mobile';
return UserRelationAgent::alias('a1')
->join('user u1', 'u1.id = a1.user_id')
->join('user u2', 'u2.id = a1.parent_id')
->field($field)
->append(['team_top'])
->where($this->searchWhere)
->where($this->queryWhere())
->limit($this->limitOffset, $this->limitLength)
->order(['a1.id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取用户关系数量
* @return int
* @author BD
* @date 2024/01/12 17:21
*/
public function count(): int
{
return UserRelationAgent::alias('a1')
->join('user u1', 'u1.id = a1.user_id')
->join('user u2', 'u2.id = a1.parent_id')
->where($this->searchWhere)
->where($this->queryWhere())
->count();
}
}

View File

@@ -0,0 +1,65 @@
<?php
namespace app\adminapi\lists\user;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\user\UserTron;
use app\common\lists\ListsSearchInterface;
/**
* 波场钱包列表
* Class UserTronLists
* @package app\adminapi\listsuser
*/
class UserTronLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author BD
* @date 2024/05/04 23:38
*/
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 BD
* @date 2024/05/04 23:38
*/
public function lists(): array
{
return UserTron::where($this->searchWhere)
->field(['id', 'user_id', 'address', 'key', 'qrcode', 'money_trx', 'money_usdt', 'sort', 'type', 'create_time'])
->append(['user_info'])
->limit($this->limitOffset, $this->limitLength)
->order(['sort' => 'desc','id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取波场钱包数量
* @return int
* @author BD
* @date 2024/05/04 23:38
*/
public function count(): int
{
return UserTron::where($this->searchWhere)->count();
}
}

View 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
// +----------------------------------------------------------------------
namespace app\adminapi\lists\withdraw;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\withdraw\WithdrawBank;
use app\common\lists\ListsSearchInterface;
/**
* 可提现银行列表
* Class WithdrawBankLists
* @package app\adminapi\listswithdraw
*/
class WithdrawBankLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author BD
* @date 2024/02/25 12:19
*/
public function setSearch(): array
{
return [
'=' => ['lang_id', 'name', 'is_show'],
];
}
/**
* @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:19
*/
public function lists(): array
{
return WithdrawBank::where($this->searchWhere)
->append(['lang_name'])
->field(['id', 'lang_id', 'name', 'code', 'logo', 'is_show', 'sort'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取可提现银行数量
* @return int
* @author BD
* @date 2024/02/25 12:19
*/
public function count(): int
{
return WithdrawBank::where($this->searchWhere)->count();
}
}

View 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
// +----------------------------------------------------------------------
namespace app\adminapi\lists\withdraw;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\withdraw\WithdrawMethod;
use app\common\lists\ListsSearchInterface;
/**
* 提现方式列表
* Class WithdrawMethodLists
* @package app\adminapi\listswithdraw
*/
class WithdrawMethodLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author likeadmin
* @date 2024/02/23 14:34
*/
public function setSearch(): array
{
return [
'=' => ['lang_id', 'type', 'name', 'is_show'],
];
}
/**
* @notes 获取提现方式列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author likeadmin
* @date 2024/02/23 14:34
*/
public function lists(): array
{
return WithdrawMethod::where($this->searchWhere)
->append(['lang_name'])
->field(['id', 'lang_id', 'type', 'name', 'logo', 'symbol', 'rate','symbol_rate', 'precision', 'charge', 'is_qrcode', 'is_show', 'sort'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取提现方式数量
* @return int
* @author likeadmin
* @date 2024/02/23 14:34
*/
public function count(): int
{
return WithdrawMethod::where($this->searchWhere)->count();
}
}

View 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\lists\withdraw;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\withdraw\WithdrawWallet;
use app\common\lists\ListsSearchInterface;
/**
* 用户提现钱包列表
* Class WithdrawWalletLists
* @package app\adminapi\listswithdraw
*/
class WithdrawWalletLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author bd
* @date 2024/01/31 14:07
*/
public function setSearch(): array
{
return [
'=' => [ 'ww.lang_id', 'ww.method_id', 'ww.type', 'ww.is_disable'],
];
}
/**
* @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['start_time']) && !empty($this->params['end_time'])) {
$time = [strtotime($this->params['start_time']), strtotime($this->params['end_time'])];
$where[] = ['ww.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/26 13:32
*/
public function lists(): array
{
$field = 'ww.id,ww.lang_id,ww.user_id,ww.method_id,ww.bank_id,ww.type,ww.name,ww.account,ww.img,ww.is_disable,ww.create_time,ww.update_time';
$field .= ',u.account as u_account,u.sn as u_sn,u.mobile';
return WithdrawWallet::alias('ww')
->join('user u', 'u.id = ww.user_id')
->field($field)
->append(['lang_name','method_name','bank_name','status_text'])
->where($this->queryWhere())
->where($this->searchWhere)
->limit($this->limitOffset, $this->limitLength)
->order(['ww.id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取用户提现钱包数量
* @return int
* @author BD
* @date 2024/02/26 13:32
*/
public function count(): int
{
return WithdrawWallet::alias('ww')
->join('user u', 'u.id = ww.user_id')
->where($this->queryWhere())
->where($this->searchWhere)
->count();
}
}