63 lines
1.3 KiB
PHP
63 lines
1.3 KiB
PHP
<?php
|
|
|
|
|
|
namespace app\common\lists\user;
|
|
|
|
|
|
use app\admin\lists\BaseAdminDataLists;
|
|
use app\common\model\user\UserShip;
|
|
|
|
/**
|
|
* 会员类型
|
|
*/
|
|
class UserShipLists extends BaseAdminDataLists
|
|
{
|
|
/**
|
|
* @notes 搜索条件
|
|
* @return array
|
|
* @author 乔峰
|
|
* @date 2022/9/22 15:50
|
|
*/
|
|
public function setSearch(): array
|
|
{
|
|
return [
|
|
];
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 获会员类型列表
|
|
* @return array
|
|
* @throws \think\db\exception\DataNotFoundException
|
|
* @throws \think\db\exception\DbException
|
|
* @throws \think\db\exception\ModelNotFoundException
|
|
* @author 乔峰
|
|
* @date 2022/9/22 15:50
|
|
*/
|
|
public function lists(): array
|
|
{
|
|
|
|
$field = "id,title";
|
|
$arr[]=['id'=>0,'title'=>'一般用户'];
|
|
|
|
$lists = UserShip::where($this->searchWhere)
|
|
->limit($this->limitOffset, $this->limitLength)
|
|
->field($field)
|
|
->order('sort desc')
|
|
->select()
|
|
->toArray();
|
|
return array_merge($arr,$lists);
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 获取数量
|
|
* @return int
|
|
* @author 乔峰
|
|
* @date 2022/9/22 15:51
|
|
*/
|
|
public function count(): int
|
|
{
|
|
return UserShip::where($this->searchWhere)->count();
|
|
}
|
|
} |