|
|
@@ -227,8 +227,18 @@ class NewPc extends BaseController
|
|
|
try {
|
|
|
$page = request()->input('page', 1);
|
|
|
$limit = request()->input('limit', 10);
|
|
|
- $res['total'] = PcIssue::count();
|
|
|
- $res['data'] = PcIssue::forPage($page, $limit)
|
|
|
+ $where = [];
|
|
|
+ $start_time = request()->input('start_time', '');
|
|
|
+ $end_time = request()->input('end_time', '');
|
|
|
+ $where = [];
|
|
|
+ if (!empty($start_time)) {
|
|
|
+ $where[] = ['end_time', '>=', $start_time.' 00:00:00'];
|
|
|
+ }
|
|
|
+ if (!empty($end_time)) {
|
|
|
+ $where[] = ['end_time', '<=', $end_time.' 23:59:59'];
|
|
|
+ }
|
|
|
+ $res['total'] = PcIssue::where($where)->count();
|
|
|
+ $res['data'] = PcIssue::where($where)->forPage($page, $limit)
|
|
|
->orderByDesc('id')->get();
|
|
|
foreach ($res['data'] as &$item) {
|
|
|
$item['day'] = date("m-d H:i", strtotime($item['end_time']));
|