no message

This commit is contained in:
hellcat 2026-08-06 21:38:53 +08:00
parent 274c6d78c7
commit a07d041db7

View File

@ -134,19 +134,41 @@ public function receiveShadowrocketids(Request $oRequest)
$oCategories = Categories::where("sSlug", "shadowrocketids")->first();
$oArticle = Articles::where('sSlug', $sSlug)->first();
$aAttributes = [
'sThumb' => $sThumbPath,
'iCategoryId' => $oCategories->id,
'sTitle' => '「'.date("n月j日").'」'.$sTitle,
'sTitleSub' => $sTitleSub,
'sContent' => $sArticle,
'iStatus' => 1,
'iUserId' => 1,
];
// 只有新创建时才写入初始点赞数
if (!$oArticle) {
$aAttributes['i7like'] = $i7like;
}
$oArticle = Articles::updateOrCreate(
['sSlug' => $sSlug],
[
'sThumb' => $sThumbPath,
'iCategoryId' => $oCategories->id,
'sTitle' => $sTitle,
'sTitleSub' => $sTitleSub,
'sContent' => $sArticle,
'i7like' => $i7like,
'iStatus' => 1,
'iUserId' => 1,
],
);
['sSlug' => $sSlug],
$aAttributes
);
// $oArticle = Articles::updateOrCreate(
// ['sSlug' => $sSlug],
// [
// 'sThumb' => $sThumbPath,
// 'iCategoryId' => $oCategories->id,
// 'sTitle' => $sTitle,
// 'sTitleSub' => $sTitleSub,
// 'sContent' => $sArticle,
// 'i7like' => $i7like,
// 'iStatus' => 1,
// 'iUserId' => 1,
// ],
// );
(new TagService())->syncArticleTagsByName($oArticle, $aArticleTags);