update
This commit is contained in:
parent
628d35f789
commit
730bc1c318
@ -12,67 +12,67 @@
|
|||||||
// | author: likeadminTeam
|
// | author: likeadminTeam
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
namespace app\adminapi\lists\material;
|
namespace app\adminapi\lists\material;
|
||||||
|
|
||||||
|
|
||||||
use app\adminapi\lists\BaseAdminDataLists;
|
use app\adminapi\lists\BaseAdminDataLists;
|
||||||
use app\common\model\material\MaterialClassify;
|
use app\common\lists\ListsSearchInterface;
|
||||||
use app\common\lists\ListsSearchInterface;
|
use app\common\model\material\MaterialClassify;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 材料分类列表
|
* 材料分类列表
|
||||||
* Class MaterialClassifyLists
|
* Class MaterialClassifyLists
|
||||||
* @package app\adminapi\listsmaterial
|
* @package app\adminapi\listsmaterial
|
||||||
*/
|
*/
|
||||||
class MaterialClassifyLists extends BaseAdminDataLists implements ListsSearchInterface
|
class MaterialClassifyLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @notes 设置搜索条件
|
* @notes 设置搜索条件
|
||||||
* @return \string[][]
|
* @return \string[][]
|
||||||
* @author likeadmin
|
* @author likeadmin
|
||||||
* @date 2024/01/04 09:47
|
* @date 2024/01/04 09:47
|
||||||
*/
|
*/
|
||||||
public function setSearch(): array
|
public function setSearch(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'%like%' => ['name'],
|
'%like%' => ['name'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @notes 获取材料分类列表
|
* @notes 获取材料分类列表
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \think\db\exception\DataNotFoundException
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
* @throws \think\db\exception\DbException
|
* @throws \think\db\exception\DbException
|
||||||
* @throws \think\db\exception\ModelNotFoundException
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
* @author likeadmin
|
* @author likeadmin
|
||||||
* @date 2024/01/04 09:47
|
* @date 2024/01/04 09:47
|
||||||
*/
|
*/
|
||||||
public function lists(): array
|
public function lists(): array
|
||||||
{
|
{
|
||||||
$data = MaterialClassify::where($this->searchWhere)
|
$data = MaterialClassify::where($this->searchWhere)
|
||||||
->field(['id', 'pid', 'name'])
|
->field(['id', 'pid', 'name'])
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
// ->limit($this->limitOffset, $this->limitLength)
|
||||||
->order(['id' => 'asc'])
|
->order(['id' => 'asc'])
|
||||||
->select()
|
->select()
|
||||||
->toArray();
|
->toArray();
|
||||||
return buildTree($data,'pid');
|
return buildTree($data, 'pid');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @notes 获取材料分类数量
|
* @notes 获取材料分类数量
|
||||||
* @return int
|
* @return int
|
||||||
* @author likeadmin
|
* @author likeadmin
|
||||||
* @date 2024/01/04 09:47
|
* @date 2024/01/04 09:47
|
||||||
*/
|
*/
|
||||||
public function count(): int
|
public function count(): int
|
||||||
{
|
{
|
||||||
return MaterialClassify::where($this->searchWhere)->count();
|
return MaterialClassify::where($this->searchWhere)->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user