77 lines
1.9 KiB
PHP
77 lines
1.9 KiB
PHP
<?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','create_time'],
|
|
'between_time' => 'create_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
|
|
{
|
|
$data = FinancialTransfers::with(['store','staff','admin'])->where($this->searchWhere)
|
|
->limit($this->limitOffset, $this->limitLength)
|
|
->order(['id' => 'desc'])
|
|
->select()
|
|
->toArray();
|
|
foreach ($data as &$value){
|
|
if($value['initiation_time']){
|
|
$value['initiation_time'] = date('Y-m-d H:i:s',$value['initiation_time']);
|
|
}
|
|
|
|
if($value['confirmation_time']){
|
|
$value['confirmation_time'] = date('Y-m-d H:i:s',$value['confirmation_time']);
|
|
|
|
}
|
|
|
|
}
|
|
return $data;
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 获取数量
|
|
* @return int
|
|
* @author admin
|
|
* @date 2024/06/14 10:10
|
|
*/
|
|
public function count(): int
|
|
{
|
|
return FinancialTransfers::where($this->searchWhere)->count();
|
|
}
|
|
|
|
} |