Authored by xiaowei

代码审核修改

@@ -297,7 +297,10 @@ class ChannelConfig @@ -297,7 +297,10 @@ class ChannelConfig
297 'list' => array('domain' =>'list','module'=>'c'),//list.yohobuy.com 297 'list' => array('domain' =>'list','module'=>'c'),//list.yohobuy.com
298 'list_new' => array('domain' =>'list','module'=>'n'),//list.yohobuy.com/new 298 'list_new' => array('domain' =>'list','module'=>'n'),//list.yohobuy.com/new
299 'brand' => array('domain' =>'brand','module'=>'b'),//xxx.yohobuy.com[品牌域名] 299 'brand' => array('domain' =>'brand','module'=>'b'),//xxx.yohobuy.com[品牌域名]
300 - 'sale' => array('domain' =>'sale','module' => 's'),//sale.yohobuy.com 300 + 'sale' => array('domain' =>'sale','module' => 's'),//sale.yohobuy.com
301 ); 301 );
302 302
  303 + //左侧广告默认图片-passport相关页面
  304 + public static $leftDefaultImg = 'http://img12.static.yhbimg.com/yhb-img01/2015/12/01/07/020a0b6e7ff908d0c2bc4045b4fef42b9f.png?imageView/2/w/252/h/190';
  305 +
