作者 李宇航

合并分支 'lyh-server' 到 'master'

Lyh server



查看合并请求 !2311
... ... @@ -10,6 +10,7 @@
namespace App\Console\Commands\LyhTest;
use App\Models\Ai\AiBlog;
use App\Models\News\News;
use App\Models\Product\Category;
use App\Models\Project\AggregateKeywordAffix;
use App\Models\Project\AiBlogTask;
... ... @@ -41,6 +42,15 @@ class lyhDemo extends Command
protected $description = '更新路由';
public function handle(){
ProjectServer::useProject(3531);
$newsModel = new News();
$rows = $newsModel->select('id', 'text')->get();
foreach ($rows as $row) {
echo '执行数据id:'.$row->id.PHP_EOL;
$newText = preg_replace('/<h1 class="t">.*?<\/h1>/is', '', $row->text);
$newsModel->where('id', $row->id)->update(['text' => $newText]);
}
DB::disconnect('custom_mysql');
return true;
}
... ...
... ... @@ -154,7 +154,7 @@ class CustomModuleContentLogic extends BaseLogic
if($info !== false){
$this->fail('当前数据名称已存在');
}
try {
// try {
$this->param['sort'] = $this->setNewsSort();
$id = $this->model->addReturnId($this->param);
$route = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_MODULE,
... ... @@ -162,9 +162,9 @@ class CustomModuleContentLogic extends BaseLogic
$this->addUpdateNotify(RouteMap::SOURCE_MODULE,$route);
$this->curlDelRoute(['new_route'=>$route]);
$this->edit(['route' => $route], ['id' => $id]);
}catch (\Exception $e){
$this->fail('系统错误,请联系管理员');
}
// }catch (\Exception $e){
// $this->fail('系统错误,请联系管理员');
// }
return $id;
}
... ...