初始版本

This commit is contained in:
贾祥聪
2025-08-19 14:16:51 +08:00
commit f937a1f9b9
4373 changed files with 359728 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\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,75 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权购买去版权授权后方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\adminapi\lists\ad;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\lists\ListsSearchInterface;
use app\common\model\ad\Ad;
class AdLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 搜索条件
* @return \string[][]
* @author ljj
* @date 2022/2/14 5:53 下午
*/
public function setSearch(): array
{
return [
'%like%' => ['name'],
'=' => ['status','pid']
];
}
/**
* @notes 广告列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author ljj
* @date 2022/2/14 6:02 下午
*/
public function lists(): array
{
$lists = (new Ad())->field('id,name,pid,image,link_type,link_address,sort,status')
->order(['sort'=>'desc','id'=>'desc'])
->append(['link_address_desc','ap_name'])
->where($this->searchWhere)
->limit($this->limitOffset,$this->limitLength)
->select()
->toArray();
return $lists;
}
/**
* @notes 广告总数
* @return int
* @author ljj
* @date 2022/2/14 6:03 下午
*/
public function count(): int
{
return (new Ad())->where($this->searchWhere)->count();
}
}

View File

@@ -0,0 +1,75 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权购买去版权授权后方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\adminapi\lists\ad;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\lists\ListsSearchInterface;
use app\common\model\ad\AdPosition;
class AdPositionLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 搜索条件
* @return \string[][]
* @author ljj
* @date 2022/2/14 4:32 下午
*/
public function setSearch(): array
{
return [
'%like%' => ['name'],
'=' => ['attr'],
];
}
/**
* @notes 广告位列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author ljj
* @date 2022/2/14 4:35 下午
*/
public function lists(): array
{
$lists = (new AdPosition())->field('id,name,attr,status,create_time')
->order('id','desc')
->append(['attr_desc'])
->where($this->searchWhere)
->limit($this->limitOffset,$this->limitLength)
->select()
->toArray();
return $lists;
}
/**
* @notes 广告位总数
* @return int
* @author ljj
* @date 2022/2/14 4:36 下午
*/
public function count(): int
{
return (new AdPosition())->where($this->searchWhere)->count();
}
}

View File

@@ -0,0 +1,158 @@
<?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\ListsExtendInterface;
use app\common\lists\ListsSearchInterface;
use app\common\lists\ListsSortInterface;
use app\common\model\auth\Admin;
use app\common\model\auth\SystemRole;
use app\common\model\dept\Dept;
/**
* 管理员列表
* Class AdminLists
* @package app\adminapi\lists\auth
*/
class AdminLists extends BaseAdminDataLists implements ListsExtendInterface, ListsSearchInterface, ListsSortInterface
{
/**
* @notes 设置导出字段
* @return string[]
* @author 段誉
* @date 2021/12/29 10:08
*/
public function setExcelFields(): array
{
return [
'account' => '账号',
'name' => '名称',
'role_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'],
'=' => ['role_id']
];
}
/**
* @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
* @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', 'role_id', 'create_time', 'disable', 'root',
'login_time', 'login_ip', 'multipoint_login', 'avatar', 'dept_id'
];
$adminLists = Admin::with(['dept'])->field($field)
->where($this->searchWhere)
->append(['disable_desc'])
->limit($this->limitOffset, $this->limitLength)
->order($this->sortOrder)
->select()
->toArray();
//获取角色数组('角色id'=>'角色名称')
$roleLists = SystemRole::column('name', 'id');
//管理员列表增加角色名称
foreach ($adminLists as $k => $v) {
$adminLists[$k]['role_name'] = $roleLists[$v['role_id']] ?? '';
if ($v['root'] == 1) {
$adminLists[$k]['role_name'] = '系统管理员';
}
$adminLists[$k]['dept_name'] = empty($v['dept_name']) ? '-' : $v['dept_name'];
}
return $adminLists;
}
/**
* @notes 获取数量
* @return int
* @author 令狐冲
* @date 2021/7/13 00:52
*/
public function count(): int
{
return Admin::where($this->searchWhere)->count();
}
public function extend()
{
return [];
}
}

View File

@@ -0,0 +1,59 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\adminapi\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::limit($this->limitOffset, $this->limitLength)
->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,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\auth;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\auth\Admin;
use app\common\model\auth\SystemRole;
/**
* 角色列表
* Class RoleLists
* @package app\adminapi\lists\auth
*/
class RoleLists extends BaseAdminDataLists
{
/**
* @notes 导出字段
* @return string[]
* @author Tab
* @date 2021/9/22 18:52
*/
public function setExcelFields(): array
{
return [
'name' => '角色名称',
'desc' => '备注',
'create_time' => '创建时间'
];
}
/**
* @notes 导出表名
* @return string
* @author Tab
* @date 2021/9/22 18:52
*/
public function setFileName(): string
{
return '角色表';
}
/**
* @notes 角色列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author cjhao
* @date 2021/8/25 18:00
*/
public function lists(): array
{
$lists = SystemRole::with(['role_menu_index'])
->field('id,name,desc,sort,create_time')
->limit($this->limitOffset, $this->limitLength)
->order(['sort' => 'desc', 'id' => 'desc'])
->select()
->toArray();
$roleCountList = Admin::group('role_id')->column('count(id)', 'role_id');
foreach ($lists as $key => $role) {
//使用角色的人数
$lists[$key]['num'] = $roleCountList[$role['id']] ?? 0;
$menuId = array_column($role['role_menu_index'], 'menu_id');
$lists[$key]['menu_id'] = $menuId;
unset($lists[$key]['role_menu_index']);
}
return $lists;
}
/**
* @notes 总记录数
* @return int
* @author Tab
* @date 2021/7/13 11:26
*/
public function count(): int
{
return SystemRole::count();
}
}

View File

@@ -0,0 +1,80 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\adminapi\lists\channel;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\lists\ListsSearchInterface;
use app\common\model\channel\OfficialAccountReply;
/**
* 微信公众号回复列表
* Class OfficialAccountLists
* @package app\adminapi\lists
*/
class OfficialAccountReplyLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索
* @return \string[][]
* @author 段誉
* @date 2022/3/30 15:02
*/
public function setSearch(): array
{
return [
'=' => ['reply_type']
];
}
/**
* @notes 回复列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 段誉
* @date 2022/3/30 15:02
*/
public function lists(): array
{
$field = 'id,name,keyword,matching_type,content,content_type,status,sort';
$field .= ',matching_type as matching_type_desc,content_type as content_type_desc,status as status_desc';
$lists = OfficialAccountReply::field($field)
->where($this->searchWhere)
->order(['sort' => 'desc', 'id' => 'desc'])
->limit($this->limitOffset, $this->limitLength)
->select()
->toArray();
return $lists;
}
/**
* @notes 回复记录数
* @return int
* @author 段誉
* @date 2022/3/30 15:02
*/
public function count(): int
{
$count = OfficialAccountReply::where($this->searchWhere)->count();
return $count;
}
}

View File

@@ -0,0 +1,113 @@
<?php
namespace app\adminapi\lists\coach;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\enum\coach\CoachEnum;
use app\common\lists\ListsExtendInterface;
use app\common\model\coach\Coach;
use app\common\model\coach\CoachGoodsIndex;
use app\common\model\skill\Skill;
class CoachApplyLists extends BaseAdminDataLists implements ListsExtendInterface
{
public function setWhere()
{
$where = [];
if(isset($this->params['keyword']) && $this->params['keyword']){
$where[] = ['name|mobile','like',$this->params['keyword']];
}
if(isset($this->params['coach_keyword']) && $this->params['coach_keyword']){
$where[] = ['sn|account','like',$this->params['coach_keyword']];
}
if(isset($this->params['work_status']) && '' != $this->params['work_status']){
$where[] = ['work_status','=',$this->params['work_status']];
}
if(isset($this->params['server_status']) && '' != $this->params['server_status']){
$where[] = ['server_status','=',$this->params['server_status']];
}
if(isset($this->params['skill_id']) && '' != $this->params['skill_id']){
$skillIds = Skill::alias('S')
->join('coach_skill_index CSI','S.id = CSI.skill_id')
->column('CSI.coach_id');
$where[] = ['C.id','in',$skillIds];
}
if(isset($this->params['start_time']) && $this->params['start_time']){
$where[] = ['C.create_time','>=',$this->params['start_time']];
}
if(isset($this->params['end_time']) && $this->params['end_time']){
$where[] = ['C.create_time','<=',$this->params['end_time']];
}
if(isset($this->params['type']) && '' != $this->params['type']){
$where[] = ['audit_status','=',$this->params['type']];
}
return $where;
}
public function lists(): array
{
$lists = Coach::alias('C')
->join('coach_user UC','UC.id = C.coach_user_id')
->field('UC.sn,C.mobile,C.audit_status,C.skill_id,C.province_id,C.city_id,C.region_id,C.id,C.name,C.work_photo,C.deposit,C.work_status,C.create_time,C.money')
->append(['skill_desc','region_desc','audit_status_desc'])
->where($this->setWhere())
->order('C.id desc')
->limit($this->limitOffset, $this->limitLength)
->select()->toArray();
$goodsCountLists = CoachGoodsIndex::group('coach_id')->column('count(goods_id) as count','coach_id');
foreach ($lists as $key => $list){
$lists[$key]['goods_count'] = $goodsCountLists[$list['id']] ?? 0;
}
return $lists;
}
/**
* @notes 统计人数
* @return int
* @author cjhao
* @date 2024/8/21 17:53
*/
public function count(): int
{
return Coach::alias('C')
->join('coach_user UC','UC.id = C.coach_user_id')
->where($this->setWhere())
->count();
}
public function extend()
{
$whereLists = $this->setWhere();
foreach ($whereLists as $key => $where){
if(isset($where['audit_status'])){
unset($whereLists[$key]);
}
}
$whereLists = array_values($whereLists);
$allCount = Coach::alias('C')
->join('coach_user UC','UC.id = C.coach_user_id')
->where($whereLists)
->count();
$waitCount = Coach::alias('C')
->join('coach_user UC','UC.id = C.coach_user_id')
->where($whereLists)
->where(['audit_status'=>CoachEnum::AUDIT_STATUS_WAIT])
->count();
$passCount = Coach::alias('C')
->join('coach_user UC','UC.id = C.coach_user_id')
->where($whereLists)
->where(['audit_status'=>CoachEnum::AUDIT_STATUS_PASS])
->count();
$refuseCount = Coach::alias('C')
->join('coach_user UC','UC.id = C.coach_user_id')
->where($whereLists)
->where(['audit_status'=>CoachEnum::AUDIT_STATUS_REFUSE])
->count();
return [
'all_count' => $allCount,
'wait_count' => $waitCount,
'pass_count' => $passCount,
'refuse_count' => $refuseCount,
];
}
}