303 } 306 }
@@ -105,7 +105,7 @@ class BrandData @@ -105,7 +105,7 @@ class BrandData
105 } 105 }
106 106
107 /* 107 /*
108 - * 品牌一览资源位banner 108 + * 品牌一览资源位banner-PC
109 * @param string $contentCode 获取广告资源需要的位置码 109 * @param string $contentCode 获取广告资源需要的位置码
110 * @param int $channel 频道标识 1:男,2:女,3:潮童,4:创意生活 110 * @param int $channel 频道标识 1:男,2:女,3:潮童,4:创意生活
111 * @return array( 111 * @return array(
@@ -113,12 +113,13 @@ class BrandData @@ -113,12 +113,13 @@ class BrandData
113 * "brandList": "按字母'A-Z'分组的品牌列表数据" 113 * "brandList": "按字母'A-Z'分组的品牌列表数据"
114 * ) 114 * )
115 */ 115 */
116 -  
117 - public static function getTopBanner($contentCode,$channel) 116 + public static function getTopBanner($contentCode, $channel,$clientType='web')
118 { 117 {
119 /* 顶部的轮翻广告及热门品牌数据 */ 118 /* 顶部的轮翻广告及热门品牌数据 */
120 $param = Yohobuy::param(); 119 $param = Yohobuy::param();
121 $param['content_code'] = $contentCode; 120 $param['content_code'] = $contentCode;
  121 + $param['client_type'] = $clientType;
  122 + $param['private_key'] = Yohobuy::$privateKeyList[$clientType];
122 $param['client_secret'] = Sign::getSign($param); 123 $param['client_secret'] = Sign::getSign($param);
123 $urlList['brandTop'] = Yohobuy::httpBuildQuery(Yohobuy::SERVICE_URL . self::URI_BRAND_TOPPOS, $param); 124 $urlList['brandTop'] = Yohobuy::httpBuildQuery(Yohobuy::SERVICE_URL . self::URI_BRAND_TOPPOS, $param);
124 125
@@ -128,9 +129,8 @@ class BrandData @@ -128,9 +129,8 @@ class BrandData
128 $param['yh_channel'] = $channel; 129 $param['yh_channel'] = $channel;
129 $param['client_secret'] = Sign::getSign($param); 130 $param['client_secret'] = Sign::getSign($param);
130 $urlList['brandList'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $param); 131 $urlList['brandList'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $param);
131 -  
132 - return Yohobuy::getMulti($urlList, array(), 3600); // 有缓存1小时 132 +
  133 + return Yohobuy::getMulti($urlList,array(),3600);
133 } 134 }
134 -  
135 135
136 } 136 }
@@ -12,7 +12,8 @@ class BrandsController extends WebAction @@ -12,7 +12,8 @@ class BrandsController extends WebAction
12 public function brandsAction() 12 public function brandsAction()
13 { 13 {
14 //品牌一览头部 14 //品牌一览头部
15 - $channel = $this->getCookie("_Channel") ? $this->getCookie("_Channel") : 'boys'; 15 + $channelStr = $this->getCookie("_Channel");
  16 + $channel = empty($channelStr) ? 'boys': $channelStr;
16 $this->setWebNavHeader($channel); 17 $this->setWebNavHeader($channel);
17 18
18 //banner-list 19 //banner-list
@@ -158,7 +158,9 @@ class BrandsModel @@ -158,7 +158,9 @@ class BrandsModel
158 158
159 public static function getBrandView($channel) 159 public static function getBrandView($channel)
160 { 160 {
  161 + //获取参数
161 $switchParams = self::switchBrandParams($channel); 162 $switchParams = self::switchBrandParams($channel);
  163 + //取接口数据
162 $brandTop = array(); 164 $brandTop = array();
163 $brandAds = array(); 165 $brandAds = array();
164 $brandList = array(); 166 $brandList = array();
@@ -166,12 +168,10 @@ class BrandsModel @@ -166,12 +168,10 @@ class BrandsModel
166 //头部10个品牌图块 168 //头部10个品牌图块
167 if (isset($res['brandTop'][1]['data']['list']) && $res['brandTop'][1]['data']['list']) { 169 if (isset($res['brandTop'][1]['data']['list']) && $res['brandTop'][1]['data']['list']) {
168 foreach ($res['brandTop'][1]['data']['list'] as $tbk => $tbv) { 170 foreach ($res['brandTop'][1]['data']['list'] as $tbk => $tbv) {
169 - $imgUrlTmp = explode("?", $tbv['src']);  
170 - $urlTmp = explode("?", $tbv['url']);  
171 $topBrandTmp = array( 171 $topBrandTmp = array(
172 'name' => $tbv['name'], 172 'name' => $tbv['name'],
173 - 'src' => Helpers::getImageUrl($imgUrlTmp[0], 80, 50, 3),  
174 - 'url' => str_replace('m.', '', $urlTmp[0]), 173 + 'src' => Helpers::getImageUrl($tbv['src'], 80, 50, 3),
  174 + 'url' => $tbv['url'],
175 ); 175 );
176 $brandAds[$tbk] = $topBrandTmp; 176 $brandAds[$tbk] = $topBrandTmp;
177 } 177 }
@@ -179,18 +179,16 @@ class BrandsModel @@ -179,18 +179,16 @@ class BrandsModel
179 //头部品牌图块 179 //头部品牌图块
180 if (isset($res['brandTop'][0]['data']) && $res['brandTop'][0]['data']) { 180 if (isset($res['brandTop'][0]['data']) && $res['brandTop'][0]['data']) {
181 foreach ($res['brandTop'][0]['data'] as $tk => $tv) { 181 foreach ($res['brandTop'][0]['data'] as $tk => $tv) {
182 - $imgUrlTmp = explode("?", $tv['src']);  
183 - $urlTmp = explode("?", $tv['url']);  
184 $topTmp = array( 182 $topTmp = array(
185 'name' => $tv['title'], 183 'name' => $tv['title'],
186 - 'src' => $imgUrlTmp[0],  
187 - 'url' => $urlTmp[0], 184 + 'src' => Helpers::getImageUrl($tv['src'], 222, 180, 3),
  185 + 'url' => $tv['url'],
188 'items' => $brandAds 186 'items' => $brandAds
189 ); 187 );
190 $brandTop[$tk] = $topTmp; 188 $brandTop[$tk] = $topTmp;
191 } 189 }
192 } 190 }
193 - //品牌list 191 + //品牌list A-Z 0-9
194 if (isset($res['brandList']['brands']) && $res['brandList']['brands']) { 192 if (isset($res['brandList']['brands']) && $res['brandList']['brands']) {
195 foreach ($res['brandList']['brands'] as $lk => $lv) { 193 foreach ($res['brandList']['brands'] as $lk => $lv) {
196 $listTmp = array(); 194 $listTmp = array();
@@ -207,6 +205,10 @@ class BrandsModel @@ -207,6 +205,10 @@ class BrandsModel
207 } 205 }
208 $brandList[$lk] = $listTmp; 206 $brandList[$lk] = $listTmp;
209 } 207 }
  208 + //将brandList里的0-9 排序到最后
  209 + $numBrand['0~9']=$brandList['0~9'];
  210 + unset($brandList['0~9']);
  211 + $brandList+=$numBrand;
210 } 212 }
211 return array( 213 return array(
212 'brandTop' => $brandTop, 214 'brandTop' => $brandTop,
@@ -221,6 +223,11 @@ class BrandsModel @@ -221,6 +223,11 @@ class BrandsModel
221 { 223 {
222 $data = array(); 224 $data = array();
223 $res = BrandData::getBrandIntro($brandId, $uid); 225 $res = BrandData::getBrandIntro($brandId, $uid);
  226 + $condition = array(
  227 + 'viewNum'=>3,
  228 + ''
  229 + );
  230 + \LibModels\Web\Product\SearchData::searchElasticByCondition($condition);
224 if (isset($res['data']) && $res['data']) { 231 if (isset($res['data']) && $res['data']) {
225 $icoUrlTmp = explode("?", $res['data']['brand_ico']) ; 232 $icoUrlTmp = explode("?", $res['data']['brand_ico']) ;
226 $data = array( 233 $data = array(
@@ -4,6 +4,7 @@ use Action\WebAction; @@ -4,6 +4,7 @@ use Action\WebAction;
4 use LibModels\Web\Passport\RegData; 4 use LibModels\Web\Passport\RegData;
5 use LibModels\Web\Passport\LoginData; 5 use LibModels\Web\Passport\LoginData;
6 use Passport\PassportModel as PassportModel; 6 use Passport\PassportModel as PassportModel;
  7 +use Configs\ChannelConfig;
7 use WebPlugin\Helpers; 8 use WebPlugin\Helpers;
8 9
9 class LoginController extends WebAction 10 class LoginController extends WebAction
@@ -26,21 +27,13 @@ class LoginController extends WebAction @@ -26,21 +27,13 @@ class LoginController extends WebAction
26 $simpleHeader = PassportModel::getSimpleHeader(); 27 $simpleHeader = PassportModel::getSimpleHeader();
27 //获取登陆页左侧资源 28 //获取登陆页左侧资源
28 $cover = PassportModel::getLeftBanner(PassportModel::SIGNIN_LEFT_BANNER_CODE); 29 $cover = PassportModel::getLeftBanner(PassportModel::SIGNIN_LEFT_BANNER_CODE);
29 - //是否记住密码  
30 - $isRemember = $this->getCookie('isRemember', FALSE);  
31 - $account = '';  
32 - $password = '';  
33 - if ($isRemember) {  
34 - $account = $this->decrypt($this->getCookie('account', ''));  
35 - $password = $this->decrypt($this->getCookie('userInfo', ''));  
36 - }  
37 //整合 30 //整合
38 $data = array( 31 $data = array(
39 'loginPage' => true, 32 'loginPage' => true,
40 'simpleHeader' => $simpleHeader, 33 'simpleHeader' => $simpleHeader,
41 'passport' => array( 34 'passport' => array(
42 'coverHref' => $cover['url'], 35 'coverHref' => $cover['url'],
43 - 'coverImg' => !empty($cover['img']) ? $cover['img'] : 'http://img12.static.yhbimg.com/yhb-img01/2015/12/01/07/020a0b6e7ff908d0c2bc4045b4fef42b9f.png?imageView/2/w/252/h/190', 36 + 'coverImg' => empty($cover['img']) ? ChannelConfig::$leftDefaultImg : $cover['img'],
44 'countryCode' => '+86', 37 'countryCode' => '+86',
45 'countryName' => '中国', 38 'countryName' => '中国',
46 'countryList' => RegData::getAreasData(), 39 'countryList' => RegData::getAreasData(),
@@ -52,9 +45,6 @@ class LoginController extends WebAction @@ -52,9 +45,6 @@ class LoginController extends WebAction
52 'alipayLogin' => Helpers::url('/passport/autosign/alipay'), 45 'alipayLogin' => Helpers::url('/passport/autosign/alipay'),
53 'doubanLogin' => Helpers::url('/passport/autosign/douban'), 46 'doubanLogin' => Helpers::url('/passport/autosign/douban'),
54 'renrenLogin' => Helpers::url('/passport/autosign/renren'), 47 'renrenLogin' => Helpers::url('/passport/autosign/renren'),
55 - 'isRemember' => $isRemember,  
56 - 'password' => $password,  
57 - 'account' => $account  
58 ), 48 ),
59 ); 49 );
60 50
@@ -83,7 +73,6 @@ class LoginController extends WebAction @@ -83,7 +73,6 @@ class LoginController extends WebAction
83 $area = trim($this->post('areaCode', '86')); 73 $area = trim($this->post('areaCode', '86'));
84 $account = trim($this->post('account')); 74 $account = trim($this->post('account'));
85 $password = trim($this->post('password')); 75 $password = trim($this->post('password'));
86 - $isRemember = trim($this->post('isRemember'));  
87 if (!is_numeric($area) || empty($account) || empty($password)) { 76 if (!is_numeric($area) || empty($account) || empty($password)) {
88 break; 77 break;
89 } 78 }
@@ -103,7 +92,6 @@ class LoginController extends WebAction @@ -103,7 +92,6 @@ class LoginController extends WebAction
103 } 92 }
104 93
105 /* 调用登录接口进行登录 */ 94 /* 调用登录接口进行登录 */
106 - // 获取未登录时的唯一识别码  
107 $shoppingKey = Helpers::getShoppingKeyByCookie(); 95 $shoppingKey = Helpers::getShoppingKeyByCookie();
108 $data = LoginData::signin($area, $account, $password, $shoppingKey); 96 $data = LoginData::signin($area, $account, $password, $shoppingKey);
109 if (!isset($data['code']) || $data['code'] != 200 || !isset($data['data']['uid'])) { 97 if (!isset($data['code']) || $data['code'] != 200 || !isset($data['data']['uid'])) {