sandm 1 năm trước cách đây
mục cha
commit
ae9b28dc00
1 tập tin đã thay đổi với 7 bổ sung1 xóa
  1. 7 1
      server/api/modules/v1/controllers/SurveyController.php

+ 7 - 1
server/api/modules/v1/controllers/SurveyController.php

@@ -315,6 +315,12 @@ class SurveyController extends Controller {
             }
 		}
 
+
+        foreach($list as $k => $v){
+            $zclist = Policy::find()->where(['type' => Policy::TYPE_SURVEY])->andWhere(['like','cengci',"{$v['level']}"])->all();
+            $list[$k]['policy'] = $zclist;
+        }
+
         //去重复
 		$cengci = [];      
         foreach ($list as $value) {
@@ -334,7 +340,7 @@ class SurveyController extends Controller {
         if(!empty($cengci)){
             foreach ($cengci as $value) {
 
-		         $query->andWhere(new \yii\db\Expression('FIND_IN_SET("'.$value['level'].'", cengci)'));
+		         $query->orWhere(new \yii\db\Expression('FIND_IN_SET("'.$value['level'].'", cengci)'));
     		}
             $list = $query->all();
         }