View File

@@ -0,0 +1,145 @@
<?php
namespace app\adminapi\lists\coach;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\enum\coach\CoachEnum;
use app\common\enum\OrderEnum;
use app\common\model\coach\Coach;
use app\common\model\deposit\DepositPackage;
use app\common\model\order\Order;
use app\common\model\skill\Skill;
class CoachLists extends BaseAdminDataLists
{
public function setWhere()
{
$where = [];
$auditStatus = $this->params['audit_status'] ?? CoachEnum::AUDIT_STATUS_PASS;
if($auditStatus){
$where[] = ['audit_status','=',$auditStatus];
}
if(isset($this->params['staff_info']) && $this->params['staff_info']){
$where[] = ['C.sn|name|mobile','like',$this->params['staff_info']];
}
// if(isset($this->params['coach_keyword']) && $this->params['coach_keyword']){
// $where[] = ['C.sn|account','like',$this->params['coach_keyword']];
// }
if(isset($this->params['skill_id']) && '' != $this->params['skill_id']){
$where[] = ['skill_id','=',$this->params['skill_id']];
}
if(isset($this->params['city_id']) && $this->params['city_id']){
$where[] = ['city_id','=',$this->params['city_id']];
}
if(isset($this->params['work_status']) && '' != $this->params['work_status']){
$where[] = ['work_status','=',$this->params['work_status']];
}
if(isset($this->params['status']) && '' != $this->params['status']){
$where[] = ['server_status','=',$this->params['status']];
}
if(isset($this->params['start_time']) && $this->params['start_time']){
$where[] = ['C.create_time','>=',strtotime($this->params['start_time'])];
}
if(isset($this->params['end_time']) && $this->params['end_time']){
$where[] = ['C.create_time','<=',strtotime($this->params['end_time'])];
}
return $where;
}
// public function lists(): array
// {
// $lists = Coach::alias('C')
// ->join('coach_user UC','UC.id = C.coach_user_id')
// ->field('UC.sn,C.id,C.province_id,C.city_id,C.region_id,C.mobile,C.name,C.work_photo,C.server_status,C.deposit,C.work_status,C.create_time,C.money')
// ->append(['work_status_desc','server_status_desc','province_name','city_name','region_name'])
// ->order('id desc')
// ->where($this->setWhere())
// ->limit($this->limitOffset, $this->limitLength)
// ->select()->toArray();
// $coachIds = array_column($lists,'id');
// $depositLists = DepositPackage::where(['type'=>1])->column('order_limit,money');
// $orderLists = Order::where(['coach_id'=>$coachIds])
// ->where('order_status','>',OrderEnum::ORDER_STATUS_WAIT_RECEIVING)
// ->field('count(id) as num,coach_id')
// ->select()->toArray();
// $orderLists = array_column($orderLists,null,'coach_id');
// foreach ($lists as $key => $coach){
// $depositPackage = [];
// foreach ($depositLists as $deposit){
// if($coach['deposit'] >= $deposit['money']){
// $depositPackage = $deposit;
// break;
// }
// }
// $lists[$key]['work_info'] = [
// 'take_order' => $depositPackage['order_limit'] ?? 0,
// 'total_order' => $orderLists[$coach['id']]['num'] ?? 0,
// ];
// }
// return $lists;
// }
public function lists(): array
{
$lists = Coach::alias('C')
->join('coach_user UC', 'UC.id = C.coach_user_id')
->field('UC.sn,C.id,C.province_id,C.city_id,C.region_id,C.mobile,C.name,C.work_photo,C.server_status,C.deposit,C.work_status,C.create_time,C.money')
->append(['work_status_desc','server_status_desc','province_name','city_name','region_name'])
->order('id desc')
->where($this->setWhere())
->limit($this->limitOffset, $this->limitLength)
->select()
->toArray();
$coachIds = array_column($lists, 'id');
// 获取保证金套餐
$depositLists = DepositPackage::where(['type' => 1])
->column('order_limit,money');
// 修复后的订单统计查询
$orderLists = [];
if (!empty($coachIds)) {
$orderLists = Order::where('coach_id', 'in', $coachIds)
->where('order_status', '>', OrderEnum::ORDER_STATUS_WAIT_RECEIVING)
->field('coach_id, count(id) as num')
->group('coach_id') // 按教练分组统计
->select()
->toArray();
}
// 转换为以 coach_id 为键的数组
$orderLists = array_column($orderLists, null, 'coach_id');
foreach ($lists as $key => $coach) {
$depositPackage = [];
// 匹配保证金套餐
foreach ($depositLists as $deposit) {
if ($coach['deposit'] >= $deposit['money']) {
$depositPackage = $deposit;
break;
}
}
$lists[$key]['work_info'] = [
'take_order' => $depositPackage['order_limit'] ?? 0,
'total_order' => $orderLists[$coach['id']]['num'] ?? 0,
];
}
return $lists;
}
/**
* @notes 统计人数
* @return int
* @author cjhao
* @date 2024/8/21 17:53
*/
public function count(): int
{
return Coach::alias('C')
->join('coach_user UC','UC.id = C.coach_user_id')
->where($this->setWhere())
->count();
}
}

View File

@@ -0,0 +1,60 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权购买去版权授权后方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\adminapi\lists\coach;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\deposit\DepositPackage;
class DepositPackageLists extends BaseAdminDataLists
{
/**
* @notes 列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author ljj
* @date 2022/2/8 3:51 下午
*/
public function lists(): array
{
$lists = (new DepositPackage())
->order(['id'=>'desc'])
->where(['type'=>1])
->withoutField('update_time,delete_time')
->select()
->toArray();
return $lists;
}
/**
* @notes 服务分类数量
* @return int
* @author ljj
* @date 2022/2/8 3:51 下午
*/
public function count(): int
{
return (new DepositPackage())->count();
}
}

View File

@@ -0,0 +1,62 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权购买去版权授权后方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\adminapi\lists\coach;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\goods\GoodsCategory;
use app\common\model\skill\Skill;
class SkillLists extends BaseAdminDataLists
{
/**
* @notes 列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author ljj
* @date 2022/2/8 3:51 下午
*/
public function lists(): array
{
$lists = (new Skill())
->order(['id'=>'desc'])
->withoutField('update_time,delete_time')
->withCount(['coach','goods'])
->limit($this->limitOffset, $this->limitLength)
->select()
->toArray();
return $lists;
}
/**
* @notes 服务分类数量
* @return int
* @author ljj
* @date 2022/2/8 3:51 下午
*/
public function count(): int
{
return (new Skill())->count();
}
}

View File

@@ -0,0 +1,103 @@
<?php
namespace app\adminapi\lists\coach;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\enum\coach\CoachEnum;
use app\common\lists\ListsExtendInterface;
use app\common\model\coach\Coach;
use app\common\model\coach\CoachGoodsIndex;
use app\common\model\coach\CoachUpdate;
use app\common\model\skill\Skill;
class UpdateCoachLists extends BaseAdminDataLists implements ListsExtendInterface
{
public function setWhere()
{
$where = [];
if(isset($this->params['keyword']) && $this->params['keyword']){
$where[] = ['name|mobile','like',$this->params['keyword']];
}
if(isset($this->params['coach_keyword']) && $this->params['coach_keyword']){
$where[] = ['sn|account','like',$this->params['coach_keyword']];
}
if(isset($this->params['work_status']) && '' != $this->params['work_status']){
$where[] = ['work_status','=',$this->params['work_status']];
}
if(isset($this->params['server_status']) && '' != $this->params['server_status']){
$where[] = ['server_status','=',$this->params['server_status']];
}
if(isset($this->params['skill_id']) && '' != $this->params['skill_id']){
$skillIds = Skill::alias('S')
->join('coach_skill_index CSI','S.id = CSI.skill_id')
->column('CSI.coach_id');
$where[] = ['C.id','in',$skillIds];
}
if(isset($this->params['start_time']) && $this->params['start_time']){
$where[] = ['C.create_time','>=',$this->params['start_time']];
}
if(isset($this->params['end_time']) && $this->params['end_time']){
$where[] = ['C.create_time','<=',$this->params['end_time']];
}
return $where;
}
public function lists(): array
{
$lists = CoachUpdate::alias('C')
->join('coach_user UC','UC.id = C.coach_user_id')
->field('UC.sn,C.mobile,C.audit_status,C.skill_id,C.province_id,C.city_id,C.region_id,C.id,C.name,C.audit_remark,C.work_photo,C.goods_ids,C.create_time')
->append(['skill_desc','region_desc','audit_status_desc'])
->order('id desc')
->where($this->setWhere())
->limit($this->limitOffset, $this->limitLength)
->select()->toArray();
foreach ($lists as $key => $list){
$lists[$key]['goods_count'] = count($list['goods_ids']);
}
return $lists;
}
/**
* @notes 统计人数
* @return int
* @author cjhao
* @date 2024/8/21 17:53
*/
public function count(): int
{
return CoachUpdate::alias('C')
->join('coach_user UC','UC.id = C.coach_user_id')
->where($this->setWhere())
->count();
}
public function extend()
{
$allCount = CoachUpdate::alias('C')
->join('coach_user UC','UC.id = C.coach_user_id')
->where($this->setWhere())
->count();
$waitCount = CoachUpdate::alias('C')
->join('coach_user UC','UC.id = C.coach_user_id')
->where($this->setWhere())
->where(['audit_status'=>CoachEnum::AUDIT_STATUS_WAIT])
->count();
$passCount = CoachUpdate::alias('C')
->join('coach_user UC','UC.id = C.coach_user_id')
->where($this->setWhere())
->where(['audit_status'=>CoachEnum::AUDIT_STATUS_PASS])
->count();
$refuseCount = CoachUpdate::alias('C')
->join('coach_user UC','UC.id = C.coach_user_id')
->where($this->setWhere())
->where(['audit_status'=>CoachEnum::AUDIT_STATUS_REFUSE])
->count();
return [
'all_count' => $allCount,
'wait_count' => $waitCount,
'pass_count' => $passCount,
'refuse_count' => $refuseCount,
];
}
}

