Index.php 2.04 KB
<?php
namespace Index;

use LibModels\Wap\Index\IndexData;
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Index
 *
 * @author Administrator
 */
class IndexModel 
{
    public static function getChannel(){
        $result = array();
        $result['showYohood'] = false;
        
        $data = IndexData::channelData();
        
        $channelList = array();
        if($data['code'] == 200 && isset($data['data']['list'])){
            foreach($data['data']['list'] as $key => $value){
                switch ($value['channel_id']) {
                    case 5:
                        $result['showYohood'] = true;
                        $result['yohoodHref'] = '/yohood';
                        break;
                    case 1:
                        $channelList[$key]['href'] = '/boys';
                        $channelList[$key]['title'] = '男生';
                        $channelList[$key]['entitle'] = 'BOYS';
                        break;
                    case 2:
                        $channelList[$key]['href'] = '/girls';
                        $channelList[$key]['title'] = '女生';
                        $channelList[$key]['entitle'] = 'GIRLS';
                        break;
                    case 3:
                        $channelList[$key]['href'] = '/kids';
                        $channelList[$key]['title'] = '潮童';
                        $channelList[$key]['entitle'] = 'KIDS';
                        break;
                    case 4:
                        $channelList[$key]['href'] = '/lifestyle';
                        $channelList[$key]['title'] = '创意生活';
                        $channelList[$key]['entitle'] = 'LIFESTYLE';
                        break;
                    default:
                        break;
                }
            }
            $result['channelList'] = $channelList;
        }
        
        return $result;
    }
        
}