64 lines
1.3 KiB
PHP
64 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace app\admin\lists\config;
|
|
|
|
|
|
use app\admin\lists\BaseAdminDataLists;
|
|
use app\common\model\app_update\AppUpdate;
|
|
use app\common\lists\ListsSearchInterface;
|
|
use app\common\model\Config;
|
|
|
|
/**
|
|
* 配置列表
|
|
* Class ConfigLists
|
|
* @package app\admin\lists\config
|
|
*/
|
|
class ConfigLists extends BaseAdminDataLists implements ListsSearchInterface
|
|
{
|
|
|
|
|
|
/**
|
|
* @notes 设置搜索条件
|
|
* @return \string[][]
|
|
* @author likeadmin
|
|
* @date 2024/05/30 10:25
|
|
*/
|
|
public function setSearch(): array
|
|
{
|
|
return [
|
|
'=' => ['name', 'type'],
|
|
];
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 获取配置列表
|
|
* @return array
|
|
* @throws \think\db\exception\DataNotFoundException
|
|
* @throws \think\db\exception\DbException
|
|
* @throws \think\db\exception\ModelNotFoundException
|
|
* @author likeadmin
|
|
* @date 2024/05/30 10:25
|
|
*/
|
|
public function lists(): array
|
|
{
|
|
return Config::where($this->searchWhere)
|
|
->limit($this->limitOffset, $this->limitLength)
|
|
->order(['id' => 'desc'])
|
|
->select()
|
|
->toArray();
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 获取配置数量
|
|
* @return int
|
|
* @author likeadmin
|
|
* @date 2024/05/30 10:25
|
|
*/
|
|
public function count(): int
|
|
{
|
|
return AppUpdate::where($this->searchWhere)->count();
|
|
}
|
|
|
|
} |