diff --git a/app/Http/Controllers/Api/v1/ArticlesController.php b/app/Http/Controllers/Api/v1/ArticlesController.php index 817f2b0d..f37e7a67 100755 --- a/app/Http/Controllers/Api/v1/ArticlesController.php +++ b/app/Http/Controllers/Api/v1/ArticlesController.php @@ -108,16 +108,17 @@ public function receiveShadowrocketids(Request $oRequest) $sTitleSub = $aData["title_sub"] ?? ''; $aArticleTags = $aData["tags"] ?? []; $sSlug = 'ssi'.date("Ymd"); - $sImgAuthor = "tg_xiuren_a"; +// $sImgAuthor = "tg_xiuren_a"; + $sSubKey = $_ENV['site_code_short'].'::ssi'; $i7like = $aData["7like"] ?? 0; - $oThumbNum = ArticleThumbNum::firstOrCreate(["author_code" => $sImgAuthor, "type" => "shadowrocketids"]); + $oThumbNum = ArticleThumbNum::firstOrCreate(["author_code" => $sSubKey, "type" => "shadowrocketids"]); $iThumbNum = $oThumbNum->num; - $sImagesApi = "https://".config("path.url_resource_base")."/api/images/get/url-by-num"; + $sImagesApi = "https://".config("path.url_resource_base")."/api/images/get/url-by-subkey"; $aApiArg = [ - "sAuthorCode" => $sImgAuthor, + "sSubKey" => $sSubKey, "iNum" => $iThumbNum+1, ]; $sApiResult = HttpV2::make($sImagesApi, "post")->withToken()->setDataA($aApiArg)->send(); @@ -149,7 +150,7 @@ public function receiveShadowrocketids(Request $oRequest) (new TagService())->syncArticleTagsByName($oArticle, $aArticleTags); - ArticleThumbNum::where("author_code", $sImgAuthor)->where("type", "shadowrocketids")->update(["num" => $sThumbNumTrue]); + ArticleThumbNum::where("author_code", $sSubKey)->where("type", "shadowrocketids")->update(["num" => $sThumbNumTrue]); $sArticleUrl = config("app.url")."/shadowrocketids/".$sSlug;