View File

@@ -0,0 +1,65 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\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 Tab
* @date 2021/8/17 11:05
*/
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 Tab
* @date 2021/8/17 11:06
*/
public function count(): int
{
$count = Crontab::count();
return $count;
}
}

View File

@@ -0,0 +1,64 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\adminapi\lists\decorate;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\enum\MenuEnum;
use app\common\model\decorate\Menu;
/**
* 菜单列表
* Class MenuLists
* @package app\adminapi\lists\decorate
*/
class MenuLists extends BaseAdminDataLists
{
/**
* @notes 菜单列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author ljj
* @date 2022/2/14 11:29 上午
*/
public function lists(): array
{
$lists = (new Menu())->field('id,name,image,link_type,link_address,sort,status')
->order(['sort'=>'asc','id'=>'desc'])
->append(['link_address_desc','status_desc'])
->limit($this->limitOffset, $this->limitLength)
->select()
->toArray();
foreach ($lists as &$list) {
$list['link_address_desc'] = MenuEnum::getLinkDesc($list['link_type']).':'.$list['link_address_desc'];
}
return $lists;
}
/**
* @notes 菜单总数
* @return int
* @author ljj
* @date 2022/2/14 11:29 上午
*/
public function count(): int
{
return (new Menu())->count();
}
}

View File

@@ -0,0 +1,52 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\adminapi\lists\decorate;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\decorate\Navigation;
/**
* 底部导航列表
* Class NavigationLists
* @package app\adminapi\lists\decorate
*/
class NavigationLists extends BaseAdminDataLists
{
/**
* @notes 底部导航列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author ljj
* @date 2022/2/14 10:12 上午
*/
public function lists(): array
{
return (new Navigation())->select()->toArray();
}
/**
* @notes 底部导航总数
* @return int
* @author ljj
* @date 2022/2/14 10:13 上午
*/
public function count(): int
{
return (new Navigation())->count();
}
}

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\dept;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\lists\ListsSearchInterface;
use app\common\model\dept\Jobs;
/**
* 岗位列表
* Class JobsLists
* @package app\adminapi\lists\dept
*/
class JobsLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @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();
}
}

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,135 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权购买去版权授权后方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\adminapi\lists\finance;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\enum\accountLog\AccountLogEnum;
use app\common\lists\ListsExcelInterface;
use app\common\model\accountLog\AccountLog;
use app\common\service\FileService;
class AccountLogLists extends BaseAdminDataLists implements ListsExcelInterface
{
/**
* @notes 搜索条件
* @return array
* @author ljj
* @date 2022/12/2 5:30 下午
*/
public function where()
{
$where = [];
if (isset($this->params['change_object']) && $this->params['change_object'] != '') {
$where[] = ['al.change_object','=',$this->params['change_object']];
}else {
$where[] = ['al.change_object','=',AccountLogEnum::MONEY];
}
if (isset($this->params['user_info']) && $this->params['user_info'] != '') {
$where[] = ['u.sn|u.mobile|u.nickname|u.account','like','%'.$this->params['user_info'].'%'];
}
if (isset($this->params['change_type']) && $this->params['change_type'] != '') {
$where[] = ['al.change_type','=',$this->params['change_type']];
}
// 开始时间
if(isset($this->params['start_time']) && $this->params['start_time'] != '') {
$where[] = ['al.create_time', '>=', strtotime($this->params['start_time'])];
}
// 结束时间
if(isset($this->params['end_time']) && $this->params['end_time'] != '') {
$where[] = ['al.create_time', '<=', strtotime($this->params['end_time'])];
}
if (isset($this->params['order_sn']) && $this->params['order_sn'] != '') {
$where[] = ['al.association_sn','=',$this->params['order_sn']];
}
return $where;
}
/**
* @notes 账户流水记录列表
* @return array
* @author ljj
* @date 2022/12/2 5:32 下午
*/
public function lists(): array
{
$lists = AccountLog::alias('al')
->join('user u', 'u.id = al.user_id')
->field('al.id,u.sn as user_sn,u.avatar,u.nickname,u.mobile,al.change_amount,al.left_amount,al.action,al.change_type,al.association_sn,al.create_time')
->append(['change_type_desc'])
->where(self::where())
->limit($this->limitOffset,$this->limitLength)
->order('al.id','desc')
->select()
->toArray();
foreach ($lists as &$list) {
$list['avatar'] = empty($list['avatar']) ? '' : FileService::getFileUrl($list['avatar']);
}
return $lists;
}
/**
* @notes 账户流水记录数量
* @return int
* @author ljj
* @date 2022/12/2 5:32 下午
*/
public function count(): int
{
return AccountLog::alias('al')
->join('user u', 'u.id = al.user_id')
->where(self::where())
->count();
}
/**
* @notes 导出字段
* @return string[]
* @author ljj
* @date 2023/4/12 2:40 下午
*/
public function setExcelFields(): array
{
return [
// '数据库字段名(支持别名) => 'Excel表字段名'
'user_sn' => '用户编号',
'nickname' => '用户昵称',
'change_amount' => '变动金额',
'left_amount' => '剩余金额',
'change_type_desc' => '变动类型',
'association_sn' => '来源单号',
'create_time' => '记录时间',
];
}
/**
* @notes 导出表名
* @return string
* @author ljj
* @date 2023/4/12 2:40 下午
*/
public function setFileName(): string
{
return '账户流水记录列表';
}
}

View File

@@ -0,0 +1,128 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权购买去版权授权后方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\adminapi\lists\finance;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\enum\accountLog\CoachAccountLogEnum;
use app\common\lists\ListsExcelInterface;
use app\common\model\accountLog\AccountLog;
use app\common\model\accountLog\CoachAccountLog;
class CoachAccountLogLists extends BaseAdminDataLists implements ListsExcelInterface
{
/**
* @notes 搜索条件
* @return array
* @author ljj
* @date 2022/12/2 5:30 下午
*/
public function where()
{
$where = [];
$changeObject = $this->params['change_object'] ?? CoachAccountLogEnum::MONEY;
$where[] = ['AL.change_object','=',$changeObject];
if (isset($this->params['user_info']) && $this->params['user_info'] != '') {
$where[] = ['C.sn|C.mobile|C.name','like','%'.$this->params['user_info'].'%'];
}
if (isset($this->params['change_type']) && $this->params['change_type'] != '') {
$where[] = ['AL.change_type','=',$this->params['change_type']];
}
// 开始时间
if(isset($this->params['start_time']) && $this->params['start_time'] != '') {
$where[] = ['AL.create_time', '>=', strtotime($this->params['start_time'])];
}
// 结束时间
if(isset($this->params['end_time']) && $this->params['end_time'] != '') {
$where[] = ['AL.create_time', '<=', strtotime($this->params['end_time'])];
}
if (isset($this->params['order_sn']) && $this->params['order_sn'] != '') {
$where[] = ['AL.association_sn','=',$this->params['order_sn']];
}
return $where;
}
/**
* @notes 账户流水记录列表
* @return array
* @author ljj
* @date 2022/12/2 5:32 下午
*/
public function lists(): array
{
$lists = CoachAccountLog::alias('AL')
->join('coach C', 'C.id = AL.coach_id')
->field('AL.id,C.sn as user_sn,C.name,C.mobile,AL.change_amount,AL.left_amount,AL.action,AL.change_type,AL.association_sn,AL.create_time')
->append(['change_type_desc'])
->where(self::where())
->limit($this->limitOffset,$this->limitLength)
->order('AL.id','desc')
->select()
->toArray();
return $lists;
}
/**
* @notes 账户流水记录数量
* @return int
* @author ljj
* @date 2022/12/2 5:32 下午
*/
public function count(): int
{
return CoachAccountLog::alias('AL')
->join('coach C', 'C.id = AL.coach_id')
->where(self::where())
->count();
}
/**
* @notes 导出字段
* @return string[]
* @author ljj
* @date 2023/4/12 2:40 下午
*/
public function setExcelFields(): array
{
return [
// '数据库字段名(支持别名) => 'Excel表字段名'
'user_sn' => '用户编号',
'nickname' => '用户昵称',
'change_amount' => '变动金额',
'left_amount' => '剩余金额',
'change_type_desc' => '变动类型',
'association_sn' => '来源单号',
'create_time' => '记录时间',
];
}
/**
* @notes 导出表名
* @return string
* @author ljj
* @date 2023/4/12 2:40 下午
*/
public function setFileName(): string
{
return '账户流水记录列表';
}
}

View File

@@ -0,0 +1,131 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\adminapi\lists\finance;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\lists\ListsExcelInterface;
use app\common\model\RechargeOrder;
use app\common\service\FileService;
class RechargeLists extends BaseAdminDataLists implements ListsExcelInterface
{
/**
* @notes 搜索条件
* @return array
* @author ljj
* @date 2022/12/2 5:30 下午
*/
public function where()
{
$where = [];
if (isset($this->params['sn']) && $this->params['sn'] != '') {
$where[] = ['ro.sn','=',$this->params['sn']];
}
if (isset($this->params['user_info']) && $this->params['user_info'] != '') {
$where[] = ['u.sn|u.mobile|u.nickname|u.account','like','%'.$this->params['user_info'].'%'];
}
if (isset($this->params['pay_way']) && $this->params['pay_way'] != '') {
$where[] = ['ro.pay_way','=',$this->params['pay_way']];
}
if (isset($this->params['pay_status']) && $this->params['pay_status'] != '') {
$where[] = ['ro.pay_status','=',$this->params['pay_status']];
}
// 开始时间
if(isset($this->params['start_time']) && $this->params['start_time'] != '') {
$where[] = ['ro.create_time', '>=', strtotime($this->params['start_time'])];
}
// 结束时间
if(isset($this->params['end_time']) && $this->params['end_time'] != '') {
$where[] = ['ro.create_time', '<=', strtotime($this->params['end_time'])];
}
return $where;
}
/**
* @notes 充值明细列表
* @return array
* @author ljj
* @date 2022/12/2 6:43 下午
*/
public function lists(): array
{
$lists = RechargeOrder::alias('ro')
->join('user u', 'u.id = ro.user_id')
->field('ro.id,u.avatar,u.nickname,ro.sn,ro.order_amount,ro.pay_way,ro.pay_status,ro.pay_time,ro.create_time')
->append(['pay_way_desc','pay_status_desc'])
->where(self::where())
->limit($this->limitOffset,$this->limitLength)
->order('ro.id','desc')
->select()
->toArray();
foreach ($lists as &$list) {
$list['avatar'] = empty($list['avatar']) ? '' : FileService::getFileUrl($list['avatar']);
}
return $lists;
}
/**
* @notes 充值明细数量
* @return int
* @author ljj
* @date 2022/12/2 6:43 下午
*/
public function count(): int
{
return RechargeOrder::alias('ro')
->join('user u', 'u.id = ro.user_id')
->where(self::where())
->count();
}
/**
* @notes 导出字段
* @return string[]
* @author ljj
* @date 2023/4/12 2:40 下午
*/
public function setExcelFields(): array
{
return [
// '数据库字段名(支持别名) => 'Excel表字段名'
'nickname' => '用户昵称',
'sn' => '充值单号',
'order_amount' => '充值金额',
'pay_way_desc' => '支付方式',
'pay_status_desc' => '支付状态',
'pay_time' => '支付时间',
'create_time' => '提交时间',
];
}
/**
* @notes 导出表名
* @return string
* @author ljj
* @date 2023/4/12 2:40 下午
*/
public function setFileName(): string
{
return '充值明细列表';
}
}

