no message

This commit is contained in:
hellcat 2026-08-05 19:39:22 +08:00
parent 4bd8b87ba7
commit 58019f8d95

View File

@ -197,19 +197,41 @@ public function receiveFreenode(Request $oRequest)
$oCategories = Categories::where("sSlug", "freenode")->first();
$oArticle = Articles::where('sSlug', $sSlug)->first();
$aAttributes = [
'sThumb' => $sThumbPath,
'iCategoryId' => $oCategories->id,
'sTitle' => $sArticleTitle,
'sTitleSub' => $sArticleTitleSub,
'sContent' => $sArticleContent,
'iStatus' => 1,
'iUserId' => 1,
];
// 只有新创建时才写入初始点赞数
if (!$oArticle) {
$aAttributes['i7like'] = $i7like;
}
$oArticle = Articles::updateOrCreate(
['sSlug' => $sSlug],
[
'sThumb' => $sThumbPath,
'iCategoryId' => $oCategories->id,
'sTitle' => $sArticleTitle,
'sTitleSub' => $sArticleTitleSub,
'sContent' => $sArticleContent,
'i7like' => $i7like,
'iStatus' => 1,
'iUserId' => 1,
],
);
['sSlug' => $sSlug],
$aAttributes
);
// $oArticle = Articles::updateOrCreate(
// ['sSlug' => $sSlug],
// [
// 'sThumb' => $sThumbPath,
// 'iCategoryId' => $oCategories->id,
// 'sTitle' => $sArticleTitle,
// 'sTitleSub' => $sArticleTitleSub,
// 'sContent' => $sArticleContent,
// 'i7like' => $i7like,
// 'iStatus' => 1,
// 'iUserId' => 1,
// ],
// ); // 我希望如果数据已经有了i7like就不再更新
(new TagService())->syncArticleTagsByName($oArticle, $aArticleTags);