no message
This commit is contained in:
parent
4bd8b87ba7
commit
58019f8d95
@ -197,19 +197,41 @@ public function receiveFreenode(Request $oRequest)
|
|||||||
|
|
||||||
$oCategories = Categories::where("sSlug", "freenode")->first();
|
$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(
|
$oArticle = Articles::updateOrCreate(
|
||||||
['sSlug' => $sSlug],
|
['sSlug' => $sSlug],
|
||||||
[
|
$aAttributes
|
||||||
'sThumb' => $sThumbPath,
|
);
|
||||||
'iCategoryId' => $oCategories->id,
|
|
||||||
'sTitle' => $sArticleTitle,
|
// $oArticle = Articles::updateOrCreate(
|
||||||
'sTitleSub' => $sArticleTitleSub,
|
// ['sSlug' => $sSlug],
|
||||||
'sContent' => $sArticleContent,
|
// [
|
||||||
'i7like' => $i7like,
|
// 'sThumb' => $sThumbPath,
|
||||||
'iStatus' => 1,
|
// 'iCategoryId' => $oCategories->id,
|
||||||
'iUserId' => 1,
|
// 'sTitle' => $sArticleTitle,
|
||||||
],
|
// 'sTitleSub' => $sArticleTitleSub,
|
||||||
);
|
// 'sContent' => $sArticleContent,
|
||||||
|
// 'i7like' => $i7like,
|
||||||
|
// 'iStatus' => 1,
|
||||||
|
// 'iUserId' => 1,
|
||||||
|
// ],
|
||||||
|
// ); // 我希望,如果数据已经有了,i7like就不再更新
|
||||||
|
|
||||||
(new TagService())->syncArticleTagsByName($oArticle, $aArticleTags);
|
(new TagService())->syncArticleTagsByName($oArticle, $aArticleTags);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user