Authored by 王水玲

新潮教室

... ... @@ -23,7 +23,7 @@ class StarClassData
* @param $uid
* @return string
*/
public static function rankInfoDataUrl($uid)
public static function rankInfoDataUrl($uid = 0)
{
$param = Yohobuy::param();
$param['uid'] = $uid;
... ... @@ -68,7 +68,7 @@ class StarClassData
* @param $uid
* @return mixed
*/
public static function sign($uid)
public static function sign($uid = 0)
{
$param = Yohobuy::param();
$param['method'] = 'app.starClass.sign';
... ... @@ -90,7 +90,7 @@ class StarClassData
$param = Yohobuy::param();
$param['page'] = $page;
$param['limit'] = $limit;
$param['uid'] = $uid;
$param['uid'] = $uid ? $uid : 0;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::SERVICE_URL . 'guang/api/v5/article/getStarClassroomArticleList', $param);
... ... @@ -117,7 +117,7 @@ class StarClassData
* @param $uid
* @return mixed
*/
public static function forward($uid)
public static function forward($uid = 0)
{
$param = Yohobuy::param();
$param['method'] = 'app.starClass.forward';
... ... @@ -145,7 +145,7 @@ class StarClassData
$param = Yohobuy::param();
$param['article_id'] = $articleId;
$param['uid'] = $uid;
$param['uid'] = $uid ? $uid : 0;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::SERVICE_URL . $url, $param);
... ... @@ -157,7 +157,7 @@ class StarClassData
* @param $uid
* @return mixed
*/
public static function topData($uid)
public static function topData($uid = 0)
{
$param = Yohobuy::param();
$param['method'] = 'app.starClass.top100';
... ...
... ... @@ -66,6 +66,19 @@ class Helpers
}
/**
* 获得图片原图(去除宽高参数)
* @param $url
*/
public static function getOriginalImg($url)
{
if (!isset($url) || empty($url) || !is_string($url)) {
return;
}
$arr = explode('?', $url);
return $arr[0];
}
/**
* 获取过滤APP里附加参数后的URL链接
*
* @param string $url 路径
... ...