Merge remote-tracking branch 'origin/master' into akun
正在显示
3 个修改的文件
包含
30 行增加
和
13 行删除
| @@ -77,6 +77,7 @@ class GeoQuestionRes extends Command | @@ -77,6 +77,7 @@ class GeoQuestionRes extends Command | ||
| 77 | $geoLogModel = new GeoQuestionLog(); | 77 | $geoLogModel = new GeoQuestionLog(); |
| 78 | foreach ($taskInfo['question'] as $question) { | 78 | foreach ($taskInfo['question'] as $question) { |
| 79 | $en_question = Translate::tran($question, 'zh') ?? ''; | 79 | $en_question = Translate::tran($question, 'zh') ?? ''; |
| 80 | + $this->output('项目ID:' . $taskInfo['project_id'] . ', 问题 开始:' . $question); | ||
| 80 | foreach ($platformsArr as $platform) { | 81 | foreach ($platformsArr as $platform) { |
| 81 | $data = $hit_data = []; | 82 | $data = $hit_data = []; |
| 82 | $error_num = 0; | 83 | $error_num = 0; |
| @@ -84,10 +85,10 @@ class GeoQuestionRes extends Command | @@ -84,10 +85,10 @@ class GeoQuestionRes extends Command | ||
| 84 | GET_RESULT: | 85 | GET_RESULT: |
| 85 | $error_num++; | 86 | $error_num++; |
| 86 | try { | 87 | try { |
| 87 | - $this->output('执行时间:'.date('Y-m-d H:i:s').'->执行次数:'.$error_num.',执行平台:'.$platform.'执行的项目id:'.$taskInfo['project_id'].PHP_EOL); | ||
| 88 | if ($error_num >= 3) { | 88 | if ($error_num >= 3) { |
| 89 | continue; | 89 | continue; |
| 90 | } | 90 | } |
| 91 | + $this->output('执行平台:' . $platform . '执行次数:' . $error_num); | ||
| 91 | switch ($platform){ | 92 | switch ($platform){ |
| 92 | case 'google_ai_overview': | 93 | case 'google_ai_overview': |
| 93 | // overview 数据结构不确定, 需要单独处理数据 | 94 | // overview 数据结构不确定, 需要单独处理数据 |
| @@ -42,18 +42,34 @@ class lyhDemo extends Command | @@ -42,18 +42,34 @@ class lyhDemo extends Command | ||
| 42 | protected $description = '更新路由'; | 42 | protected $description = '更新路由'; |
| 43 | 43 | ||
| 44 | public function handle(){ | 44 | public function handle(){ |
| 45 | - ProjectServer::useProject(3531); | ||
| 46 | - $newsModel = new News(); | ||
| 47 | - $rows = $newsModel->select('id', 'text')->get(); | ||
| 48 | - foreach ($rows as $row) { | ||
| 49 | - echo '执行数据id:'.$row->id.PHP_EOL; | ||
| 50 | - $newText = preg_replace('/<h1 class="t">.*?<\/h1>/is', '', $row->text); | ||
| 51 | - $newsModel->where('id', $row->id)->update(['text' => $newText]); | ||
| 52 | - } | ||
| 53 | - DB::disconnect('custom_mysql'); | ||
| 54 | - return true; | 45 | + return $this->_actionRoute(); |
| 55 | } | 46 | } |
| 56 | 47 | ||
| 48 | + /** | ||
| 49 | + * @remark :查看路由是否为空 | ||
| 50 | + * @name :_actionRoute | ||
| 51 | + * @author :lyh | ||
| 52 | + * @method :post | ||
| 53 | + * @time :2025/7/22 15:14 | ||
| 54 | + */ | ||
| 55 | + public function _actionRoute(){ | ||
| 56 | + $projectModel = new Project(); | ||
| 57 | + $lists = $projectModel->list(['delete_status' => 0,'project_type'=>0,'extend_type'=>0,'type'=>['in',[2,3,4,6]]], 'id', ['id']); | ||
| 58 | + $data = []; | ||
| 59 | + foreach ($lists as $item){ | ||
| 60 | + echo date('Y-m-d H:i:s') . '开始--项目的id:'. $item['id'] . PHP_EOL; | ||
| 61 | + ProjectServer::useProject($item['id']); | ||
| 62 | + $aiBlogModel = new AiBlog(); | ||
| 63 | + $info = $aiBlogModel->read(['route'=>null],['id']); | ||
| 64 | + if($info !== false){ | ||
| 65 | + echo '项目id:'.$item['id'].PHP_EOL; | ||
| 66 | + $data[] = $item['id']; | ||
| 67 | + } | ||
| 68 | + dd($data); | ||
| 69 | + echo 'end'; | ||
| 70 | + DB::disconnect('custom_mysql'); | ||
| 71 | + } | ||
| 72 | + } | ||
| 57 | 73 | ||
| 58 | public function _actionTemplateMain(){ | 74 | public function _actionTemplateMain(){ |
| 59 | $data = []; | 75 | $data = []; |
| @@ -25,7 +25,7 @@ class NewsRequest extends FormRequest | @@ -25,7 +25,7 @@ class NewsRequest extends FormRequest | ||
| 25 | { | 25 | { |
| 26 | return [ | 26 | return [ |
| 27 | 'name'=>'required|max:200', | 27 | 'name'=>'required|max:200', |
| 28 | - 'remark'=>'max:2000', | 28 | +// 'remark'=>'max:2000', |
| 29 | 'url'=>'required', | 29 | 'url'=>'required', |
| 30 | ]; | 30 | ]; |
| 31 | } | 31 | } |
| @@ -36,7 +36,7 @@ class NewsRequest extends FormRequest | @@ -36,7 +36,7 @@ class NewsRequest extends FormRequest | ||
| 36 | 'name.required'=>'请填写名称', | 36 | 'name.required'=>'请填写名称', |
| 37 | 'name.max'=>'名称超过最长长度200', | 37 | 'name.max'=>'名称超过最长长度200', |
| 38 | 'url.required'=>'链接不能为空', | 38 | 'url.required'=>'链接不能为空', |
| 39 | - 'remark.max'=>'描述超过最长长度2000' | 39 | +// 'remark.max'=>'描述超过最长长度2000' |
| 40 | ]; | 40 | ]; |
| 41 | } | 41 | } |
| 42 | } | 42 | } |
-
请 注册 或 登录 后发表评论