$src = json_decode(file_get_contents(storage_path('app/_needsrev65.json')), true); $ids = array_map(fn($r)=>$r['id'], $src); $rows = DB::table('questions')->whereIn('id',$ids)->get(['id','qa_status','question']); $byqa=[]; $half=0; $halfIds=[]; foreach ($rows as $r) { $byqa[$r->qa_status] = ($byqa[$r->qa_status] ?? 0) + 1; if (strpos((string)$r->question,'frac{1}{2}')!==false) { $half++; $halfIds[]=$r->id; } } echo "total=".$rows->count()."\n"; foreach ($byqa as $k=>$v) echo "$k=$v\n"; echo "still_contains_frac{1}{2}=$half ids=[".implode(',',$halfIds)."]\n";