作者 景龙
1 个管道 的构建 通过 耗费 2 秒

修改检索日期

... ... @@ -211,9 +211,11 @@ class CommonController extends RestBaseController
$startTime = isset($data['start_time'])&&!empty($data['start_time'])?$data['start_time']:'';
$endTime = isset($data['end_time'])&&!empty($data['end_time'])?$data['end_time']:'';
if (!empty($startTime)) {
$startTime = strtotime(date('Y-m-d',$startTime));
$query->where('c.ins_m_time', '>=', $startTime);
}
if (!empty($endTime)) {
$endTime = strtotime(date('Y-m-d',$endTime))+86400;
$query->where('c.ins_m_time', '<=', $endTime);
}
})
... ... @@ -242,9 +244,11 @@ class CommonController extends RestBaseController
$startTime = isset($data['start_time'])&&!empty($data['start_time'])?$data['start_time']:'';
$endTime = isset($data['end_time'])&&!empty($data['end_time'])?$data['end_time']:'';
if (!empty($startTime)) {
$startTime = strtotime(date('Y-m-d',$startTime));
$query->where('c.ins_m_time', '>=', $startTime);
}
if (!empty($endTime)) {
$endTime = strtotime(date('Y-m-d',$endTime));
$query->where('c.ins_m_time', '<=', $endTime);
}
})
... ... @@ -269,9 +273,11 @@ class CommonController extends RestBaseController
$startTime = isset($data['start_time'])&&!empty($data['start_time'])?$data['start_time']:'';
$endTime = isset($data['end_time'])&&!empty($data['end_time'])?$data['end_time']:'';
if (!empty($startTime)) {
$startTime = strtotime(date('Y-m-d'),$startTime);
$query->where('t.train_time', '>=', $startTime);
}
if (!empty($endTime)) {
$endTime = strtotime(date('Y-m-d'),$endTime)+86400;
$query->where('t.train_time', '<=', $endTime);
}
})
... ... @@ -300,9 +306,11 @@ class CommonController extends RestBaseController
$startTime = isset($data['start_time'])&&!empty($data['start_time'])?$data['start_time']:'';
$endTime = isset($data['end_time'])&&!empty($data['end_time'])?$data['end_time']:'';
if (!empty($startTime)) {
$startTime = strtotime(date('Y-m-d'),$startTime);
$query->where('t.train_time', '>=', $startTime);
}
if (!empty($endTime)) {
$endTime = strtotime(date('Y-m-d'),$endTime)+86400;
$query->where('t.train_time', '<=', $endTime);
}
})
... ... @@ -327,9 +335,11 @@ class CommonController extends RestBaseController
$startTime = isset($data['start_time'])&&!empty($data['start_time'])?$data['start_time']:'';
$endTime = isset($data['end_time'])&&!empty($data['end_time'])?$data['end_time']:'';
if (!empty($startTime)) {
$startTime = strtotime(date('Y-m-d'),$startTime);
$query->where('t.exercise_time', '>=', $startTime);
}
if (!empty($endTime)) {
$endTime = strtotime(date('Y-m-d'),$endTime)+86400;
$query->where('t.exercise_time', '<=', $endTime);
}
})
... ... @@ -358,9 +368,11 @@ class CommonController extends RestBaseController
$startTime = isset($data['start_time'])&&!empty($data['start_time'])?$data['start_time']:'';
$endTime = isset($data['end_time'])&&!empty($data['end_time'])?$data['end_time']:'';
if (!empty($startTime)) {
$startTime = strtotime(date('Y-m-d'),$startTime);
$query->where('t.exercise_time', '>=', $startTime);
}
if (!empty($endTime)) {
$endTime = strtotime(date('Y-m-d'),$endTime)+86400;
$query->where('t.exercise_time', '<=', $endTime);
}
})
... ... @@ -1043,7 +1055,7 @@ class CommonController extends RestBaseController
$query->where('i.create_time', '>=', $startTime);
}
if (!empty($endTime)) {
$endTime = strtotime(date('Y-m-d',$endTime));
$endTime = strtotime(date('Y-m-d',$endTime))+86400;
$query->where('i.create_time', '<=', $endTime);
}
})
... ... @@ -1076,7 +1088,7 @@ class CommonController extends RestBaseController
$query->where('i.create_time', '>=', $startTime);
}
if (!empty($endTime)) {
$endTime = strtotime(date('Y-m-d',$endTime));
$endTime = strtotime(date('Y-m-d',$endTime))+86400;
$query->where('i.create_time', '<=', $endTime);
}
})
... ... @@ -1107,7 +1119,7 @@ class CommonController extends RestBaseController
$query->where('t.test_time', '>=', $startTime);
}
if (!empty($endTime)) {
$endTime = strtotime(date('Y-m-d',$endTime));
$endTime = strtotime(date('Y-m-d',$endTime))+86400;
$query->where('t.test_time', '<=', $endTime);
}
})
... ... @@ -1138,7 +1150,7 @@ class CommonController extends RestBaseController
$query->where('t.test_time', '>=', $startTime);
}
if (!empty($endTime)) {
$endTime = strtotime(date('Y-m-d',$endTime));
$endTime = strtotime(date('Y-m-d',$endTime))+86400;
$query->where('t.test_time', '<=', $endTime);
}
})
... ... @@ -1294,7 +1306,7 @@ class CommonController extends RestBaseController
$query->where('c.ins_m_time', '>=', $startTime);
}
if (!empty($endTime)) {
$endTime = strtotime(date('Y-m-d',$endTime));
$endTime = strtotime(date('Y-m-d',$endTime))+86400;
$query->where('c.ins_m_time', '<=', $endTime);
}
})
... ... @@ -1338,7 +1350,7 @@ class CommonController extends RestBaseController
$query->where('c.ins_m_time', '>=', $startTime);
}
if (!empty($endTime)) {
$endTime = strtotime(date('Y-m-d',$endTime));
$endTime = strtotime(date('Y-m-d',$endTime))+86400;
$query->where('c.ins_m_time', '<=', $endTime);
}
})
... ... @@ -1382,7 +1394,7 @@ class CommonController extends RestBaseController
$query->where('r.create_time', '>=', $startTime);
}
if (!empty($endTime)) {
$endTime = strtotime(date('Y-m-d',$endTime));
$endTime = strtotime(date('Y-m-d',$endTime))+86400;
$query->where('r.create_time', '<=', $endTime);
}
})
... ... @@ -1429,7 +1441,7 @@ class CommonController extends RestBaseController
$query->where('r.create_time', '>=', $startTime);
}
if (!empty($endTime)) {
$endTime = strtotime(date('Y-m-d',$endTime));
$endTime = strtotime(date('Y-m-d',$endTime))+86400;
$query->where('r.create_time', '<=', $endTime);
}
})
... ... @@ -1476,7 +1488,7 @@ class CommonController extends RestBaseController
$query->where($train_time, '>=', $startTime);
}
if (!empty($endTime)) {
$endTime = strtotime(date('Y-m-d',$endTime));
$endTime = strtotime(date('Y-m-d',$endTime))+86400;
$query->where($train_time, '<=', $endTime);
}
})
... ... @@ -1525,7 +1537,7 @@ class CommonController extends RestBaseController
$query->where($train_time, '>=', $startTime);
}
if (!empty($endTime)) {
$endTime = strtotime(date('Y-m-d',$endTime));
$endTime = strtotime(date('Y-m-d',$endTime))+86400;
$query->where($train_time, '<=', $endTime);
}
})
... ...