View File

@@ -0,0 +1,127 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权购买去版权授权后方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\adminapi\lists\finance;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\enum\accountLog\CoachAccountLogEnum;
use app\common\lists\ListsExcelInterface;
use app\common\model\accountLog\ShopAccountLog;
class ShopAccountLogLists extends BaseAdminDataLists implements ListsExcelInterface
{
/**
* @notes 搜索条件
* @return array
* @author ljj
* @date 2022/12/2 5:30 下午
*/
public function where()
{
$where = [];
$changeObject = $this->params['change_object'] ?? CoachAccountLogEnum::MONEY;
$where[] = ['AL.change_object','=',$changeObject];
if (isset($this->params['user_info']) && $this->params['user_info'] != '') {
$where[] = ['S.sn|S.mobile','like','%'.$this->params['user_info'].'%'];
}
if (isset($this->params['change_type']) && $this->params['change_type'] != '') {
$where[] = ['AL.change_type','=',$this->params['change_type']];
}
// 开始时间
if(isset($this->params['start_time']) && $this->params['start_time'] != '') {
$where[] = ['AL.create_time', '>=', strtotime($this->params['start_time'])];
}
// 结束时间
if(isset($this->params['end_time']) && $this->params['end_time'] != '') {
$where[] = ['AL.create_time', '<=', strtotime($this->params['end_time'])];
}
if (isset($this->params['order_sn']) && $this->params['order_sn'] != '') {
$where[] = ['AL.association_sn','=',$this->params['order_sn']];
}
return $where;
}
/**
* @notes 账户流水记录列表
* @return array
* @author ljj
* @date 2022/12/2 5:32 下午
*/
public function lists(): array
{
$lists = ShopAccountLog::alias('AL')
->join('shop S', 'S.id = AL.shop_id')
->field('AL.id,S.sn as user_sn,S.name,S.mobile,AL.change_amount,AL.left_amount,AL.action,AL.change_type,AL.association_sn,AL.create_time')
->append(['change_type_desc'])
->where(self::where())
->limit($this->limitOffset,$this->limitLength)
->order('AL.id','desc')
->select()
->toArray();
return $lists;
}
/**
* @notes 账户流水记录数量
* @return int
* @author ljj
* @date 2022/12/2 5:32 下午
*/
public function count(): int
{
return ShopAccountLog::alias('AL')
->join('shop S', 'S.id = AL.shop_id')
->where(self::where())
->count();
}
/**
* @notes 导出字段
* @return string[]
* @author ljj
* @date 2023/4/12 2:40 下午
*/
public function setExcelFields(): array
{
return [
// '数据库字段名(支持别名) => 'Excel表字段名'
'user_sn' => '用户编号',
'nickname' => '用户昵称',
'change_amount' => '变动金额',
'left_amount' => '剩余金额',
'change_type_desc' => '变动类型',
'association_sn' => '来源单号',
'create_time' => '记录时间',
];
}
/**
* @notes 导出表名
* @return string
* @author ljj
* @date 2023/4/12 2:40 下午
*/
public function setFileName(): string
{
return '账户流水记录列表';
}
}

View File

@@ -0,0 +1,142 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权购买去版权授权后方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\adminapi\lists\finance;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\lists\ListsExtendInterface;
use app\common\model\coach\Coach;
use app\common\model\shop\Shop;
use app\common\model\withdraw\WithdrawApply;
use app\common\service\FileService;
class WithdrawLists extends BaseAdminDataLists implements ListsExtendInterface
{
public function setWhere()
{
$source = $this->params['source'] ?? 1;
$type = $this->params['type'] ?? '';
$keyword = $this->params['keyword'] ?? '';
$channel = $this->params['channel'] ?? '';
$startTime = $this->params['start_time'] ?? '';
$endTime = $this->params['end_time'] ?? '';
$status = $this->params['status'] ?? '';
$where = [];
$where[] = ['source','=',$source];
if($keyword){
if(1 == $source){
$ids = Coach::where('sn|name','like','%'.$keyword.'%')->field('id')->select()->toArray();
$ids = array_column($ids,'id');
}else{
$ids = Shop::where('sn|name','like','%'.$keyword.'%')->field('id')->select()->toArray();
$ids = array_column($ids,'id');
}
$where[] = ['relation_id','in',$ids];
}
if($channel){
//渠道
if(1 == $channel){
$where[] = ['apply_type','=',1];
}else{
$where[] = ['apply_type','=',2];
}
}
if($type){
$where[] = ['type','=',$type];
}
if($startTime){
$where[] = ['create_time','>',$startTime];
}
if($endTime){
$where[] = ['create_time','<',$endTime];
}
switch ($status){
case 1:
$where[] = ['status','=',1];
break;
case 2:
$where[] = ['status','=',4];
break;
case 3:
$where[] = ['status','in',[2,5]];
break;
case 4:
$where[] = ['status','in',[2,3,6]];
break;
}
return $where;
}
public function lists(): array
{
$lists = WithdrawApply::where($this->setWhere())
->append(['status_desc','apply_type_desc','type_desc'])
->limit($this->limitOffset, $this->limitLength)
->withoutField('delete_time')
->order('id desc')
->select()
->toArray();
$source = $this->params['source'] ?? 1;
$relationLists = [];
$relationIds = array_column($lists,'relation_id');
if(1 == $source){
$relationLists = Coach::where(['id'=>$relationIds])->column('name,sn,work_photo','id');
}else{
$relationLists = Shop::where(['id'=>$relationIds])->column('name,sn,logo','id');
}
foreach ($lists as $key => $value){
if(1 == $source){
$lists[$key]['relation_info'] = [
'name' => $relationLists[$value['relation_id']]['name'] ?? '',
'sn' => $relationLists[$value['relation_id']]['sn'] ?? '',
'image' => FileService::getFileUrl($relationLists[$value['relation_id']]['work_photo'] ?? '')
];
}else{
$lists[$key]['relation_info'] = [
'name' => $relationLists[$value['relation_id']]['name'] ?? '',
'sn' => $relationLists[$value['relation_id']]['sn'] ?? '',
'image' => FileService::getFileUrl($relationLists[$value['relation_id']]['logo'] ?? '')
];
}
}
return $lists;
}
public function count(): int
{
return WithdrawApply::where($this->setWhere())->count();
}
public function extend()
{
$whereLists = $this->setWhere();
foreach ($whereLists as $key => $where){
if($where[0] == 'status'){
unset($whereLists[$key]);
}
}
return [
'all_count' => WithdrawApply::where($whereLists)->count(),
'wait_audit' => WithdrawApply::where($whereLists)->where('status','=',1)->count(),
'withdraw_ing' => WithdrawApply::where($whereLists)->where('status','=',4)->count(),
'withdraw_success' => WithdrawApply::where($whereLists)->where('status','in',[2,5])->count(),
'withdraw_failt' => WithdrawApply::where($whereLists)->where('status','in',[2,3,6])->count(),
];
}
}

View File

@@ -0,0 +1,129 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权购买去版权授权后方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\adminapi\lists\goods;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\goods\GoodsCategory;
class GoodsCategoryLists extends BaseAdminDataLists
{
/**
* @notes 搜索条件
* @return array
* @author ljj
* @date 2023/4/12 10:13 上午
*/
public function where()
{
$where = [];
$category_ids = [];
if (isset($this->params['name']) && $this->params['name'] != '') {
$category_lists = GoodsCategory::field('id,pid')->where('name','like','%'.$this->params['name'].'%')->select()->toArray();
if (empty($category_lists)) {
return [];
}
$category_ids = array_column($category_lists,'id');
foreach ($category_lists as $val) {
if ($val['pid'] > 0) {
$category_ids[] = $val['pid'];
}
}
}
if (isset($this->params['is_show']) && $this->params['is_show'] != '') {
$category_lists = GoodsCategory::field('id,pid')->where('is_show','=',$this->params['is_show'])->select()->toArray();
if (empty($category_lists)) {
return [];
}
$ids_arr = array_column($category_lists,'id');
foreach ($category_lists as $val) {
if ($val['pid'] > 0) {
$ids_arr[] = $val['pid'];
}
}
if (!empty($category_ids)) {
$category_ids = array_intersect($category_ids,$ids_arr);
} else {
$category_ids = $ids_arr;
}
}
if (isset($this->params['is_recommend']) && $this->params['is_recommend'] != '') {
$category_lists = GoodsCategory::field('id,pid')->where('is_recommend','=',$this->params['is_recommend'])->select()->toArray();
if (empty($category_lists)) {
return [];
}
$ids_arr = array_column($category_lists,'id');
foreach ($category_lists as $val) {
if ($val['pid'] > 0) {
$ids_arr[] = $val['pid'];
}
}
if (!empty($category_ids)) {
$category_ids = array_intersect($category_ids,$ids_arr);
} else {
$category_ids = $ids_arr;
}
}
if (!empty($category_ids)) {
$category_ids = array_unique($category_ids);
$where[] = ['id','in',$category_ids];
}
return $where;
}
/**
* @notes 服务分类列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author ljj
* @date 2022/2/8 3:51 下午
*/
public function lists(): array
{
$lists = (new GoodsCategory())->field('id,name,pid,level,image,sort,is_show,is_recommend,create_time')
->where($this->where())
->order(['sort'=>'desc','id'=>'asc'])
->append(['recommend_desc','relevance_num'])
->select()
->toArray();
$lists = linear_to_tree($lists,'sons');
// 分页
$index = ($this->limitOffset -1) * $this->limitLength;
$lists = array_slice($lists, $index, $this->limitLength);
return $lists;
}
/**
* @notes 服务分类数量
* @return int
* @author ljj
* @date 2022/2/8 3:51 下午
*/
public function count(): int
{
return (new GoodsCategory())->where($this->where())->where(['level'=>1])->count();
}
}

