|
@@ -23,6 +23,7 @@ use App\Models\Project\Project; |
|
@@ -23,6 +23,7 @@ use App\Models\Project\Project; |
|
23
|
use App\Models\Project\ProjectAiSetting;
|
23
|
use App\Models\Project\ProjectAiSetting;
|
|
24
|
use App\Models\Project\ProjectWhiteHatAffix;
|
24
|
use App\Models\Project\ProjectWhiteHatAffix;
|
|
25
|
use App\Models\RouteMap\RouteMap;
|
25
|
use App\Models\RouteMap\RouteMap;
|
|
|
|
26
|
+use App\Models\SeoSetting\LinkData;
|
|
26
|
use App\Models\Template\BTemplateMain;
|
27
|
use App\Models\Template\BTemplateMain;
|
|
27
|
use App\Models\Template\TemplateTypeMain;
|
28
|
use App\Models\Template\TemplateTypeMain;
|
|
28
|
use App\Models\WebSetting\Translate;
|
29
|
use App\Models\WebSetting\Translate;
|
|
@@ -115,13 +116,23 @@ class lyhDemo extends Command |
|
@@ -115,13 +116,23 @@ class lyhDemo extends Command |
|
115
|
public function _actionRoute(){
|
116
|
public function _actionRoute(){
|
|
116
|
$projectModel = new Project();
|
117
|
$projectModel = new Project();
|
|
117
|
$lists = $projectModel->list(['type'=>['in',[1,2,3,4,6]]], 'id', ['id']);
|
118
|
$lists = $projectModel->list(['type'=>['in',[1,2,3,4,6]]], 'id', ['id']);
|
|
118
|
- $data = [];
|
119
|
+ $geoLinkModel = new GeoLink();
|
|
119
|
foreach ($lists as $item){
|
120
|
foreach ($lists as $item){
|
|
120
|
echo date('Y-m-d H:i:s') . '开始--项目的id:'. $item['id'] . PHP_EOL;
|
121
|
echo date('Y-m-d H:i:s') . '开始--项目的id:'. $item['id'] . PHP_EOL;
|
|
121
|
- $letters = range('A', 'X'); // 只取前 24 个字母(A ~ X)
|
|
|
|
122
|
- $randomLetter = $letters[array_rand($letters)];
|
|
|
|
123
|
- $data['post_id'] = $randomLetter.mt_rand(100000, 999999).$item['id'];
|
|
|
|
124
|
- $projectModel->edit(['post_id'=>$data['post_id']],['id'=>$item['id']]);
|
122
|
+ ProjectServer::useProject($item['project_id']);
|
|
|
|
123
|
+ $linkDataModel = new LinkData();
|
|
|
|
124
|
+ $linkList = $linkDataModel->list();
|
|
|
|
125
|
+ foreach ($linkList as $link){
|
|
|
|
126
|
+ $geoLinkModel->add([
|
|
|
|
127
|
+ 'project_id'=>$item['id'],
|
|
|
|
128
|
+ 'url'=>$link['url'],
|
|
|
|
129
|
+ 'type'=>2,
|
|
|
|
130
|
+ 'da'=>$link['da_values'],
|
|
|
|
131
|
+ 'send_time'=>$link['send_time'],
|
|
|
|
132
|
+ 'time'=>$link['time'],
|
|
|
|
133
|
+ ]);
|
|
|
|
134
|
+ }
|
|
|
|
135
|
+ DB::disconnect('custom_mysql');
|
|
125
|
}
|
136
|
}
|
|
126
|
return true;
|
137
|
return true;
|
|
127
|
}
|
138
|
}
|