Authored by xiaowei

代码审核修改

... ... @@ -300,4 +300,7 @@ class ChannelConfig
'sale' => array('domain' =>'sale','module' => 's'),//sale.yohobuy.com
);
//左侧广告默认图片-passport相关页面
public static $leftDefaultImg = 'http://img12.static.yhbimg.com/yhb-img01/2015/12/01/07/020a0b6e7ff908d0c2bc4045b4fef42b9f.png?imageView/2/w/252/h/190';
}
\ No newline at end of file
... ...
... ... @@ -105,7 +105,7 @@ class BrandData
}
/*
* 品牌一览资源位banner
* 品牌一览资源位banner-PC
* @param string $contentCode 获取广告资源需要的位置码
* @param int $channel 频道标识 1:男,2:女,3:潮童,4:创意生活
* @return array(
... ... @@ -113,12 +113,13 @@ class BrandData
* "brandList": "按字母'A-Z'分组的品牌列表数据"
* )
*/
public static function getTopBanner($contentCode,$channel)
public static function getTopBanner($contentCode, $channel,$clientType='web')
{
/* 顶部的轮翻广告及热门品牌数据 */
$param = Yohobuy::param();
$param['content_code'] = $contentCode;
$param['client_type'] = $clientType;
$param['private_key'] = Yohobuy::$privateKeyList[$clientType];
$param['client_secret'] = Sign::getSign($param);
$urlList['brandTop'] = Yohobuy::httpBuildQuery(Yohobuy::SERVICE_URL . self::URI_BRAND_TOPPOS, $param);
... ... @@ -129,8 +130,7 @@ class BrandData
$param['client_secret'] = Sign::getSign($param);
$urlList['brandList'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $param);
return Yohobuy::getMulti($urlList, array(), 3600); // 有缓存1小时
return Yohobuy::getMulti($urlList,array(),3600);
}
}
... ...
... ... @@ -12,7 +12,8 @@ class BrandsController extends WebAction
public function brandsAction()
{
//品牌一览头部
$channel = $this->getCookie("_Channel") ? $this->getCookie("_Channel") : 'boys';
$channelStr = $this->getCookie("_Channel");
$channel = empty($channelStr) ? 'boys': $channelStr;
$this->setWebNavHeader($channel);
//banner-list
... ...
... ... @@ -158,7 +158,9 @@ class BrandsModel
public static function getBrandView($channel)
{
//获取参数
$switchParams = self::switchBrandParams($channel);
//取接口数据
$brandTop = array();
$brandAds = array();
$brandList = array();
... ... @@ -166,12 +168,10 @@ class BrandsModel
//头部10个品牌图块
if (isset($res['brandTop'][1]['data']['list']) && $res['brandTop'][1]['data']['list']) {
foreach ($res['brandTop'][1]['data']['list'] as $tbk => $tbv) {
$imgUrlTmp = explode("?", $tbv['src']);
$urlTmp = explode("?", $tbv['url']);
$topBrandTmp = array(
'name' => $tbv['name'],
'src' => Helpers::getImageUrl($imgUrlTmp[0], 80, 50, 3),
'url' => str_replace('m.', '', $urlTmp[0]),
'src' => Helpers::getImageUrl($tbv['src'], 80, 50, 3),
'url' => $tbv['url'],
);
$brandAds[$tbk] = $topBrandTmp;
}
... ... @@ -179,18 +179,16 @@ class BrandsModel
//头部品牌图块
if (isset($res['brandTop'][0]['data']) && $res['brandTop'][0]['data']) {
foreach ($res['brandTop'][0]['data'] as $tk => $tv) {
$imgUrlTmp = explode("?", $tv['src']);
$urlTmp = explode("?", $tv['url']);
$topTmp = array(
'name' => $tv['title'],
'src' => $imgUrlTmp[0],
'url' => $urlTmp[0],
'src' => Helpers::getImageUrl($tv['src'], 222, 180, 3),
'url' => $tv['url'],
'items' => $brandAds
);
$brandTop[$tk] = $topTmp;
}
}
//品牌list
//品牌list A-Z 0-9
if (isset($res['brandList']['brands']) && $res['brandList']['brands']) {
foreach ($res['brandList']['brands'] as $lk => $lv) {
$listTmp = array();
... ... @@ -207,6 +205,10 @@ class BrandsModel
}
$brandList[$lk] = $listTmp;
}
//将brandList里的0-9 排序到最后
$numBrand['0~9']=$brandList['0~9'];
unset($brandList['0~9']);
$brandList+=$numBrand;
}
return array(
'brandTop' => $brandTop,
... ... @@ -221,6 +223,11 @@ class BrandsModel
{
$data = array();
$res = BrandData::getBrandIntro($brandId, $uid);
$condition = array(
'viewNum'=>3,
''
);
\LibModels\Web\Product\SearchData::searchElasticByCondition($condition);
if (isset($res['data']) && $res['data']) {
$icoUrlTmp = explode("?", $res['data']['brand_ico']) ;
$data = array(
... ...
... ... @@ -4,6 +4,7 @@ use Action\WebAction;
use LibModels\Web\Passport\RegData;
use LibModels\Web\Passport\LoginData;
use Passport\PassportModel as PassportModel;
use Configs\ChannelConfig;
use WebPlugin\Helpers;
class LoginController extends WebAction
... ... @@ -26,21 +27,13 @@ class LoginController extends WebAction
$simpleHeader = PassportModel::getSimpleHeader();
//获取登陆页左侧资源
$cover = PassportModel::getLeftBanner(PassportModel::SIGNIN_LEFT_BANNER_CODE);
//是否记住密码
$isRemember = $this->getCookie('isRemember', FALSE);
$account = '';
$password = '';
if ($isRemember) {
$account = $this->decrypt($this->getCookie('account', ''));
$password = $this->decrypt($this->getCookie('userInfo', ''));
}
//整合
$data = array(
'loginPage' => true,
'simpleHeader' => $simpleHeader,
'passport' => array(
'coverHref' => $cover['url'],
'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',
'coverImg' => empty($cover['img']) ? ChannelConfig::$leftDefaultImg : $cover['img'],
'countryCode' => '+86',
'countryName' => '中国',
'countryList' => RegData::getAreasData(),
... ... @@ -52,9 +45,6 @@ class LoginController extends WebAction
'alipayLogin' => Helpers::url('/passport/autosign/alipay'),
'doubanLogin' => Helpers::url('/passport/autosign/douban'),
'renrenLogin' => Helpers::url('/passport/autosign/renren'),
'isRemember' => $isRemember,
'password' => $password,
'account' => $account
),
);
... ... @@ -83,7 +73,6 @@ class LoginController extends WebAction
$area = trim($this->post('areaCode', '86'));
$account = trim($this->post('account'));
$password = trim($this->post('password'));
$isRemember = trim($this->post('isRemember'));
if (!is_numeric($area) || empty($account) || empty($password)) {
break;
}
... ... @@ -103,7 +92,6 @@ class LoginController extends WebAction
}
/* 调用登录接口进行登录 */
// 获取未登录时的唯一识别码
$shoppingKey = Helpers::getShoppingKeyByCookie();
$data = LoginData::signin($area, $account, $password, $shoppingKey);
if (!isset($data['code']) || $data['code'] != 200 || !isset($data['data']['uid'])) {
... ...