作者 lyh

变更数据

... ... @@ -35,6 +35,7 @@ use App\Services\CosService;
use App\Services\Geo\GeoService;
use App\Services\MidJourneyService;
use App\Services\ProjectServer;
use Hashids\Hashids;
use Illuminate\Console\Command;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\DB;
... ... @@ -56,7 +57,7 @@ class lyhDemo extends Command
protected $description = '更新路由';
public function handle(){
return $this->translate_action();
return $this->_actionRoute();
}
public function _actionDa()
... ... @@ -113,21 +114,14 @@ class lyhDemo extends Command
*/
public function _actionRoute(){
$projectModel = new Project();
$lists = $projectModel->list(['delete_status' => 0,'is_ai_blog'=>1,'project_type'=>0,'extend_type'=>0,'type'=>['in',[1,2,3,4,6]]], 'id', ['id']);
$lists = $projectModel->list(['type'=>['in',[1,2,3,4,6]]], 'id', ['id']);
$data = [];
foreach ($lists as $item){
echo date('Y-m-d H:i:s') . '开始--项目的id:'. $item['id'] . PHP_EOL;
ProjectServer::useProject($item['id']);
$aiBlogModel = new AiBlog();
$info = $aiBlogModel->read(['text'=>['like','%href="blog/%']],['id']);
if($info !== false){
echo '需要处理->项目id:'.$item['id'].PHP_EOL;
$data[] = $item['id'];
}
echo 'end';
DB::disconnect('custom_mysql');
$data['post_id'] = mt_rand(100000, 999999).$item['id'];
$projectModel->edit(['post_id'=>$data['post_id']],['id'=>$item['id']]);
}
dd($data);
return true;
}
public function _actionTemplateMain(){
... ...