multi-store/app/admin/lists/financial_transfers/FinancialTransfersLists.php

65 lines
1.6 KiB
PHP
Raw Normal View History

2024-06-14 13:54:37 +08:00
<?php
namespace app\admin\lists\financial_transfers;
use app\admin\lists\BaseAdminDataLists;
use app\common\model\financial_transfers\FinancialTransfers;
use app\common\lists\ListsSearchInterface;
/**
* FinancialTransfers列表
* Class FinancialTransfersLists
* @package app\admin\listsfinancial_transfers
*/
class FinancialTransfersLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author admin
* @date 2024/06/14 10:10
*/
public function setSearch(): array
{
return [
'=' => ['store_id', 'admin_id', 'uid', 'status', 'initiation_time', 'confirmation_time', 'mark', 'money', 'remark_time'],
];
}
/**
* @notes 获取列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author admin
* @date 2024/06/14 10:10
*/
public function lists(): array
{
return FinancialTransfers::with(['store','staff','admin'])->where($this->searchWhere)
// ->field(['id', 'store_id', 'admin_id', 'status', 'initiation_time', 'confirmation_time', 'mark', 'money', 'remark_time'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取数量
* @return int
* @author admin
* @date 2024/06/14 10:10
*/
public function count(): int
{
return FinancialTransfers::where($this->searchWhere)->count();
}
}