作者 刘锟

update

@@ -144,19 +144,26 @@ class GeoQuestionLogic extends BaseLogic @@ -144,19 +144,26 @@ class GeoQuestionLogic extends BaseLogic
144 * @date 2025/11/25 16:44 144 * @date 2025/11/25 16:44
145 */ 145 */
146 public function getUnHitQuestionList(){ 146 public function getUnHitQuestionList(){
147 - $data = GeoQuestionResult::where('project_id',$this->param['project_id'])->where('hit',0)->pluck('platform','question')->toArray(); 147 + $data = GeoQuestionResult::where('project_id',$this->param['project_id'])->where('hit',0)->select('platform','question')->get()->toArray();
148 $list = []; 148 $list = [];
149 if(!empty($data)){ 149 if(!empty($data)){
  150 + $temp = [];
150 $question_list = []; 151 $question_list = [];
151 - foreach ($data as $key => $item){  
152 - if(in_array($key,$question_list)){  
153 - array_push($list[$key],$item); 152 + foreach ($data as $item){
  153 + if(in_array($item['question'],$question_list)){
  154 + array_push($temp[$item['question']],$item['platform']);
154 }else{ 155 }else{
155 - $list[$key] = $item;  
156 - $question_list[] = $key; 156 + $temp[$item['question']][] = $item['platform'];
  157 + $question_list[] = $item['question'];
  158 + }
  159 + }
  160 +
  161 + if(!empty($temp)){
  162 + foreach ($temp as $kt=>$vt){
  163 + $list[] = ['question'=>$kt,'platform'=>$vt];
157 } 164 }
158 } 165 }
159 } 166 }
160 - return $this->success($data); 167 + return $this->success($list);
161 } 168 }
162 } 169 }