|
@@ -31,38 +31,50 @@ class Counts extends Base {
|
|
|
$params = $request->param();
|
|
|
$where = [];
|
|
|
$where[] = ' e.film_type=2';
|
|
|
+ $datetime = 1;
|
|
|
+ if(isset($params['upload1']) && ($params['upload1'] == $params['upload2']) && !empty($params['upload1'])){
|
|
|
+ $where[] = ' s.createdAt > \''.$params['upload1'].' 00:00:00\' ';
|
|
|
+ $where[] = ' s.createdAt < \''.$params['upload2'].' 23:59:59\' ';
|
|
|
+ $datetimme = 2;
|
|
|
+ }
|
|
|
+ $examtime = 1;
|
|
|
+ if(isset($params['exam1']) && ($params['exam1'] == $params['exam2']) && !empty($params['exam1'])){
|
|
|
+ $exam1 = str_replace('-', '', $params['exam1']);
|
|
|
+ $where[] = ' s.studydate = \''.$exam1.'\' ';
|
|
|
+ $examtime = 2;
|
|
|
+ }
|
|
|
foreach ($params as $k=>$v) {
|
|
|
+ if(empty($v)){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
switch($k){
|
|
|
case 'upload1':
|
|
|
- if($params['upload1'] == null){
|
|
|
- continue 2;
|
|
|
+ if($datetime == 2){
|
|
|
+ break;
|
|
|
}
|
|
|
$where[] = ' s.createdAt > \''.$params['upload1'].'\' ';
|
|
|
break;
|
|
|
case 'upload2':
|
|
|
- if($params['upload2'] == null){
|
|
|
- continue 2;
|
|
|
+ if($datetime == 2){
|
|
|
+ break;
|
|
|
}
|
|
|
$where[] = ' s.createdAt < \''.$params['upload2'].'\' ';
|
|
|
break;
|
|
|
case 'exam1':
|
|
|
- if($params['exam1'] == null){
|
|
|
- continue 2;
|
|
|
+ if($examtime == 2){
|
|
|
+ break;
|
|
|
}
|
|
|
$exam1 = str_replace('-', '', $params['exam1']);
|
|
|
$where[] = ' s.studydate > \''.$exam1.'\' ';
|
|
|
break;
|
|
|
case 'exam2':
|
|
|
- if($params['exam2'] == null){
|
|
|
- continue 2;
|
|
|
+ if($examtime == 2){
|
|
|
+ break;
|
|
|
}
|
|
|
$exam2 = str_replace('-', '', $params['exam2']);
|
|
|
$where[] = ' s.studydate < \''.$exam2.'\' ';
|
|
|
break;
|
|
|
case 'exam_class':
|
|
|
- if($params['exam_class'] == null){
|
|
|
- continue 2;
|
|
|
- }
|
|
|
$where[] = 's.modality=\''.$params['exam_class'].'\' ';
|
|
|
break;
|
|
|
}
|
|
@@ -128,22 +140,46 @@ class Counts extends Base {
|
|
|
$institution_where['s.institution_id'] = ['in',$institution];
|
|
|
}
|
|
|
$where[] = ' e.film_type=2';
|
|
|
+ $datetime = 1;
|
|
|
+ if(($params['upload_datetime1'] == $params['upload_datetime2']) && !empty($params['upload_datetime1'])){
|
|
|
+ $where[] = ' s.createdAt > \''.$params['upload_datetime1'].' 00:00:00\' ';
|
|
|
+ $where[] = ' s.createdAt < \''.$params['upload_datetime2'].' 23:59:59\' ';
|
|
|
+ $datetime = 2;
|
|
|
+ }
|
|
|
+ $examtime = 1;
|
|
|
+ if(($params['exam_datetime1'] == $params['exam_datetime1']) && !empty($params['exam_datetime1'])){
|
|
|
+ $exam1 = str_replace('-', '', $params['exam_datetime1']);
|
|
|
+ $where[] = ' s.studydate = \''.$exam1.'\' ';
|
|
|
+ $examtime = 2;
|
|
|
+ }
|
|
|
foreach ($params as $k=>$v) {
|
|
|
if(empty($v)){
|
|
|
continue;
|
|
|
}
|
|
|
switch($k){
|
|
|
case 'upload_datetime1':
|
|
|
+ if($datetime == 2){
|
|
|
+ break;
|
|
|
+ }
|
|
|
$where[] = ' s.createdAt > \''.$params['upload_datetime1'].'\' ';
|
|
|
break;
|
|
|
case 'upload_datetime2':
|
|
|
+ if($datetime == 2){
|
|
|
+ break;
|
|
|
+ }
|
|
|
$where[] = ' s.createdAt < \''.$params['upload_datetime2'].'\' ';
|
|
|
break;
|
|
|
case 'exam_datetime1':
|
|
|
+ if($examtime == 2){
|
|
|
+ break;
|
|
|
+ }
|
|
|
$exam1 = str_replace('-', '', $params['exam_datetime1']);
|
|
|
$where[] = ' s.studydate > \''.$exam1.'\' ';
|
|
|
break;
|
|
|
case 'exam_datetime2':
|
|
|
+ if($examtime == 2){
|
|
|
+ break;
|
|
|
+ }
|
|
|
$exam2 = str_replace('-', '', $params['exam_datetime2']);
|
|
|
$where[] = ' s.studydate < \''.$exam2.'\' ';
|
|
|
break;
|