generated from liutk/owl-admin-base
调整文章迁移
parent
20386fb4ab
commit
e6ae821d4d
|
|
@ -26,12 +26,18 @@ class ArticleSeeder extends Seeder
|
||||||
];
|
];
|
||||||
|
|
||||||
foreach($oldArticles as $article){
|
foreach($oldArticles as $article){
|
||||||
|
//处理富文本内容图片地址;
|
||||||
|
$_content = null;
|
||||||
|
if($article->content){
|
||||||
|
$_content = str_replace('http://www.gxflqj.cn/', 'http://www.gxflqj.cn/storage', $article->content);
|
||||||
|
}
|
||||||
|
|
||||||
$_article = [
|
$_article = [
|
||||||
'id' => $article -> id,
|
'id' => $article -> id,
|
||||||
'category' => $categoryArr[$article -> type ?? 0],
|
'category' => $categoryArr[$article -> type ?? 0],
|
||||||
'title' => $article->title,
|
'title' => $article->title,
|
||||||
'cover' => $article->img,
|
'cover' => $article->img,
|
||||||
'content' => $article->content,
|
'content' => $_content,
|
||||||
'published_at' => now(),
|
'published_at' => now(),
|
||||||
'sort' => $article -> sort ?? 0,
|
'sort' => $article -> sort ?? 0,
|
||||||
'is_recommend' => $article->recommend,
|
'is_recommend' => $article->recommend,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue