diff --git a/app/adminapi/lists/financial/FinancialBorrowMoneyLists.php b/app/adminapi/lists/financial/FinancialBorrowMoneyLists.php index c6711c36f..48fb5a443 100644 --- a/app/adminapi/lists/financial/FinancialBorrowMoneyLists.php +++ b/app/adminapi/lists/financial/FinancialBorrowMoneyLists.php @@ -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(); } } \ No newline at end of file