Authored by whb

common的广告修改

@@ -85,6 +85,8 @@ class CommonController extends WebAction @@ -85,6 +85,8 @@ class CommonController extends WebAction
85 $content_code = $this->get('content_code', ''); 85 $content_code = $this->get('content_code', '');
86 $client_type = $this->get('client_type', 'web'); 86 $client_type = $this->get('client_type', 'web');
87 $callback = $this->get('callback', ''); 87 $callback = $this->get('callback', '');
  88 + $width = $this->get('width', '');
  89 + $height = $this->get('height', '');
88 $params = array( 90 $params = array(
89 'content_code' => $content_code, 91 'content_code' => $content_code,
90 'client_type' => $client_type 92 'client_type' => $client_type
@@ -100,9 +102,12 @@ class CommonController extends WebAction @@ -100,9 +102,12 @@ class CommonController extends WebAction
100 if(isset($data['data'][0]['data'])) 102 if(isset($data['data'][0]['data']))
101 { 103 {
102 $banner = current($data['data'][0]['data']); 104 $banner = current($data['data'][0]['data']);
103 -  
104 if(!empty($banner)) { 105 if(!empty($banner)) {
105 - $banner['src'] = Images::getImageUrl($banner['src'], 2600, 60 ,2); 106 + if(empty($width) || empty($height) ) {
  107 + $width = 2600;//通栏广告
  108 + $height = 60;
  109 + }
  110 + $banner['src'] = Images::getImageUrl($banner['src'], $width, $height ,2);
106 //str_replace('?imageView/{mode}/w/{width}/h/{height}', '', $banner['src']); 111 //str_replace('?imageView/{mode}/w/{width}/h/{height}', '', $banner['src']);
107 } 112 }
108 } 113 }
@@ -75,7 +75,8 @@ class HomeModel @@ -75,7 +75,8 @@ class HomeModel
75 'link' => $val['sort_url'], 75 'link' => $val['sort_url'],
76 'icon' => $val['sort_ico'], 76 'icon' => $val['sort_ico'],
77 'classname' => str_replace(' ', '', strtolower($val['sort_name_en'])) == $channel ? $channel : '', 77 'classname' => str_replace(' ', '', strtolower($val['sort_name_en'])) == $channel ? $channel : '',
78 - 'index_main' => $index_main++, 78 + 'index_main' => $index_main ++,
  79 + 'content_code' => $val['content_code'],
79 'is_hot' => $val['is_hot'] == 'Y' ? true : false, 80 'is_hot' => $val['is_hot'] == 'Y' ? true : false,
80 'is_new' => $val['is_new'] == 'Y' ? true : false, 81 'is_new' => $val['is_new'] == 'Y' ? true : false,
81 // 'subnav' => array() 82 // 'subnav' => array()
@@ -88,6 +89,7 @@ class HomeModel @@ -88,6 +89,7 @@ class HomeModel
88 'link' => $sub['sort_url'], 89 'link' => $sub['sort_url'],
89 'is_hot' => $sub['is_hot'] == 'Y' ? true : false, 90 'is_hot' => $sub['is_hot'] == 'Y' ? true : false,
90 'is_new' => $sub['is_new'] == 'Y' ? true : false, 91 'is_new' => $sub['is_new'] == 'Y' ? true : false,
  92 + 'content_code' => $sub['content_code'],
91 // 'thirdnav' => array(), 93 // 'thirdnav' => array(),
92 'index_sub' => $index_sub ++ 94 'index_sub' => $index_sub ++
93 ); 95 );
@@ -97,6 +99,7 @@ class HomeModel @@ -97,6 +99,7 @@ class HomeModel
97 'title' => $thirdsub['sort_name'], 99 'title' => $thirdsub['sort_name'],
98 'name_en' => $thirdsub['sort_name_en'], 100 'name_en' => $thirdsub['sort_name_en'],
99 'link' => $thirdsub['sort_url'], 101 'link' => $thirdsub['sort_url'],
  102 + 'content_code' => $thirdsub['content_code'],
100 // 'branditems' => array() 103 // 'branditems' => array()
101 ); 104 );
102 if (isset($thirdsub['sub'])) { 105 if (isset($thirdsub['sub'])) {