feature: task
This commit is contained in:
parent
a3629141d3
commit
0bd41bfb0f
|
|
@ -51,15 +51,47 @@ class Task extends Backend
|
|||
}
|
||||
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
||||
|
||||
$dateTime = date('Y-m-d');
|
||||
foreach ($where as $k => $item) {
|
||||
if ($item[0] != 'task.status') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (in_array($item[2], [1, 4])) {
|
||||
$where[] = ['expire_end_time', '<=', $dateTime];
|
||||
}
|
||||
|
||||
if ($item[2] == 2) {
|
||||
$where[$k][2] = 4;
|
||||
$where[] = ['expire_end_time', '>', $dateTime];
|
||||
}
|
||||
|
||||
if ($item[2] == 6) {
|
||||
$where[$k][2] = 1;
|
||||
$where[] = ['expire_end_time', '>', $dateTime];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
$list = $this->model
|
||||
->with(['admin'])
|
||||
->where($where)
|
||||
->order($sort, $order)
|
||||
->paginate($limit);
|
||||
|
||||
foreach ($list as $row) {
|
||||
|
||||
|
||||
foreach ($list as $k => $row) {
|
||||
|
||||
if (strtotime($row['expire_end_time']) > time()) {
|
||||
if ($row['status'] == 1) {
|
||||
$list[$k]['status'] = 6;
|
||||
}
|
||||
|
||||
if ($row['status'] == 4) {
|
||||
$row[$k]['status'] = 2;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$result = array("total" => $list->total(), "rows" => $list->items());
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user