View File

@@ -0,0 +1,114 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权购买去版权授权后方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\adminapi\lists\goods;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\goods\GoodsComment;
use app\common\service\FileService;
class GoodsCommentLists extends BaseAdminDataLists
{
/**
* @notes 搜索条件
* @return array
* @author ljj
* @date 2022/2/9 6:00 下午
*/
public function where()
{
$where = [];
$params = $this->params;
if (isset($params['goods_info']) && $params['goods_info'] != '') {
$where[] = ['g.name','like','%'.$params['goods_info'].'%'];
}
if (isset($params['user_info']) && $params['user_info'] != '') {
$where[] = ['u.nickname','like','%'.$params['user_info'].'%'];
}
if (isset($params['status']) && $params['status'] != '') {
$where[] = ['gc.status','=',$params['status']];
}
if (isset($params['comment_level']) && $params['comment_level'] != '') {
switch ($params['comment_level']){
case 'good'://好评
$where[]= ['gc.service_comment', '>', 3];
break;
case 'medium'://中评
$where[]= ['gc.service_comment', '=', 3];
break;
case 'bad'://差评
$where[]= ['gc.service_comment', '<', 3];
break;
}
}
if (isset($params['start_time']) && $params['start_time'] != '') {
$where[] = ['gc.create_time','>=',strtotime($params['start_time'])];
}
if (isset($params['end_time']) && $params['end_time'] != '') {
$where[] = ['gc.create_time','<=',strtotime($params['end_time'])];
}
return $where;
}
/**
* @notes 服务评价列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author ljj
* @date 2022/2/9 6:00 下午
*/
public function lists(): array
{
$where = self::where();
$lists = (new GoodsComment())->alias('gc')
->join('user u', 'u.id = gc.user_id')
->join('goods g', 'g.id = gc.goods_id')
->field('gc.id,gc.goods_id,gc.user_id,gc.order_goods_id,gc.service_comment,gc.comment,gc.reply,gc.status,gc.create_time,g.name as goods_name,g.image as goods_image')
->with(['user'])
->order(['gc.id'=>'desc'])
->where($where)
->append(['comment_level','status_desc','goods_comment_image'])
->limit($this->limitOffset, $this->limitLength)
->select()
->toArray();
foreach ($lists as &$list) {
$list['goods_image'] = FileService::getFileUrl($list['goods_image']);
}
return $lists;
}
/**
* @notes 服务评价总数
* @return int
* @author ljj
* @date 2022/2/9 5:59 下午
*/
public function count(): int
{
$where = self::where();
return (new GoodsComment())->alias('gc')->join('user u', 'u.id = gc.user_id')->join('goods g', 'g.id = gc.goods_id')->where($where)->count();
}
}

View File

@@ -0,0 +1,202 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权购买去版权授权后方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\adminapi\lists\goods;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\lists\ListsExtendInterface;
use app\common\model\coach\Coach;
use app\common\model\goods\Goods;
use app\common\model\goods\GoodsCategory;
use app\common\model\goods\GoodsSkillIndex;
class GoodsLists extends BaseAdminDataLists implements ListsExtendInterface
{
/**
* @notes 搜索条件
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author ljj
* @date 2022/11/24 11:00
*/
public function where()
{
$where = [];
$shopId = 0;
$coachId = $this->params['coach_id'] ?? 0;
if($coachId){
$shopId = Coach::where(['id'=>$coachId])->value('shop_id');
}
if($shopId){
$where[] = ['shop_id','in',[0,$shopId]];
}else{
$where[] = ['shop_id','=',0];
}
if (isset($this->params['name']) && $this->params['name'] != '') {
$where[] = ['name','like','%'.$this->params['name'].'%'];
}
if (isset($this->params['status']) && $this->params['status'] != '') {
switch ($this->params['status']) {
case 1://销售中
$where[] = ['status','=',1];
break;
case 2://仓库中
$where[] = ['status','=',0];
break;
}
}
$auditStatus = $this->params['audit_status'] ?? 1;
if('' != $auditStatus){
$where[] = ['audit_status','=',$auditStatus];
}
if (isset($this->params['category_id']) && $this->params['category_id']) {
$categoryIds = [];
foreach ($this->params['category_id'] as $categoryId){
$categoryIds[] = $categoryId;
$category = GoodsCategory::where(['id'=>$categoryId])->findOrEmpty();
if(1 == $category['level']){
$categoryId = GoodsCategory::where(['pid'=>$category['id']])->column('id');
$categoryIds = array_merge($categoryId,$categoryIds);
}
}
$where[] = ['category_id','in',implode(',',$categoryIds)];
}
if (isset($this->params['second_id']) && $this->params['second_id']) {
$where[] = ['category_id','=',$this->params['second_id']];
}elseif (isset($this->params['first_id']) && $this->params['first_id']) {
$category_lists = GoodsCategory::select()->toArray();
$category_arr = [];
foreach ($category_lists as $item) {
$category_arr[$item['pid']][] = $item['id'];
}
$ids_arr = $category_arr[$this->params['first_id']] ?? '';
$ids = $this->params['first_id'];
if ($ids_arr) {
$ids = implode(',',$ids_arr).','.$this->params['first_id'];
}
$where[] = ['category_id','in',$ids];
}
if(isset($this->params['skill_id']) && $this->params['skill_id']){
$goodsIds = GoodsSkillIndex::where(['skill_id'=>$this->params['skill_id']])->column('goods_id');
$where[] = ['id','in',$goodsIds];
}
return $where;
}
/**
* @notes 服务列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author ljj
* @date 2022/2/9 11:23 上午
*/
public function lists(): array
{
$where = self::where();
$lists = (new Goods())
->field('id,name,category_id,image,price,status,sort,order_num,create_time')
->order(['sort'=>'desc','id'=>'desc'])
->where($where)
->append(['category_desc','status_desc','skill_desc'])
->limit($this->limitOffset, $this->limitLength)
->select()
->toArray();
return $lists;
}
/**
* @notes 服务数量
* @return int
* @author ljj
* @date 2022/2/9 11:24 上午
*/
public function count(): int
{
$where = self::where();
return (new Goods())->where($where)->count();
}
/**
* @notes 服务数据统计
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author ljj
* @date 2022/2/21 5:16 下午
*/
public function extend(): array
{
$where = [];
$where[] = ['shop_id','=',0];
if (isset($this->params['name']) && $this->params['name'] != '') {
$where[] = ['name','like','%'.$this->params['name'].'%'];
}
if(isset($this->params['audit_status']) && '' != $this->params['audit_status']){
$where[] = ['audit_status','=',$this->params['audit_status']];
}
if (isset($this->params['second_id']) && $this->params['second_id']) {
$where[] = ['category_id','=',$this->params['second_id']];
}elseif (isset($this->params['first_id']) && $this->params['first_id']) {
$category_lists = GoodsCategory::select()->toArray();
$category_arr = [];
foreach ($category_lists as $item) {
$category_arr[$item['pid']][] = $item['id'];
}
$ids_arr = $category_arr[$this->params['first_id']] ?? '';
$ids = $this->params['first_id'];
if ($ids_arr) {
$ids = implode(',',$ids_arr).','.$this->params['first_id'];
}
$where[] = ['category_id','in',$ids];
}
if(isset($this->params['skill_id']) && $this->params['skill_id']){
$goodsIds = GoodsSkillIndex::where(['skill_id'=>$this->params['skill_id']])->column('goods_id');
$where[] = ['id','in',$goodsIds];
}
$lists = (new Goods())->where($where)
->select()
->toArray();
$data['all_count'] = 0;
$data['SHELVE'] = 0;
$data['UNSHELVE'] = 0;
foreach ($lists as $val) {
$data['all_count'] += 1;
if ($val['status'] == 1) {
$data['SHELVE'] += 1;
}
if ($val['status'] == 0) {
$data['UNSHELVE'] += 1;
}
}
return $data;
}
}

View File

