TaskSystem/app/adminapi/lists/finance/WithdrawLists.php
2023-09-11 11:58:26 +08:00

70 lines
1.4 KiB
PHP

<?php
namespace app\adminapi\lists\finance;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\lists\ListsSearchInterface;
use app\common\model\user\Withdraw;
class WithdrawLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 搜索条件
* @return array
* @author 段誉
* @date 2023/2/24 15:26
*/
public function setSearch(): array
{
return [
'=' => ['order_sn','user_id', 'amount', 'status'],
];
}
/**
* @notes 搜索条件
* @author 段誉
* @date 2023/2/24 15:26
*/
public function queryWhere()
{
$where = [];
// 用户余额
return $where;
}
/**
* @notes 获取列表
* @return array
* @author 段誉
* @date 2023/2/24 15:31
*/
public function lists(): array
{
$lists = Withdraw::where($this->searchWhere)
->where($this->queryWhere())
->order('id', 'desc')
->limit($this->limitOffset, $this->limitLength)
->select()
->toArray();
return $lists;
}
/**
* @notes 获取数量
* @return int
* @author 段誉
* @date 2023/2/24 15:36
*/
public function count(): int
{
return Withdraw::where($this->queryWhere())
->where($this->searchWhere)
->count();
}
}