aHuodong = self::GetHuodong($aArticle); $oInstans->aShip = self::GetShip($aArticle); $sReadMe = $oInstans->$sFunc($aArticle); return $sReadMe; } else { // 模版里可以返回false,但不能没有模版 throw new \Exception("没找到这个模版:".$sClass."\\".$sFunc); // return false; } } public static function GetShip($aArticle) { $oHttp = new Http(); $sDateNow = date("Y-m-d"); $sMasterUrl = "https://".env("www_master")."/api/ship/get/fuc/github/".$aArticle["user_name"]."-".$aArticle["project_name"]; $sShip = $oHttp->send($sMasterUrl); $aShip = json_decode($sShip, true); $aShip["youhui_str"] = "购买套餐时输入【".$aArticle['sale_code']."】优惠码,可享".$aArticle['sale_rate']."折优惠,折后低至8元/月。"; if (isset($aShip["huodong"]["str"]) && !empty($aShip["huodong"]["str"])) { $aShip["youhui_str"] .= " ".$aShip["huodong"]["str"]; } // tomd(empty($aShip["huodong"]["str"]), 1); // tomd($aShip, 1); return $aShip; } // public static function GetHuodong($aArticle) // { // // $oHttp = new Http(); // // $sDateNow = date("Y-m-d"); //// $sDateNow = "2025-05-03"; // // $sHuodongUrl = env('api_url_jichang_base').'/'.'api/huodong/findbydate/'.$sDateNow; // $sHuodong = $oHttp->send($sHuodongUrl); // $oHuodong = json_decode($sHuodong, 1); // // $sHuodongStr = "购买套餐时输入【".$aArticle['sale_code']."】优惠码,可享".$aArticle['sale_rate']."折优惠,折后低至8元/月。"; // // if ($oHuodong) { // $sStartDateStr = date("n月j日", strtotime($oHuodong['start_date'])); // $sEndDateStr = date("n月j日", strtotime($oHuodong['end_date'])); // // $sHuodongStr .= " // //🎁 ".$oHuodong['title'].":".$sStartDateStr."至".$sEndDateStr."期间,".$oHuodong['content']; // // } // // $oHuodong['str'] = $sHuodongStr; // // return $oHuodong; // // } }