Authored by biao

remove the IndexData.php and Index.php

1 -<?php  
2 -namespace LibModels\Wap\Index;  
3 -  
4 -use Api\Sign;  
5 -use Api\Yohobuy;  
6 -/*  
7 - * To change this license header, choose License Headers in Project Properties.  
8 - * To change this template file, choose Tools | Templates  
9 - * and open the template in the editor.  
10 - */  
11 -  
12 -/**  
13 - * Description of IndexChannel  
14 - *  
15 - * @author Administrator  
16 - */  
17 -class IndexData {  
18 - public static function channelData()  
19 - {  
20 - $param = Yohobuy::param();  
21 - $param['client_secret'] = Sign::getSign($param);  
22 - return Yohobuy::get(Yohobuy::SERVICE_URL . 'operations/api/v5/entrance/getEntrance',$param);  
23 - }  
24 -}  
1 -<?php  
2 -namespace Index;  
3 -  
4 -use LibModels\Wap\Index\IndexData;  
5 -/*  
6 - * To change this license header, choose License Headers in Project Properties.  
7 - * To change this template file, choose Tools | Templates  
8 - * and open the template in the editor.  
9 - */  
10 -  
11 -/**  
12 - * Description of Index  
13 - *  
14 - * @author Administrator  
15 - */  
16 -class IndexModel  
17 -{  
18 - public static function getChannel(){  
19 - $result = array();  
20 - $result['showYohood'] = false;  
21 -  
22 -  
23 - $data = IndexData::channelData();  
24 -  
25 - $channelList = array();  
26 - if($data['code'] == 200 && isset($data['data']['list'])){  
27 - foreach($data['data']['list'] as $key => $value){  
28 - switch ($value['channel_id']) {  
29 - case 5:  
30 - $result['showYohood'] = true;  
31 - $result['yohoodHref'] = '/yohood';  
32 - break;  
33 - case 1:  
34 - $channelList[$key]['href'] = '/boys';  
35 - $channelList[$key]['title'] = '男生';  
36 - $channelList[$key]['entitle'] = 'BOYS';  
37 - break;  
38 - case 2:  
39 - $channelList[$key]['href'] = '/girls';  
40 - $channelList[$key]['title'] = '女生';  
41 - $channelList[$key]['entitle'] = 'GIRLS';  
42 - break;  
43 - case 3:  
44 - $channelList[$key]['href'] = '/kids';  
45 - $channelList[$key]['title'] = '潮童';  
46 - $channelList[$key]['entitle'] = 'KIDS';  
47 - break;  
48 - case 4:  
49 - $channelList[$key]['href'] = '/lifestyle';  
50 - $channelList[$key]['title'] = '创意生活';  
51 - $channelList[$key]['entitle'] = 'LIFESTYLE';  
52 - break;  
53 - default:  
54 - break;  
55 - }  
56 - }  
57 - $result['channelList'] = $channelList;  
58 - }  
59 -  
60 - return $result;  
61 - }  
62 -  
63 -}