作者 lyh

变更数据

... ... @@ -11,6 +11,7 @@ namespace App\Console\Commands\Geo;
use App\Models\Geo\GeoQuestionLog;
use App\Models\Geo\GeoQuestionResult;
use App\Models\Project\Project;
use Illuminate\Console\Command;
use Illuminate\Support\Carbon;
use App\Models\Geo\GeoCount as GeoCountModel;
... ... @@ -61,18 +62,24 @@ class GeoCount extends Command
if(empty($project_id)){
return true;
}
$projectModel = new Project();
$geo_qualify_day = $projectModel->getValue(['id'=>$project_id],['geo_qualify_day']);
$geoQuestionResModel = new GeoQuestionResult();
$platforms = ['gemini','openai','deepseek','poe','perplexity','google_ai_overview','openai-not-network','claude'];
foreach ($project_id as $item){
$this->output('执行的项目ID----'.$item);
//收录总数
$total = $geoQuestionResModel->counts(['project_id' => $item,'hit'=>['!=',0],'created_at' => ['between',[$start,$end]]]);
if($total > $geo_qualify_day){
$is_qualify = 1;
}
$data = [
'project_id' => $item,
'date' => $date,
'created_at' => Carbon::now()->format('Y-m-d H:i:s'),
'updated_at' => Carbon::now()->format('Y-m-d H:i:s'),
'total'=>$total,//收录总数
'is_qualify'=>$is_qualify,
];
foreach ($platforms as $platform){
if($platform == 'openai-not-network'){
... ...
... ... @@ -11,6 +11,7 @@ namespace App\Console\Commands\Geo;
use App\Models\Geo\GeoQuestionLog;
use App\Models\Geo\GeoQuestionResult;
use App\Models\Project\Project;
use Illuminate\Console\Command;
use Illuminate\Support\Carbon;
use App\Models\Geo\GeoCount as GeoCountModel;
... ... @@ -65,18 +66,24 @@ class GeoCountAll extends Command
if(empty($project_id)){
return true;
}
$projectModel = new Project();
$geo_qualify_day = $projectModel->getValue(['id'=>$project_id],['geo_qualify_day']);
$geoQuestionResModel = new GeoQuestionLog();
$platforms = ['gemini','openai','deepseek','poe','perplexity','google_ai_overview','openai-not-network','claude'];
foreach ($project_id as $item){
$this->output('执行的项目ID----'.$item);
//收录总数
$total = $geoQuestionResModel->counts(['project_id' => $item,'hit'=>['!=',0],'created_at' => ['between',[$start,$end]]]);
if($total > $geo_qualify_day){
$is_qualify = 1;
}
$data = [
'project_id' => $item,
'date' => $date,
'created_at' => Carbon::now()->format('Y-m-d H:i:s'),
'updated_at' => Carbon::now()->format('Y-m-d H:i:s'),
'total'=>$total,//收录总数
'is_qualify'=>$is_qualify,
];
foreach ($platforms as $platform){
if($platform == 'openai-not-network'){
... ...
... ... @@ -123,10 +123,6 @@ class ProjectLogic extends BaseLogic
$info['collect_test_domain'] = $info['is_upgrade'] ? CollectLog::getCollectTestDomain($id) : '';
//获取项目所属行业
$info['deploy_optimize']['industry'] = ProjectIndustryRelated::where('project_id', $id)->pluck('industry_id')->toArray();
$questionModel = new GeoQuestionResult();
$info['question_qualify_count'] = $questionModel->where('project_id', $id)
->where('hit','!=',0)->whereIn('platform',['openai', 'gemini','google_ai_overview'])
->count();
return $this->success($info);
}
... ...
... ... @@ -101,6 +101,7 @@ class CountLogic extends BaseLogic
* @time :2023/5/24 14:03
*/
public function keyword_data_count(){
$version = $this->project['version'] ?? '';
$yesterday = date('Y-m-d');
$rankDataModel = new RankDataModel();
$param = [
... ...