first commit
This commit is contained in:
83
app/adminapi/lists/item/ItemCateLists.php
Normal file
83
app/adminapi/lists/item/ItemCateLists.php
Normal file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\lists\item;
|
||||
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\model\item\ItemCate;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
|
||||
|
||||
/**
|
||||
* 项目分类列表
|
||||
* Class ItemCateLists
|
||||
* @package app\adminapi\listsitem
|
||||
*/
|
||||
class ItemCateLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置搜索条件
|
||||
* @return \string[][]
|
||||
* @author likeadmin
|
||||
* @date 2024/01/16 13:23
|
||||
*/
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取项目分类列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author likeadmin
|
||||
* @date 2024/01/16 13:23
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
$itemCate = ItemCate::where($this->searchWhere)
|
||||
->field(['id', 'name', 'sort', 'is_show', 'langs'])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
foreach ($itemCate as $k => $v) {
|
||||
$itemCate[$k]['langs'] = json_decode($v['langs'], JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
|
||||
return $itemCate;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取项目分类数量
|
||||
* @return int
|
||||
* @author likeadmin
|
||||
* @date 2024/01/16 13:23
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return ItemCate::where($this->searchWhere)->count();
|
||||
}
|
||||
|
||||
}
|
||||
90
app/adminapi/lists/item/ItemLists.php
Normal file
90
app/adminapi/lists/item/ItemLists.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\lists\item;
|
||||
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\model\item\Item;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\service\FileService;
|
||||
|
||||
|
||||
/**
|
||||
* 项目列表
|
||||
* Class ItemLists
|
||||
* @package app\adminapi\listsitem
|
||||
*/
|
||||
class ItemLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置搜索条件
|
||||
* @return \string[][]
|
||||
* @author BD
|
||||
* @date 2024/01/16 13:23
|
||||
*/
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['type', 'is_show'],
|
||||
'%like%' => ['title'],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取项目列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author BD
|
||||
* @date 2024/01/16 13:23
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
$items = Item::where($this->searchWhere)
|
||||
->append(['vip_name'])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
foreach ($items as &$item) {
|
||||
$item['langs'] = json_decode($item['langs'], JSON_UNESCAPED_UNICODE);
|
||||
foreach ($item['langs'] as &$content_lang) {
|
||||
$content_lang['image'] = FileService::getFileUrl($content_lang['image']);
|
||||
$content_lang['content'] = get_file_domain($content_lang['content']);
|
||||
}
|
||||
}
|
||||
|
||||
return $items;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取项目数量
|
||||
* @return int
|
||||
* @author BD
|
||||
* @date 2024/01/16 13:23
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return Item::where($this->searchWhere)->count();
|
||||
}
|
||||
|
||||
}
|
||||
101
app/adminapi/lists/item/ItemRecordLists.php
Normal file
101
app/adminapi/lists/item/ItemRecordLists.php
Normal file
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
namespace app\adminapi\lists\item;
|
||||
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\model\item\ItemRecord;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
|
||||
|
||||
/**
|
||||
* 项目记录列表
|
||||
* Class ItemRecordLists
|
||||
* @package app\adminapi\listsitem
|
||||
*/
|
||||
class ItemRecordLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 设置搜索条件
|
||||
* @return \string[][]
|
||||
* @author bd
|
||||
* @date 2024/01/31 14:07
|
||||
*/
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['ir.sn', 'ir.contract_no', 'ir.type', 'ir.status'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 搜索条件
|
||||
* @author 段誉
|
||||
* @date 2023/2/24 16:08
|
||||
*/
|
||||
public function queryWhere()
|
||||
{
|
||||
$where = [];
|
||||
// 用户编号
|
||||
if (!empty($this->params['user_info'])) {
|
||||
$where[] = ['u.sn|u.account|u.mobile', '=', $this->params['user_info']];
|
||||
}
|
||||
|
||||
// 下单时间
|
||||
if (!empty($this->params['start_time_create']) && !empty($this->params['end_time_create'])) {
|
||||
$time = [strtotime($this->params['start_time_create']), strtotime($this->params['end_time_create'])];
|
||||
$where[] = ['ir.create_time', 'between', $time];
|
||||
}
|
||||
|
||||
// 到期时间
|
||||
if (!empty($this->params['start_time_end']) && !empty($this->params['end_time_end'])) {
|
||||
$time = [strtotime($this->params['start_time_end']), strtotime($this->params['end_time_end'])];
|
||||
$where[] = ['ir.create_time', 'between', $time];
|
||||
}
|
||||
|
||||
return $where;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取项目记录列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author BD
|
||||
* @date 2024/08/07 15:42
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
$field = 'ir.id,ir.sn,ir.contract_no,ir.user_id,ir.item_id,ir.item_title,ir.item_image,ir.item_langs,ir.money,ir.point,ir.rate,ir.cycle,ir.total_num,ir.wait_num,ir.total_income,ir.type,ir.status,ir.remark,ir.end_time,ir.create_time';
|
||||
$field .= ',u.account,u.sn as u_sn,u.mobile';
|
||||
return ItemRecord::alias('ir')
|
||||
->join('user u', 'u.id = ir.user_id')
|
||||
->field($field)
|
||||
->append(['team_top'])
|
||||
->where($this->queryWhere())
|
||||
->where($this->searchWhere)
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['ir.id' => 'desc'])
|
||||
->select()
|
||||
->toArray();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取项目记录数量
|
||||
* @return int
|
||||
* @author BD
|
||||
* @date 2024/08/07 15:42
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return ItemRecord::alias('ir')
|
||||
->join('user u', 'u.id = ir.user_id')
|
||||
->where($this->queryWhere())
|
||||
->where($this->searchWhere)
|
||||
->count();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user