作者 lyh

GX生成白帽报表脚本

... ... @@ -66,12 +66,17 @@ class GeoQuestionRes extends Command
echo '执行数据详情:'.$q_item.'/'.$p_item.PHP_EOL;
$keywords = [];//命中的关键词
$urls = [];//命中的网址
try {
$result_data = $geoService->setWebSearchChatAction($q_item,$p_item);
echo 'success:'.$result_data['code'].PHP_EOL;
if(isset($result_data) && $result_data['code'] == 200){
$keywords = $this->getKeywords($keywordArr,$result_data['text'] ?? []);
$urls = $this->getUrl($urlArr,$result_data['annotations'] ?? []);
}
}catch (\Exception $e){
echo $e->getMessage().PHP_EOL;
continue;
}
//保存一条结果记录
$data = [
'project_id'=>$info['project_id'],
... ...
... ... @@ -33,11 +33,11 @@ class GeoPlatform extends Base
* @time :2025/7/3 11:18
*/
public function getList(){
$data = Cache::get('geo_platform');
if(empty($data)){
// $data = Cache::get('geo_platform');
// if(empty($data)){
$data = $this->list(['status'=>$this::STATUS_ON],'id',['name','en_name','icon','sort'],'desc');
Cache::put('geo_platform',$data,'12 * 3600');
}
// }
return $data;
}
}
... ...