|
@@ -19,6 +19,7 @@ use Api\Yohobuy; |
|
@@ -19,6 +19,7 @@ use Api\Yohobuy; |
19
|
*/
|
19
|
*/
|
20
|
class StarClassModel
|
20
|
class StarClassModel
|
21
|
{
|
21
|
{
|
|
|
22
|
+ public static $_isApp = false;
|
22
|
|
23
|
|
23
|
/* 星潮教室首页楼层资源的位置码 */
|
24
|
/* 星潮教室首页楼层资源的位置码 */
|
24
|
const CODE_FLOOR_STARCLASS_INDEX = '8adc27fcf5676f356602889afcfd2a8e';
|
25
|
const CODE_FLOOR_STARCLASS_INDEX = '8adc27fcf5676f356602889afcfd2a8e';
|
|
@@ -31,8 +32,10 @@ class StarClassModel |
|
@@ -31,8 +32,10 @@ class StarClassModel |
31
|
* @param $uid
|
32
|
* @param $uid
|
32
|
* @return array
|
33
|
* @return array
|
33
|
*/
|
34
|
*/
|
34
|
- public static function getStarClass($uid)
|
35
|
+ public static function getStarClass($uid, $isApp)
|
35
|
{
|
36
|
{
|
|
|
37
|
+ self::$_isApp = $isApp;
|
|
|
38
|
+
|
36
|
$result = array();
|
39
|
$result = array();
|
37
|
//头部导航
|
40
|
//头部导航
|
38
|
$result['headTab'] = self::getHeadTab('index');
|
41
|
$result['headTab'] = self::getHeadTab('index');
|
|
@@ -102,8 +105,9 @@ class StarClassModel |
|
@@ -102,8 +105,9 @@ class StarClassModel |
102
|
* 星专题
|
105
|
* 星专题
|
103
|
* @return array
|
106
|
* @return array
|
104
|
*/
|
107
|
*/
|
105
|
- public static function getspecial()
|
108
|
+ public static function getspecial($isApp)
|
106
|
{
|
109
|
{
|
|
|
110
|
+ self::$_isApp = $isApp;
|
107
|
$result = array();
|
111
|
$result = array();
|
108
|
//头部导航
|
112
|
//头部导航
|
109
|
$result['headTab'] = self::getHeadTab('special');
|
113
|
$result['headTab'] = self::getHeadTab('special');
|
|
@@ -165,7 +169,7 @@ class StarClassModel |
|
@@ -165,7 +169,7 @@ class StarClassModel |
165
|
foreach ($data['data']['list']['artList'] as $key => $value) {
|
169
|
foreach ($data['data']['list']['artList'] as $key => $value) {
|
166
|
//获得原尺寸图片
|
170
|
//获得原尺寸图片
|
167
|
$collocationList[$key]['img'] = Helpers::getOriginalImg($value['src']);
|
171
|
$collocationList[$key]['img'] = Helpers::getOriginalImg($value['src']);
|
168
|
- $collocationList[$key]['url'] = $value['url'];
|
172
|
+ $collocationList[$key]['url'] = $isApp ? $value['url'] : Helpers::getFilterUrl($value['url']);
|
169
|
$collocationList[$key]['title'] = $value['title'];
|
173
|
$collocationList[$key]['title'] = $value['title'];
|
170
|
$collocationList[$key]['content'] = $value['intro'];
|
174
|
$collocationList[$key]['content'] = $value['intro'];
|
171
|
$collocationList[$key]['time'] = $value['publish_time'];
|
175
|
$collocationList[$key]['time'] = $value['publish_time'];
|
|
@@ -307,9 +311,10 @@ class StarClassModel |
|
@@ -307,9 +311,10 @@ class StarClassModel |
307
|
*/
|
311
|
*/
|
308
|
public static function single_name_image($data)
|
312
|
public static function single_name_image($data)
|
309
|
{
|
313
|
{
|
|
|
314
|
+ $isApp = self::$_isApp;
|
310
|
$result = array();
|
315
|
$result = array();
|
311
|
|
316
|
|
312
|
- $result['url'] = $data['url'];
|
317
|
+ $result['url'] = $isApp ? $data['url'] : Helpers::getFilterUrl($data['url']);
|
313
|
$result['img'] = Helpers::getOriginalImg($data['src']);
|
318
|
$result['img'] = Helpers::getOriginalImg($data['src']);
|
314
|
$result['title'] = $data['title'];
|
319
|
$result['title'] = $data['title'];
|
315
|
$result['subject'] = true;
|
320
|
$result['subject'] = true;
|
|
@@ -325,10 +330,11 @@ class StarClassModel |
|
@@ -325,10 +330,11 @@ class StarClassModel |
325
|
*/
|
330
|
*/
|
326
|
public static function focus($data)
|
331
|
public static function focus($data)
|
327
|
{
|
332
|
{
|
|
|
333
|
+ $isApp = self::$_isApp;
|
328
|
$result = array();
|
334
|
$result = array();
|
329
|
|
335
|
|
330
|
foreach ($data as $key=>$value) {
|
336
|
foreach ($data as $key=>$value) {
|
331
|
- $result['banner'][$key]['url'] = $value['url'];
|
337
|
+ $result['banner'][$key]['url'] = $isApp ? $value['url'] : Helpers::getFilterUrl($value['url']);
|
332
|
$result['banner'][$key]['img'] = Helpers::getOriginalImg($value['src']);
|
338
|
$result['banner'][$key]['img'] = Helpers::getOriginalImg($value['src']);
|
333
|
$result['banner'][$key]['bgColor'] = $value['bgColor'];
|
339
|
$result['banner'][$key]['bgColor'] = $value['bgColor'];
|
334
|
$result['banner'][$key]['title'] = $value['title'];
|
340
|
$result['banner'][$key]['title'] = $value['title'];
|
|
@@ -346,12 +352,14 @@ class StarClassModel |
|
@@ -346,12 +352,14 @@ class StarClassModel |
346
|
*/
|
352
|
*/
|
347
|
public static function title_image($data)
|
353
|
public static function title_image($data)
|
348
|
{
|
354
|
{
|
|
|
355
|
+ $isApp = self::$_isApp;
|
|
|
356
|
+
|
349
|
$result = array();
|
357
|
$result = array();
|
350
|
|
358
|
|
351
|
$result['title']['title'] = $data['title'];
|
359
|
$result['title']['title'] = $data['title'];
|
352
|
$result['title']['more_url'] = $data['more_url'];
|
360
|
$result['title']['more_url'] = $data['more_url'];
|
353
|
$result['title']['moreName'] = $data['more_name'];
|
361
|
$result['title']['moreName'] = $data['more_name'];
|
354
|
- $result['subjectBanner']['url'] = $data['image']['url'];
|
362
|
+ $result['subjectBanner']['url'] = $isApp ? $data['image']['url'] : Helpers::getFilterUrl($data['image']['url']);
|
355
|
$result['subjectBanner']['img'] = Helpers::getOriginalImg($data['image']['src']);
|
363
|
$result['subjectBanner']['img'] = Helpers::getOriginalImg($data['image']['src']);
|
356
|
$result['starSubject'] = true;
|
364
|
$result['starSubject'] = true;
|
357
|
|
365
|
|
|
@@ -365,10 +373,11 @@ class StarClassModel |
|
@@ -365,10 +373,11 @@ class StarClassModel |
365
|
*/
|
373
|
*/
|
366
|
public static function single_image($data)
|
374
|
public static function single_image($data)
|
367
|
{
|
375
|
{
|
|
|
376
|
+ $isApp = self::$_isApp;
|
368
|
$result = array();
|
377
|
$result = array();
|
369
|
|
378
|
|
370
|
$result['videoImg'] = Helpers::getOriginalImg($data[0]['src']);
|
379
|
$result['videoImg'] = Helpers::getOriginalImg($data[0]['src']);
|
371
|
- $result['videoUrl'] = $data[0]['url'];
|
380
|
+ $result['videoUrl'] = $isApp ? $data[0]['url'] : Helpers::getFilterUrl($data[0]['url']);
|
372
|
$result['alt'] = $data[0]['alt'];
|
381
|
$result['alt'] = $data[0]['alt'];
|
373
|
$result['title'] = $data[0]['title'];
|
382
|
$result['title'] = $data[0]['title'];
|
374
|
$result['video'] = true;
|
383
|
$result['video'] = true;
|
|
@@ -383,6 +392,7 @@ class StarClassModel |
|
@@ -383,6 +392,7 @@ class StarClassModel |
383
|
*/
|
392
|
*/
|
384
|
public static function match_image($data)
|
393
|
public static function match_image($data)
|
385
|
{
|
394
|
{
|
|
|
395
|
+ $isApp = self::$_isApp;
|
386
|
$result = array();
|
396
|
$result = array();
|
387
|
|
397
|
|
388
|
//title
|
398
|
//title
|
|
@@ -392,13 +402,13 @@ class StarClassModel |
|
@@ -392,13 +402,13 @@ class StarClassModel |
392
|
|
402
|
|
393
|
//两张大图
|
403
|
//两张大图
|
394
|
foreach ($data['top_image'] as $key=>$value) {
|
404
|
foreach ($data['top_image'] as $key=>$value) {
|
395
|
- $result['collocationBigImg'][$key]['url'] = $value['url'];
|
405
|
+ $result['collocationBigImg'][$key]['url'] = $isApp ? $value['url']: Helpers::getFilterUrl($value['url']);
|
396
|
$result['collocationBigImg'][$key]['img'] = Helpers::getOriginalImg($value['src']);
|
406
|
$result['collocationBigImg'][$key]['img'] = Helpers::getOriginalImg($value['src']);
|
397
|
}
|
407
|
}
|
398
|
|
408
|
|
399
|
//n张小图
|
409
|
//n张小图
|
400
|
foreach ($data['list'] as $key=>$value) {
|
410
|
foreach ($data['list'] as $key=>$value) {
|
401
|
- $result['collocationList'][$key]['url'] = $value['url'];
|
411
|
+ $result['collocationList'][$key]['url'] = $isApp ? $value['url'] : Helpers::getFilterUrl($value['url']);
|
402
|
$result['collocationList'][$key]['img'] = Helpers::getOriginalImg($value['src']);
|
412
|
$result['collocationList'][$key]['img'] = Helpers::getOriginalImg($value['src']);
|
403
|
}
|
413
|
}
|
404
|
|
414
|
|