合并分支 'lyh-server' 到 'master'
Lyh server 查看合并请求 !3165
正在显示
1 个修改的文件
包含
6 行增加
和
17 行删除
| @@ -23,7 +23,6 @@ use App\Models\Project\Project; | @@ -23,7 +23,6 @@ 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; | ||
| 27 | use App\Models\Template\BTemplateMain; | 26 | use App\Models\Template\BTemplateMain; |
| 28 | use App\Models\Template\TemplateTypeMain; | 27 | use App\Models\Template\TemplateTypeMain; |
| 29 | use App\Models\WebSetting\Translate; | 28 | use App\Models\WebSetting\Translate; |
| @@ -115,24 +114,14 @@ class lyhDemo extends Command | @@ -115,24 +114,14 @@ class lyhDemo extends Command | ||
| 115 | */ | 114 | */ |
| 116 | public function _actionRoute(){ | 115 | public function _actionRoute(){ |
| 117 | $projectModel = new Project(); | 116 | $projectModel = new Project(); |
| 118 | - $lists = $projectModel->list(['type'=>['in',[1,2,3,4,6]]], 'id', ['id']); | ||
| 119 | - $geoLinkModel = new GeoLink(); | 117 | + $lists = $projectModel->list([], 'id', ['id']); |
| 118 | + $data = []; | ||
| 120 | foreach ($lists as $item){ | 119 | foreach ($lists as $item){ |
| 121 | echo date('Y-m-d H:i:s') . '开始--项目的id:'. $item['id'] . PHP_EOL; | 120 | echo date('Y-m-d H:i:s') . '开始--项目的id:'. $item['id'] . PHP_EOL; |
| 122 | - ProjectServer::useProject($item['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'); | 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']]); | ||
| 136 | } | 125 | } |
| 137 | return true; | 126 | return true; |
| 138 | } | 127 | } |
-
请 注册 或 登录 后发表评论