...
|
...
|
@@ -19,6 +19,7 @@ use Api\Yohobuy; |
|
|
*/
|
|
|
class StarClassModel
|
|
|
{
|
|
|
public static $_isApp = false;
|
|
|
|
|
|
/* 星潮教室首页楼层资源的位置码 */
|
|
|
const CODE_FLOOR_STARCLASS_INDEX = '8adc27fcf5676f356602889afcfd2a8e';
|
...
|
...
|
@@ -31,8 +32,10 @@ class StarClassModel |
|
|
* @param $uid
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function getStarClass($uid)
|
|
|
public static function getStarClass($uid, $isApp)
|
|
|
{
|
|
|
self::$_isApp = $isApp;
|
|
|
|
|
|
$result = array();
|
|
|
//头部导航
|
|
|
$result['headTab'] = self::getHeadTab('index');
|
...
|
...
|
@@ -102,8 +105,9 @@ class StarClassModel |
|
|
* 星专题
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function getspecial()
|
|
|
public static function getspecial($isApp)
|
|
|
{
|
|
|
self::$_isApp = $isApp;
|
|
|
$result = array();
|
|
|
//头部导航
|
|
|
$result['headTab'] = self::getHeadTab('special');
|
...
|
...
|
@@ -165,7 +169,7 @@ class StarClassModel |
|
|
foreach ($data['data']['list']['artList'] as $key => $value) {
|
|
|
//获得原尺寸图片
|
|
|
$collocationList[$key]['img'] = Helpers::getOriginalImg($value['src']);
|
|
|
$collocationList[$key]['url'] = $value['url'];
|
|
|
$collocationList[$key]['url'] = $isApp ? $value['url'] : Helpers::getFilterUrl($value['url']);
|
|
|
$collocationList[$key]['title'] = $value['title'];
|
|
|
$collocationList[$key]['content'] = $value['intro'];
|
|
|
$collocationList[$key]['time'] = $value['publish_time'];
|
...
|
...
|
@@ -307,9 +311,10 @@ class StarClassModel |
|
|
*/
|
|
|
public static function single_name_image($data)
|
|
|
{
|
|
|
$isApp = self::$_isApp;
|
|
|
$result = array();
|
|
|
|
|
|
$result['url'] = $data['url'];
|
|
|
$result['url'] = $isApp ? $data['url'] : Helpers::getFilterUrl($data['url']);
|
|
|
$result['img'] = Helpers::getOriginalImg($data['src']);
|
|
|
$result['title'] = $data['title'];
|
|
|
$result['subject'] = true;
|
...
|
...
|
@@ -325,10 +330,11 @@ class StarClassModel |
|
|
*/
|
|
|
public static function focus($data)
|
|
|
{
|
|
|
$isApp = self::$_isApp;
|
|
|
$result = array();
|
|
|
|
|
|
foreach ($data as $key=>$value) {
|
|
|
$result['banner'][$key]['url'] = $value['url'];
|
|
|
$result['banner'][$key]['url'] = $isApp ? $value['url'] : Helpers::getFilterUrl($value['url']);
|
|
|
$result['banner'][$key]['img'] = Helpers::getOriginalImg($value['src']);
|
|
|
$result['banner'][$key]['bgColor'] = $value['bgColor'];
|
|
|
$result['banner'][$key]['title'] = $value['title'];
|
...
|
...
|
@@ -346,12 +352,14 @@ class StarClassModel |
|
|
*/
|
|
|
public static function title_image($data)
|
|
|
{
|
|
|
$isApp = self::$_isApp;
|
|
|
|
|
|
$result = array();
|
|
|
|
|
|
$result['title']['title'] = $data['title'];
|
|
|
$result['title']['more_url'] = $data['more_url'];
|
|
|
$result['title']['moreName'] = $data['more_name'];
|
|
|
$result['subjectBanner']['url'] = $data['image']['url'];
|
|
|
$result['subjectBanner']['url'] = $isApp ? $data['image']['url'] : Helpers::getFilterUrl($data['image']['url']);
|
|
|
$result['subjectBanner']['img'] = Helpers::getOriginalImg($data['image']['src']);
|
|
|
$result['starSubject'] = true;
|
|
|
|
...
|
...
|
@@ -365,10 +373,11 @@ class StarClassModel |
|
|
*/
|
|
|
public static function single_image($data)
|
|
|
{
|
|
|
$isApp = self::$_isApp;
|
|
|
$result = array();
|
|
|
|
|
|
$result['videoImg'] = Helpers::getOriginalImg($data[0]['src']);
|
|
|
$result['videoUrl'] = $data[0]['url'];
|
|
|
$result['videoUrl'] = $isApp ? $data[0]['url'] : Helpers::getFilterUrl($data[0]['url']);
|
|
|
$result['alt'] = $data[0]['alt'];
|
|
|
$result['title'] = $data[0]['title'];
|
|
|
$result['video'] = true;
|
...
|
...
|
@@ -383,6 +392,7 @@ class StarClassModel |
|
|
*/
|
|
|
public static function match_image($data)
|
|
|
{
|
|
|
$isApp = self::$_isApp;
|
|
|
$result = array();
|
|
|
|
|
|
//title
|
...
|
...
|
@@ -392,13 +402,13 @@ class StarClassModel |
|
|
|
|
|
//两张大图
|
|
|
foreach ($data['top_image'] as $key=>$value) {
|
|
|
$result['collocationBigImg'][$key]['url'] = $value['url'];
|
|
|
$result['collocationBigImg'][$key]['url'] = $isApp ? $value['url']: Helpers::getFilterUrl($value['url']);
|
|
|
$result['collocationBigImg'][$key]['img'] = Helpers::getOriginalImg($value['src']);
|
|
|
}
|
|
|
|
|
|
//n张小图
|
|
|
foreach ($data['list'] as $key=>$value) {
|
|
|
$result['collocationList'][$key]['url'] = $value['url'];
|
|
|
$result['collocationList'][$key]['url'] = $isApp ? $value['url'] : Helpers::getFilterUrl($value['url']);
|
|
|
$result['collocationList'][$key]['img'] = Helpers::getOriginalImg($value['src']);
|
|
|
}
|
|
|
|
...
|
...
|
|