Browse Source

修改代码

fuyu 6 năm trước cách đây
mục cha
commit
33c51cc85e
1 tập tin đã thay đổi với 21 bổ sung6 xóa
  1. 21 6
      application/inter/controller/Reciveremote.php

+ 21 - 6
application/inter/controller/Reciveremote.php

@@ -244,12 +244,27 @@ class Reciveremote extends Base
                             if(empty($v)){
                                 break;
                             }
-                            $queryWhere.= " and `e`.`exam_class` in ?";
-                            $ex = implode("', '", $v);
-                            $val = "('".$ex."')";
-                            // $where .= " and e.exam_class in ('".$ex."')";
-                            $options[] = $val;
-                            var_dump($val);
+                            $length = sizeof($v);
+                            if($length === 1) {
+                                $queryWhere.= " and `e`.`exam_class` = ?";
+                                $options[] = $v[0];
+                                break;
+                            }
+                            $index = 1;
+                            $queryWhere.= " and (`e`.`exam_class` = ?";
+                            $options[] = $v[0];
+                            while($index < $length) {
+                                $queryWhere.= " or `e`.`exam_class` = ?";
+                                $options[] = $v[$index];
+                                $index++;
+                            }
+                            $queryWhere.= ')';
+                            // $queryWhere.= " and `e`.`exam_class` in ?";
+                            // $ex = implode("or `e`.`exam_class` = ", $v);
+                            // $val = "('".$ex."')";
+                            // // $where .= " and e.exam_class in ('".$ex."')";
+                            // $options[] = $val;
+                            // var_dump($val);
                             break;
                         case 'name':
                             $queryWhere.= " and `pi`.`name` like ?";