@@ -0,0 +1,58 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权购买去版权授权后方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\adminapi\lists\goods;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\goods\GoodsUnit;
class GoodsUnitLists extends BaseAdminDataLists
{
/**
* @notes 服务单位列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author ljj
* @date 2022/2/8 11:06 上午
*/
public function lists(): array
{
$lists = (new GoodsUnit())->field('id,name,sort,create_time')
->order(['sort'=>'desc','id'=>'desc'])
->limit($this->limitOffset, $this->limitLength)
->select()
->toArray();
return $lists;
}
/**
* @notes 服务单位数量
* @return int
* @author ljj
* @date 2022/2/8 11:06 上午
*/
public function count(): int
{
return (new GoodsUnit())->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,oa_notice,mnp_notice,type')
->append(['sms_status_desc','oa_status_desc','mnp_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,250 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权购买去版权授权后方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\adminapi\lists\order;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\enum\OrderEnum;
use app\common\enum\PayEnum;
use app\common\lists\ListsExtendInterface;
use app\common\model\coach\Coach;
use app\common\model\order\Order;
use app\common\model\order\OrderGoods;
use app\common\model\pay\PayConfig;
use app\common\model\pay\PayWay;
use app\common\model\shop\Shop;
use app\common\model\user\User;
use app\common\service\FileService;
class OrderLists extends BaseAdminDataLists implements ListsExtendInterface
{
public $where = [];
/**
* @notes 搜索条件
* @return array
* @author ljj
* @date 2022/2/10 6:14 下午
*/
public function setWhere()
{
$this->where = [];
$params = $this->params;
if(isset($params['order_status']) && '' != $params['order_status']){
$this->where[] = ['O.order_status','=',$params['order_status']];
}
if (isset($params['order_info']) && $params['order_info'] != '') {
$this->where[] = ['O.sn','like','%'.$params['order_info'].'%'];
}
if (isset($params['user_info']) && $params['user_info'] != '') {
$this->where[] = ['U.sn|U.nickname|U.account','like','%'.$params['user_info'].'%'];
}
if (isset($params['goods_info']) && $params['goods_info'] != '') {
$orderIds = OrderGoods::where('goods_name','like','%'.$params['goods_info'].'%')->field('order_id')->select()->toArray();
empty($orderIds) && $orderIds = [];
$orderIds = array_column($orderIds,'order_id');
$this->where[] = ['O.id','in',implode(',',$orderIds)];
}
if (isset($params['pay_status']) && $params['pay_status'] != '') {
$this->where[] = ['O.pay_status','=',$params['pay_status']];
}
if (isset($params['start_time']) && $params['start_time'] != '') {
$timeType = $params['time_type'] ?? 1;
switch ($timeType){
case 1:
$this->where[] = ['O.create_time','>=',strtotime($params['start_time'])];
break;
case 2:
$this->where[] = ['O.pay_time','>=',strtotime($params['start_time'])];
break;
case 3:
$this->where[] = ['O.true_server_finish_time','>=',strtotime($params['start_time'])];
break;
}
}
if (isset($params['end_time']) && $params['end_time'] != '') {
$timeType = $params['time_type'] ?? 1;
switch ($timeType){
case 1:
$this->where[] = ['O.create_time','<=',strtotime($params['end_time'])];
break;
case 2:
$this->where[] = ['O.pay_time','<=',strtotime($params['end_time'])];
break;
case 3:
$this->where[] = ['O.true_server_finish_time','<=',strtotime($params['end_time'])];
break;
}
}
if (isset($params['coach_info']) && $params['coach_info'] != '') {
$this->where[] = ['C.name|C.sn','like','%'.$params['coach_info'].'%'];
}
if(isset($params['pay_way']) && $params['pay_way']){
$this->where[] = ['O.pay_way','=',$params['pay_way']];
}
if(isset($params['sn']) && $params['sn']){
$this->where[] = ['O.sn','like','%'.$params['sn'].'%'];
}
return $this->where;
}
/**
* @notes 订单列表
* @return array
* @author ljj
* @date 2022/2/10 6:19 下午
*/
public function lists(): array
{
self::setWhere();
$lists = Order::alias('O')
->join('user U','O.user_id = U.id')
->join('coach C','O.coach_id = C.id')
->where($this->where)
->order('O.id desc')
->field('O.id,O.shop_id,O.total_order_amount,O.total_refund_amount,O.order_distance,O.pay_status,O.user_id,O.total_amount,O.coach_id,O.sn,O.order_status,O.appoint_time,O.order_amount,O.create_time')
->append(['order_distance_desc','appoint_time','appoint_date','order_status_desc','take_order_btn','depart_btn','dispatch_btn','arrive_btn','server_start_btn','server_finish_btn','refund_btn','cancel_btn','order_cancel_time'])
->limit($this->limitOffset, $this->limitLength)
->select()->toArray();
if(empty($lists)){
return [];
}
$orderIds = array_column($lists,'id');
$lists = array_column($lists,null,'id');
$orderGoodsLists = OrderGoods::where(['order_id'=>$orderIds])->select()->toArray();
$coachIds = array_column($lists,'coach_id');
$coachLists = Coach::where(['id'=>$coachIds])->column('sn,name,work_photo,shop_id','id');
$shopIds = array_column($lists,'shop_id');
$shopLists = Shop::where(['id'=>$shopIds])->column('sn,name','id');
$userIds = array_column($lists,'user_id');
$userLists = User::where(['id'=>$userIds])->column('id,sn,nickname,mobile,avatar','id');
foreach ($orderGoodsLists as $orderGoodsList){
$orderGoods = $lists[$orderGoodsList['order_id']]['order_goods'] ?? [];
$orderGoods[] = $orderGoodsList;
$lists[$orderGoodsList['order_id']]['order_goods'] = $orderGoods;
}
foreach ($lists as $key => $order){
$lists[$key]['coach_info'] = $coachLists[$order['coach_id']] ?? [];
$lists[$key]['coach_info']['work_photo'] = FileService::getFileUrl($lists[$key]['coach_info']['work_photo'] ?? '');
$lists[$key]['shop_info'] = $shopLists[$order['shop_id']] ?? [];
$lists[$key]['user_info'] = $userLists[$order['user_id']] ?? [];
$lists[$key]['user_info']['avatar'] = FileService::getFileUrl($lists[$key]['user_info']['avatar'] ?? '');
if(!isset($order['address_snap']['house_number'])){
$lists[$key]['address_snap']['house_number'] = '';
}
}
return array_values($lists);
}
/**
* @notes 订单总数
* @return int
* @author ljj
* @date 2022/2/10 6:19 下午
*/
public function count(): int
{
return Order::alias('O')
->join('user U','O.user_id = U.id')
->join('coach C','O.coach_id = C.id')
->where($this->where)
->count();
}
/**
* @notes 订单数据统计
* @return array
* @author ljj
* @date 2022/2/15 11:07 上午
*/
public function extend(): array
{
if(isset($this->where[0]) && 'O.order_status' == $this->where[0][0]){
unset($this->where[0]);
$this->where = array_values($this->where);
}
$lists = Order::alias('O')
->join('user U','O.user_id = U.id')
->join('coach C','O.coach_id = C.id')
->where($this->where)
->field('O.order_status')
->select();
//全部
$data['all_count'] = 0;
//待支付
$data['wait_pay_count'] = 0;
//待接单
$data['wait_take_count'] = 0;
//待出发
$data['wait_depart_count'] = 0;
//已出发
$data['depart_count'] = 0;
//已到达
$data['arrive_count'] = 0;
//服务中
$data['start_server_count'] = 0;
//完成服务
$data['finish_server_count'] = 0;
//关闭
$data['close_count'] = 0;
$data['pay_way'] = PayConfig::field('id,name,pay_way')->select();
$data['order_status'] = OrderEnum::getOrderStatusDesc();
foreach ($lists as $val) {
//全部
$data['all_count'] += 1;
switch ($val['order_status']){
//待支付
case OrderEnum::ORDER_STATUS_WAIT_PAY:
$data['wait_pay_count']++;
break;
//待接单
case OrderEnum::ORDER_STATUS_WAIT_RECEIVING:
$data['wait_take_count']++;
break;
//待出发
case OrderEnum::ORDER_STATUS_WAIT_DEPART:
$data['wait_depart_count']++;
break;
//已出发
case OrderEnum::ORDER_STATUS_DEPART:
$data['depart_count']++;
break;
//已达到
case OrderEnum::ORDER_STATUS_ARRIVE:
$data['arrive_count']++;
break;
//服务中
case OrderEnum::ORDER_STATUS_START_SERVER:
$data['start_server_count']++;
break;
//完成服务
case OrderEnum::ORDER_STATUS_SERVER_FINISH:
$data['finish_server_count']++;
break;
//服务关闭
case OrderEnum::ORDER_STATUS_CLOSE:
$data['close_count']++;
break;
}
}
return $data;
}
}

View File

@@ -0,0 +1,175 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权购买去版权授权后方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\adminapi\lists\order;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\enum\OrderRefundEnum;
use app\common\lists\ListsExtendInterface;
use app\common\model\order\OrderRefund;
class OrderRefundLists extends BaseAdminDataLists implements ListsExtendInterface
{
/**
* @notes 搜索条件
* @return array
* @author ljj
* @date 2022/9/9 4:31 下午
*/
public function where()
{
$where = [];
$params = $this->params;
if (isset($params['refund_sn']) && $params['refund_sn'] != '') {
$where[] = ['or.sn','like','%'.$params['refund_sn'].'%'];
}
if (isset($params['source_sn']) && $params['source_sn'] != '') {
$where[] = ['o.sn','like','%'.$params['source_sn'].'%'];
}
if (isset($params['user_info']) && $params['user_info'] != '') {
$where[] = ['u.sn|u.nickname','like','%'.$params['user_info'].'%'];
}
if (isset($params['refund_type']) && $params['refund_type'] != '') {
$where[] = ['or.type','=',$params['refund_type']];
}
if (isset($params['start_time']) && $params['start_time'] != '') {
$where[] = ['or.create_time','>=',strtotime($params['start_time'])];
}
if (isset($params['end_time']) && $params['end_time'] != '') {
$where[] = ['or.create_time','<=',strtotime($params['end_time'])];
}
if (isset($params['refund_status']) && $params['refund_status'] != '') {
switch ($params['refund_status']) {
case 1:
$where[] = ['or.refund_status','=',0];
break;
case 2:
$where[] = ['or.refund_status','=',1];
break;
case 3:
$where[] = ['or.refund_status','=',2];
break;
}
}
return $where;
}
/**
* @notes 订单退款列表
* @return array
* @author ljj
* @date 2022/9/9 4:37 下午
*/
public function lists(): array
{
$where = self::where();
$lists = (new OrderRefund())->alias('or')
->join('user u', 'u.id = or.user_id')
->join('order o', 'o.id = or.order_id')
->field('or.id,or.sn as refund_sn,or.user_id,or.type,round(or.refund_amount+or.refund_car_amount,2) as refund_amount,or.refund_status,or.create_time,o.sn as source_sn')
->with(['user' => function($query){
$query->field('id,sn,nickname,avatar,mobile');
}])
->where($where)
->order(['or.id'=>'desc'])
->append(['type_desc','refund_status_desc'])
->limit($this->limitOffset, $this->limitLength)
->select()
->toArray();
return $lists;
}
/**
* @notes 订单退款数量
* @return int
* @author ljj
* @date 2022/9/9 4:37 下午
*/
public function count(): int
{
$where = self::where();
return (new OrderRefund())->alias('or')
->join('user u', 'u.id = or.user_id')
->join('order o', 'o.id = or.order_id')
->where($where)
->count();
}
/**
* @notes 订单退款数据统计
* @return array
* @author ljj
* @date 2022/9/9 4:41 下午
*/
public function extend(): array
{
$where = self::where();
foreach ($where as $key=>$val) {
if ($val[0] == 'or.refund_status') {
unset($where[$key]);
}
}
$lists = (new OrderRefund())->alias('or')
->join('user u', 'u.id = or.user_id')
->join('order o', 'o.id = or.order_id')
->field('or.refund_status,or.refund_amount')
->where($where)
->select()
->toArray();
$all_count = 0;
$refund_wait_count = 0;
$refund_success_count = 0;
$refund_fail_count = 0;
$total_refund_amount = OrderRefund::sum('refund_amount');
$refund_ing_amount = OrderRefund::where(['refund_status'=>OrderRefundEnum::STATUS_ING])->sum('refund_amount');
$refund_success_amount = OrderRefund::where(['refund_status'=>OrderRefundEnum::STATUS_SUCCESS])->sum('refund_amount');
$refund_fail_amount = OrderRefund::where(['refund_status'=>OrderRefundEnum::STATUS_FAIL])->sum('refund_amount');
foreach ($lists as $val) {
$all_count += 1;
if ($val['refund_status'] == OrderRefundEnum::STATUS_ING) {
$refund_wait_count += 1;
}
if ($val['refund_status'] == OrderRefundEnum::STATUS_SUCCESS) {
$refund_success_count += 1;
}
if ($val['refund_status'] == OrderRefundEnum::STATUS_FAIL) {
$refund_fail_count += 1;
}
}
return [
'all_count' => $all_count,
'refund_wait_count' => $refund_wait_count,
'refund_success_count' => $refund_success_count,
'refund_fail_count' => $refund_fail_count,
'total_refund_amount' => $total_refund_amount,
'refund_ing_amount' => $refund_ing_amount,
'refund_success_amount' => $refund_success_amount,
'refund_fail_amount' => $refund_fail_amount,
];
}
}

View File

@@ -0,0 +1,62 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权购买去版权授权后方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\adminapi\lists\order;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\order\OrderRefundLog;
class OrderRefundLogLists extends BaseAdminDataLists
{
/**
* @notes 退款日志列表
* @return array
* @author ljj
* @date 2022/9/9 5:52 下午
*/
public function lists(): array
{
$lists = (new OrderRefundLog())->alias('orl')
->join('order_refund or', 'or.id = orl.refund_id')
->field('orl.id,orl.sn,or.refund_amount + or.refund_car_amount as refund_amount,orl.refund_status,orl.create_time,orl.operator_id,orl.type')
->where(['refund_id'=>$this->params['id']])
->order(['orl.id'=>'desc'])
->append(['operator_desc','refund_status_desc'])
->limit($this->limitOffset, $this->limitLength)
->select()
->toArray();
return $lists;
}
/**
* @notes 退款日志数量
* @return int
* @author ljj
* @date 2022/9/9 5:52 下午
*/
public function count(): int
{
return (new OrderRefundLog())->alias('orl')
->join('order_refund or', 'or.id = orl.refund_id')
->where(['refund_id'=>$this->params['id']])
->count();
}
}

View File

@@ -0,0 +1,58 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权购买去版权授权后方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\adminapi\lists\order;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\order\OrderTime;
class OrderTimeLists extends BaseAdminDataLists
{
/**
* @notes 订单预约时间段列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author ljj
* @date 2022/2/11 5:49 下午
*/
public function lists(): array
{
$lists = (new OrderTime())->field('id,start_time,end_time,sort')
->order(['sort'=>'desc','id'=>'asc'])
->append(['time_desc'])
->select()
->toArray();
return $lists;
}
/**
* @notes 订单预约时间段总数
* @return int
* @author ljj
* @date 2022/2/11 5:49 下午
*/
public function count(): int
{
return (new OrderTime())->count();
}
}

View File

@@ -0,0 +1,73 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权购买去版权授权后方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\adminapi\lists\setting;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\city\City;
use app\common\model\skill\Skill;
class CityLists extends BaseAdminDataLists
{
/**
* @notes 列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author ljj
* @date 2022/2/8 3:51 下午
*/
public function lists(): array
{
$lists = (new City())
->order(['id'=>'desc'])
->withoutField('update_time,delete_time')
->limit($this->limitOffset, $this->limitLength)
->select()
->toArray();
foreach ($lists as $key => $value){
if(0 == $value['taxi']){
$lists[$key]['start_km'] = 0;
$lists[$key]['start_price'] = 0;
$lists[$key]['continue_price'] = 0;
}
if(0 == $value['bus']){
$lists[$key]['bus_start_time'] = 0;
$lists[$key]['bus_end_time'] = 0;
$lists[$key]['bus_fare'] = 0;
}
}
return $lists;
}
/**
* @notes 服务分类数量
* @return int
* @author ljj
* @date 2022/2/8 3:51 下午
*/
public function count(): int
{
return (new City())->count();
}
}

View File

@@ -0,0 +1,59 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权购买去版权授权后方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\adminapi\lists\setting;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\MapKey;
class MapKeyLists extends BaseAdminDataLists
{
/**
* @notes 地图key列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author ljj
* @date 2024/11/5 下午1:54
*/
public function lists(): array
{
$lists = (new MapKey())->order(['id'=>'desc'])
->append(['type_desc'])
->json(['error_info'],true)
->limit($this->limitOffset, $this->limitLength)
->select()
->toArray();
return $lists;
}
/**
* @notes 数量
* @return int
* @author ljj
* @date 2024/11/5 下午1:55
*/
public function count(): int
{
return (new MapKey())->count();
}
}

View File

@@ -0,0 +1,24 @@
<?php
namespace app\adminapi\lists\setting;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\TextList;
class TextLists extends BaseAdminDataLists
{
public function lists(): array
{
$lists = TextList::withoutField('update_time,delete_time')
->limit($this->limitOffset, $this->limitLength)
->order(['id'=>'desc'])
->select()
->toArray();
return $lists;
}
public function count(): int
{
return TextList::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,107 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\adminapi\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',
'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,60 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\adminapi\lists\setting\system;
use app\adminapi\lists\BaseAdminDataLists;
use app\adminapi\logic\setting\system\UpgradeLogic;
/**
* 系统更新列表
* Class UpgradeLists
* @package app\adminapi\lists\settings\system
*/
class UpgradeLists extends BaseAdminDataLists
{
/**
* @notes 查看系统更新列表
* @return array
* @author 段誉
* @date 2021/8/14 17:16
*/
public function lists(): array
{
$lists = UpgradeLogic::getRemoteVersion($this->pageNo, $this->pageSize)['lists'] ?? [];
if (empty($lists)) {
return $lists;
}
return UpgradeLogic::formatLists($lists, $this->pageNo);
}
/**
* @notes 查看系统更新列表总数
* @return int
* @author 段誉
* @date 2021/8/14 17:15
*/
public function count(): int
{
$result = UpgradeLogic::getRemoteVersion($this->limitOffset, $this->limitLength);
return $result['count'] ?? 0;
}
}

View File

@@ -0,0 +1,60 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权购买去版权授权后方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\adminapi\lists\shop;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\deposit\DepositPackage;
class DepositPackageLists extends BaseAdminDataLists
{
/**
* @notes 列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author ljj
* @date 2022/2/8 3:51 下午
*/
public function lists(): array
{
$lists = (new DepositPackage())
->order(['id'=>'desc'])
->where(['type'=>2])
->withoutField('update_time,delete_time')
->select()
->toArray();
return $lists;
}
/**
* @notes 服务分类数量
* @return int
* @author ljj
* @date 2022/2/8 3:51 下午
*/
public function count(): int
{
return (new DepositPackage())->count();
}
}

View File

@@ -0,0 +1,116 @@
<?php
namespace app\adminapi\lists\shop;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\enum\GoodsEnum;
use app\common\lists\ListsExtendInterface;
use app\common\model\goods\Goods;
use app\common\model\goods\GoodsCategory;
use app\common\model\shop\Shop;
/**
* 服务列表
* Class GoodsLists
* @package app\adminapi\lists\shop
*/
class GoodsLists extends BaseAdminDataLists implements ListsExtendInterface
{
public function setWhere()
{
$where = [];
$type = $this->params['type'] ?? 0;
switch ($type){
case '':
$where[] = ['audit_status','=',GoodsEnum::AUDIT_STATUS_WAIT];
break;
case 1:
$where[] = ['audit_status','=',GoodsEnum::AUDIT_STATUS_REFUSE];
break;
case 2:
$where[] = ['audit_status','=',GoodsEnum::AUDIT_STATUS_PASS];
$where[] = ['status','=',GoodsEnum::SHELVE];
break;
case 3:
$where[] = ['audit_status','=',GoodsEnum::AUDIT_STATUS_PASS];
$where[] = ['status','=',GoodsEnum::UNSHELVE];
break;
}
$where[] = ['shop_id','>',0];
if(isset($this->params['name']) && $this->params['name']){
$where[] = ['name','like','%'.$this->params['name'].'%'];
}
if (isset($this->params['second_id']) && $this->params['second_id']) {
$where[] = ['category_id','=',$this->params['second_id']];
}elseif (isset($this->params['first_id']) && $this->params['first_id']) {
$category_lists = GoodsCategory::select()->toArray();
$category_arr = [];
foreach ($category_lists as $item) {
$category_arr[$item['pid']][] = $item['id'];
}
$ids_arr = $category_arr[$this->params['first_id']] ?? '';
$ids = $this->params['first_id'];
if ($ids_arr) {
$ids = implode(',',$ids_arr).','.$this->params['first_id'];
}
$where[] = ['category_id','in',$ids];
}
if(isset($this->params['start_time']) && $this->params['start_time']){
$where[] = ['update_time','>',strtotime($this->params['start_time'])];
}
if(isset($this->params['end_time']) && $this->params['end_time']){
$where[] = ['update_time','<',strtotime($this->params['end_time'])];
}
return $where;
}
public function lists(): array
{
$lists = Goods::where($this->setWhere())
->field('id,shop_id,update_time,sort,name,image,audit_status,status,category_id,order_num,price')
->limit($this->limitOffset, $this->limitLength)
->append(['status_desc','audit_status_desc'])
->order('id desc')
->select()
->toArray();
$shopIds = array_column($lists,'shop_id');
$categoryIds = array_column($lists,'category_id');
$categoryLists = GoodsCategory::where(['id'=>$categoryIds])->column('name','id');
$shopLists = Shop::where(['id'=>$shopIds])->column('name','id');
foreach ($lists as $key => $goods){
$lists[$key]['category_name'] = $categoryLists[$goods['category_id']] ?? '';
$lists[$key]['shop_name'] = $shopLists[$goods['shop_id']] ?? '';
}
return $lists;
}
public function count(): int
{
return Goods::where($this->setWhere())->count();
}
public function extend()
{
$where = $this->setWhere();
unset($where[0]);
if(isset($where[1]) && 'status' == $where[1][0]){
unset($where[1]);
}
$where = array_values($where);
$waitCount = Goods::where($where)->where(['audit_status'=>GoodsEnum::AUDIT_STATUS_WAIT])->count();
$refuseCount = Goods::where($where)->where(['audit_status'=>GoodsEnum::AUDIT_STATUS_REFUSE])->count();
$unshelveCount = Goods::where($where)->where(['audit_status'=>GoodsEnum::AUDIT_STATUS_PASS,'status'=>GoodsEnum::UNSHELVE])->count();
$shelveCount = Goods::where($where)->where(['audit_status'=>GoodsEnum::AUDIT_STATUS_PASS,'status'=>GoodsEnum::SHELVE])->count();
return [
'wait_count' => $waitCount,
'refuse_count' => $refuseCount,
'shelve_count' => $shelveCount,
'unshelve_count' => $unshelveCount,
];
}
}

View File

@@ -0,0 +1,80 @@
<?php
namespace app\adminapi\lists\shop;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\enum\shop\ShopEnum;
use app\common\lists\ListsExtendInterface;
use app\common\model\shop\Shop;
/**
* 店铺申请列表
* Class ShopApplyLists
* @package app\adminapi\lists\shop
*/
class ShopApplyLists extends BaseAdminDataLists implements ListsExtendInterface
{
public function setWhere()
{
$where = [];
if(isset($this->params['status']) && '' != $this->params['status']){
$where[] = ['audit_status','=',$this->params['status']];
}
if(isset($this->params['keyword']) && $this->params['keyword']){
$where[] = ['sn|name','like','%'.$this->params['keyword'].'%'];
}
if(isset($this->params['legal_person']) && $this->params['legal_person']){
$where[] = ['legal_person','like','%'.$this->params['legal_person'].'%'];
}
if(isset($this->params['start_time']) && $this->params['start_time']){
$where[] = ['create_time','>=',$this->params['start_time']];
}
if(isset($this->params['end_time']) && $this->params['end_time']){
$where[] = ['create_time','<=',$this->params['end_time']];
}
return $where;
}
public function lists(): array
{
$lists = Shop::where($this->setWhere())
->withoutField('update_time,delete_time,longitude,latitude')
->withCount(['goods'])
->order('id desc')
->append(['audit_status_desc','region_desc','province_name','city_name','region_name'])
->limit($this->limitOffset, $this->limitLength)
->select()->toArray();
return $lists;
}
public function count(): int
{
return Shop::where($this->setWhere())->count();
}
public function extend()
{
$where = $this->setWhere();
if(isset($where[0]) && 'audit_status' == $where[0][0]){
unset($where[0]);
}
$allCount = Shop::where($where)
->count();
$waitCount = Shop::where($where)
->where(['audit_status'=>ShopEnum::AUDIT_STATUS_WAIT])
->count();
$passCount = Shop::where($where)
->where(['audit_status'=>ShopEnum::AUDIT_STATUS_PASS])
->count();
$refuseCount = Shop::where($where)
->where(['audit_status'=>ShopEnum::AUDIT_STATUS_REFUSE])
->count();
return [
'all_count' => $allCount,
'wait_count' => $waitCount,
'pass_count' => $passCount,
'refuse_count' => $refuseCount,
];
}
}

View File

@@ -0,0 +1,80 @@
<?php
namespace app\adminapi\lists\shop;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\enum\coach\CoachEnum;
use app\common\enum\shop\ShopEnum;
use app\common\model\coach\Coach;
use app\common\model\deposit\DepositPackage;
use app\common\model\order\Order;
use app\common\model\shop\Shop;
/**
* 店铺列表
* Class ShopLists
* @package app\adminapi\lists\shop
*/
class ShopLists extends BaseAdminDataLists
{
public function setWhere()
{
$where = [];
$where[] = ['audit_status','=',ShopEnum::AUDIT_STATUS_PASS];
if(isset($this->params['keyword']) && $this->params['keyword']){
$where[] = ['mobile|name','like','%'.$this->params['keyword'].'%'];
}
if(isset($this->params['legal_person']) && $this->params['legal_person']){
$where[] = ['legal_person|sn','like','%'.$this->params['legal_person'].'%'];
}
if(isset($this->params['server_status']) && $this->params['server_status']){
$where[] = ['server_status','=',$this->params['server_status']];
}
if(isset($this->params['type']) && $this->params['type']){
$where[] = ['type','=',$this->params['type']];
}
if(isset($this->params['start_time']) && $this->params['start_time']){
$where[] = ['create_time','>=',$this->params['start_time']];
}
if(isset($this->params['end_time']) && $this->params['end_time']){
$where[] = ['create_time','<=',$this->params['end_time']];
}
return $where;
}
public function lists(): array
{
$lists = Shop::where($this->setWhere())
->withCount(['coach'])
->withoutField('update_time,delete_time,longitude,latitude')
->append(['work_status_desc','server_status_desc'])
->order('id desc')
->limit($this->limitOffset, $this->limitLength)
->select()->toArray();
$ids = array_column($lists,'id');
$depositLists = DepositPackage::where(['type'=>2])->order('money desc')->select()->toArray();
$orderLists = Order::where(['shop_id'=>$ids])->field('count(id) as num,shop_id')->group('shop_id')->select()->toArray();
$orderLists = array_column($orderLists,null,'shop_id');
foreach ($lists as $key => $shop){
$depositPackage = [];
foreach ($depositLists as $deposit){
if($shop['deposit'] >= $deposit['money']){
$depositPackage = $deposit;
break;
}
}
$lists[$key]['take_info'] = [
'order_limit' => $depositPackage['order_limit'] ?? 0,
'total_take_order' => $orderLists[$shop['id']]['num'] ?? 0,
];
}
return $lists;
}
public function count(): int
{
return Shop::where($this->setWhere())->count();
}
}

View File

@@ -0,0 +1,84 @@
<?php
namespace app\adminapi\lists\shop;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\enum\coach\CoachEnum;
use app\common\enum\shop\ShopEnum;
use app\common\lists\ListsExtendInterface;
use app\common\model\shop\Shop;
use app\common\model\shop\ShopUpdate;
class UpdateShopLists extends BaseAdminDataLists implements ListsExtendInterface
{
public function setWhere()
{
$where = [];
if(isset($this->params['keyword']) && $this->params['keyword']){
$where[] = ['name|sn','like','%'.$this->params['keyword'].'%'];
}
if(isset($this->params['legal_keyword']) && $this->params['legal_keyword']){
$where[] = ['legal_person|mobile','like','%'.$this->params['legal_keyword'].'%'];
}
if(isset($this->params['start_time']) && $this->params['start_time']){
$where[] = ['create_time','>=',$this->params['start_time']];
}
if(isset($this->params['end_time']) && $this->params['end_time']){
$where[] = ['create_time','<=',$this->params['end_time']];
}
return $where;
}
public function lists(): array
{
$lists = ShopUpdate::where($this->setWhere())
->append(['region_desc','audit_status_desc'])
->withCount(['goods'])
->order('id desc')
->withoutField('update_time,delete_time')
->limit($this->limitOffset, $this->limitLength)
->select()
->toArray();
// $shopLists = Shop::where(['audit_status'=>ShopEnum::AUDIT_STATUS_PASS])->column('mobile','shop_id');
// foreach ($lists as $key => $shop){
// $lists[$key]['mobile'] = $shopLists['shop_id'] ?? '';
// }
return $lists;
}
/**
* @notes 统计人数
* @return int
* @author cjhao
* @date 2024/8/21 17:53
*/
public function count(): int
{
return ShopUpdate::where($this->setWhere())
->count();
}
public function extend()
{
// $allCount = ShopUpdate::where($this->setWhere())
// ->count();
// $waitCount = ShopUpdate::where($this->setWhere())
// ->where(['audit_status'=>CoachEnum::AUDIT_STATUS_WAIT])
// ->count();
// $passCount = ShopUpdate::where($this->setWhere())
// ->where(['audit_status'=>CoachEnum::AUDIT_STATUS_PASS])
// ->count();
// $refuseCount = ShopUpdate::where($this->setWhere())
// ->where($this->setWhere())
// ->where(['audit_status'=>CoachEnum::AUDIT_STATUS_REFUSE])
// ->count();
// return [
// 'all_count' => $allCount,
// 'wait_count' => $waitCount,
// 'pass_count' => $passCount,
// 'refuse_count' => $refuseCount,
// ];
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,85 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权购买去版权授权后方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\adminapi\lists\user;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\lists\ListsSearchInterface;
use app\common\model\user\User;
class UserLists extends BaseAdminDataLists
{
/**
* @notes 搜索条件
* @return array
* @author ljj
* @date 2022/2/7 6:27 下午
*/
public function where(): array
{
$where = [];
if (isset($this->params['user_info']) && $this->params['user_info'] != '') {
$where[] = ['nickname|mobile|sn|account','like','%'.$this->params['user_info'].'%'];
}
if (isset($this->params['start_time']) && $this->params['start_time'] != '') {
$where[] = ['create_time','>=',strtotime($this->params['start_time'])];
}
if (isset($this->params['end_time']) && $this->params['end_time'] != '') {
$where[] = ['create_time','<=',strtotime($this->params['end_time'])];
}
if (isset($this->params['register_source']) && $this->params['register_source'] != '') {
$where[] = ['channel','=',$this->params['register_source']];
}
return $where;
}
/**
* @notes 获取用户列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author ljj
* @date 2022/2/7 6:51 下午
*/
public function lists(): array
{
$lists = (new User())->field('id,sn,nickname,avatar,mobile,sex,create_time,channel as register_source,account')
->order('id', 'desc')
->where($this->where())
->append(['sex_desc','source_desc'])
->limit($this->limitOffset, $this->limitLength)
->select()
->toArray();
return $lists;
}
/**
* @notes 获取用户数量
* @return int
* @author ljj
* @date 2022/2/7 6:52 下午
*/
public function count(): int
{
return (new User())->where($this->where())->count();
}
}