This commit is contained in:
weiz 2024-03-29 10:56:46 +08:00
parent 455b79a6c1
commit 25cca8730b

View File

@ -56,7 +56,13 @@
*/
public function lists(): array
{
return FinancialBorrowMoney::where($this->searchWhere)
$params = $this->request->get();
$where = [];
if (!empty($params['create_time'])) {
$date = explode(',', $params['create_time']);
$where[] = ['create_time', 'between', [strtotime($date[0] . ' 00:00:00'), strtotime($date[1] . ' 23:59:59')]];
}
return FinancialBorrowMoney::where($this->searchWhere)->where($where)
->field(['id', 'code', 'dept', 'cost_type', 'pay_type', 'amount', 'content', 'create_user', 'create_time'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
@ -78,7 +84,13 @@
*/
public function count(): int
{
return FinancialBorrowMoney::where($this->searchWhere)->count();
$params = $this->request->get();
$where = [];
if (!empty($params['create_time'])) {
$date = explode(',', $params['create_time']);
$where[] = ['create_time', 'between', [strtotime($date[0] . ' 00:00:00'), strtotime($date[1] . ' 23:59:59')]];
}
return FinancialBorrowMoney::where($this->searchWhere)->where($where)->count();
}
}