Authored by hf

modify to add production cache config

... ... @@ -224,7 +224,7 @@ class AbstractAction extends Controller_Abstract
*/
protected function setTitle($title)
{
$this->_view->assign('title', $title);
$this->_view->assign('title', $title . ' | ');
}
/**
... ... @@ -235,7 +235,7 @@ class AbstractAction extends Controller_Abstract
*/
protected function setKeywords($keywords)
{
$this->_view->assign('keywords', $keywords);
$this->_view->assign('keywords', rtrim($keywords, ',') . ',');
}
/**
... ...
... ... @@ -86,10 +86,11 @@ class PlusstarData
$result['getArticleByBrand'] = array();
// 品牌详情信息
$brandInfo = Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_BRANDINFO_PLUSSTAR, 'getBrandInfo', array(array('id' => $id)) );
$brandInfo = Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_BRANDINFO_PLUSSTAR, 'getBrandInfo', array(array('id' => $id)));
if (!isset($brandInfo['data']['brand_id'])) {
return $result;
} else {
}
else {
$result['getBrandInfo'] = $brandInfo;
}
... ... @@ -127,24 +128,33 @@ class PlusstarData
}
$skn = '';
$i = 0;
foreach ($newProduct['data']['product_list'] as $value) {
// 最多6个
if ($i > 5) {
break;
}
if (empty($value['goods_list'])) {
continue;
}
// 商品信息列表
$result['getNewProduct'][] = Helpers::formatProduct($value);
$result['getNewProduct'][$i] = Helpers::formatProduct($value);
// 用户是否收藏该商品
$skn = $value['product_skn'];
$result['getUidProductFav'][ $skn ] = false;
$result['getUidProductFav'][$skn] = false;
if ($isUidOk) {
Yohobuy::yarConcurrentCall(Yohobuy::SERVICE_URL . self::URI_BRANDINFO_FAVORITE, 'getUidProductFav', array($uid, $value['product_skn']), function($retval) use(&$result,&$skn) {
$result['getUidProductFav'][ $skn ] = empty($retval['data']) ? false : $retval['data'];
Yohobuy::yarConcurrentCall(Yohobuy::SERVICE_URL . self::URI_BRANDINFO_FAVORITE, 'getUidProductFav', array($uid, $value['product_skn']), function($retval) use(&$result, &$skn) {
$result['getUidProductFav'][$skn] = empty($retval['data']) ? false : $retval['data'];
});
}
$i ++;
}
}
} while (false);
while (false);
// 调用发起请求
Yohobuy::yarConcurrentLoop();
... ...
... ... @@ -98,11 +98,11 @@ class Helpers
// 判断是否显示作者信息
if ($showAuthor) {
$result['author'] = $articleData['author'];
$result['author'] = empty($articleData['author']) ? false : $articleData['author'];
}
// 模板中需要的标签标识
if ($showTag) {
if ($showTag && isset($articleData['category_id'])) {
switch (strval($articleData['category_id'])) {
case '1': // 话题
$result['isTopic'] = true;
... ...
... ... @@ -2,9 +2,9 @@
<html>
<head>
<meta charset="utf-8">
<title>{{title}}</title>
<meta name="keywords" content="{{keywords}}">
<meta name="description" content="{{description}}">
<title>{{title}}YOHO!有货</title>
<meta name="keywords" content="{{keywords}}Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款">
<meta name="description" content="{{description}}YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta http-equiv="cleartype" content="on">
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
... ... @@ -22,17 +22,15 @@
}());
})(document, window);
</script>
{{#if rlsEnv}}
{{#if rlsEnv}}
<link rel="stylesheet" href="http://cdn.yoho.cn/myohobuy/{{version}}/index.css">
{{/if}}
{{#if rlsEnv}}
{{/if}}
{{#if devEnv}}
{{/if}}
{{#if testEnv}}
<link rel="stylesheet" href="http://static.wap.yohobuy.com/css/index.css">
{{/if}}
{{#if devEnv}}
<link rel="stylesheet" href="http://static.dev.yohobuy.com/css/index.css">
{{/if}}
{{/if}}
</head>
<body {{#if isPassportPage}}class=passport-body{{/if}}>
{{> layout/page_header}}
\ No newline at end of file
... ...
... ... @@ -101,6 +101,7 @@ class RecomController extends AbstractAction
/**
* 你可能喜欢的创意生活的新品到着和人气单品列表
*
* @param int page 分页的页码
* @return html
*/
public function maylikelifeAction()
... ... @@ -111,12 +112,6 @@ class RecomController extends AbstractAction
break;
}
/* 判断分页参数是否有效 */
$page = $this->get('page', 1);
if (!is_numeric($page)) {
break;
}
/* 取可能喜欢的数据 */
$recom = RecomData::mayLikeLifestyle();
if (empty($recom['data']['product_list'])) {
... ...
... ... @@ -42,7 +42,7 @@ class PlusstarController extends AbstractAction
// 情况1: 多张图
if (isset($star['data'][1])) {
foreach ($star['data'] as $value) {
$build['url'] = $value['url'];
$build['url'] = '/guang/plusstar/detail?id=' . $star['id'] . '&gender='.$gender;
$build['img'] = Helpers::getImageUrl($value['src'], 640, 310);
$imgs[] = $build;
}
... ... @@ -50,7 +50,7 @@ class PlusstarController extends AbstractAction
}
// 情况2: 单张图
elseif (isset($star['data'][0])) {
$build['url'] = $star['data'][0]['url'];
$build['url'] = '/guang/plusstar/detail?id=' . $star['id'] . '&gender='.$gender;
$build['img'] = Helpers::getImageUrl($star['data'][0]['src'], 640, 310);
$data['ps']['star'][] = $build;
}
... ... @@ -66,7 +66,7 @@ class PlusstarController extends AbstractAction
// 情况1: 多张图
if (isset($original['data'][1])) {
foreach ($original['data'] as $value) {
$build['url'] = $value['url'];
$build['url'] = '/guang/plusstar/detail?id=' . $original['id'] . '&gender='.$gender;
$build['img'] = Helpers::getImageUrl($value['src'], 640, 310);
$build['deps'] = $original['brand_title'];
$imgs[] = $build;
... ... @@ -75,7 +75,7 @@ class PlusstarController extends AbstractAction
}
// 情况2: 单张图
elseif (isset($original['data'][0])) {
$build['url'] = $original['data'][0]['url'];
$build['url'] = '/guang/plusstar/detail?id=' . $original['id'] . '&gender='.$gender;
$build['img'] = Helpers::getImageUrl($original['data'][0]['src'], 640, 310);
$build['deps'] = $original['brand_title'];
$data['ps']['plus'][] = $build;
... ... @@ -98,8 +98,8 @@ class PlusstarController extends AbstractAction
$id = $this->get('id');
$gender = $this->get('gender', '1,3');
$uid = 0; // @todo
$udid = null; // @todo
$uid = $this->getUid();
$udid = $this->getUdid();
do {
/* 判断参数是否有效 */
... ... @@ -109,20 +109,20 @@ class PlusstarController extends AbstractAction
/* 判断品牌信息是否为空 */
$brandInfo = PlusstarData::brandInfo($id, $gender, $uid, $udid);
if (empty($brandInfo['getBrandInfo']['brand_id'])) {
if (empty($brandInfo['getBrandInfo']['data']['brand_id'])) {
break;
}
$data['psDetail'] = true;
$data['ps']['id'] = $brandInfo['getBrandInfo']['brand_id'];
$data['ps']['banner'] = Helpers::getImageUrl($brandInfo['getBrandInfo']['cover_img'], 640, 309);
$data['ps']['logo'] = Helpers::getImageUrl($brandInfo['getBrandInfo']['brand_ico'], 160, 160);
$data['ps']['name'] = $brandInfo['getBrandInfo']['brand_name'];
$data['ps']['id'] = $brandInfo['getBrandInfo']['data']['brand_id'];
$data['ps']['banner'] = Helpers::getImageUrl($brandInfo['getBrandInfo']['data']['cover_img'], 640, 309);
$data['ps']['logo'] = Helpers::getImageUrl($brandInfo['getBrandInfo']['data']['brand_ico'], 160, 160);
$data['ps']['name'] = $brandInfo['getBrandInfo']['data']['brand_name'];
$data['ps']['isLike'] = $brandInfo['getUidBrandFav'];
$data['ps']['likeUrl'] = "http://guang.m.yohobuy.com/plustar/brandinfo?id=285&amp;openby:yohobuy={&quot;action&quot;:&quot;go.weblogin&quot;,&quot;params&quot;:{&quot;jumpurl&quot;:{&quot;url&quot;:&quot;http:\/\/guang.m.yohobuy.com\/plustar\/brandinfo&quot;,&quot;param&quot;:{&quot;id&quot;:285}},&quot;requesturl&quot;:{&quot;url&quot;:&quot;\/guang\/api\/v1\/favorite\/togglebrand&quot;,&quot;param&quot;:{&quot;brand_id&quot;:&quot;701&quot;}},&quot;priority&quot;:&quot;Y&quot;}}";
$data['ps']['intro'] = empty($brandInfo['getBrandInfo']['brand_intro']) ? '' : strtr(strip_tags($brandInfo['getBrandInfo']['brand_intro']), 'nbsp;', ' ');
$data['ps']['likeUrl'] = false; //"http://guang.m.yohobuy.com/plustar/brandinfo?id=285&amp;openby:yohobuy={&quot;action&quot;:&quot;go.weblogin&quot;,&quot;params&quot;:{&quot;jumpurl&quot;:{&quot;url&quot;:&quot;http:\/\/guang.m.yohobuy.com\/plustar\/brandinfo&quot;,&quot;param&quot;:{&quot;id&quot;:285}},&quot;requesturl&quot;:{&quot;url&quot;:&quot;\/guang\/api\/v1\/favorite\/togglebrand&quot;,&quot;param&quot;:{&quot;brand_id&quot;:&quot;701&quot;}},&quot;priority&quot;:&quot;Y&quot;}}";
$data['ps']['intro'] = empty($brandInfo['getBrandInfo']['data']['brand_intro']) ? '' : strtr(strip_tags($brandInfo['getBrandInfo']['data']['brand_intro']), array('&nbsp;' => ' ') );
$data['ps']['newArrival'] = array();
$data['ps']['newArrival']['moreUrl'] = ''; // @todo
$data['ps']['newArrival']['moreUrl'] = ''; // @todo 品牌列表页面
$data['ps']['newArrival']['naList'] = $brandInfo['getNewProduct'];
$data['ps']['infos'] = array();
... ... @@ -131,24 +131,8 @@ class PlusstarController extends AbstractAction
}
// 相关文章
$build = array();
foreach ($brandInfo['getArticleByBrand'] as $value) {
$build = array();
$build['id'] = $value['id'];
$build['showTags'] = false; // 不显示标签
$build['img'] = Helpers::getImageUrl($value['src'], 640, 640, $value['cover_image_type']);
$build['url'] = $value['url']; // @todo
$build['title'] = $value['title'];
$build['text'] = $value['intro'];
$build['publishTime'] = $value['publish_time'];
$build['pageView'] = $value['views_num'];
$build['like'] = array();
$build['like']['isLiked'] = $value['like']['isLiked'];
$build['like']['count'] = $value['like']['count'];
$build['share'] = ''; //分享链接
$build['author'] = false; // 作者信息(接口暂未上线)
$data['ps']['infos'][] = $build;
$data['ps']['infos'][] = Helpers::formatArticle($value, false, false, false);
}
$brandInfo = array();
... ...
... ... @@ -2,7 +2,8 @@
use Action\AbstractAction;
use LibModels\Wap\Passport\BackData;
use Hood\Core\Security\AuthCode;
use LibModels\Wap\Passport\RegData;
/**
* 频道选择
*/
... ... @@ -11,14 +12,17 @@ class BackController extends AbstractAction
public function emailAction()
{
$this->setTitle('找回密码-通过邮箱');
$data = array(
'backUrl' => '/passport/login/index',
'backUrl' => '/signin.html',
'headerText' => '找回密码',
'isPassportPage' => true,
'backEmail' => true
);
$this->_view->assign('title', 'YOHO!有货');
// 生成HTML (emailback.html)
$this->_view->html('emailback');
$this->_view->display('email', $data);
}
... ... @@ -60,13 +64,15 @@ class BackController extends AbstractAction
public function successAction()
{
$this->setTitle('找回密码-通过邮箱');
$email = $this->get('email', '');
// 获取到邮箱域名
$pattern = "/^([0-9A-Za-z\\-_\\.]+)@([0-9a-z]+\\.[a-z]{2,3}(\\.[a-z]{2})?)$/i";
$domain_name = 'http://mail.'.preg_replace( $pattern ,"$2", $email );
$data = array(
'backUrl' => '/passport/back/email',
'backUrl' => 'emailback.html',
'headerText' => '找回密码',
'isPassportPage' => true,
'backEmailSuccess' => true,
... ... @@ -74,7 +80,6 @@ class BackController extends AbstractAction
'resendUrl' => '/passport/back/resendemail?email='.$email
);
$this->_view->assign('title', 'YOHO!有货');
$this->_view->display('email-success', $data);
}
... ... @@ -99,42 +104,20 @@ class BackController extends AbstractAction
public function mobileAction()
{
// 获取地区信息
$areas = array();
$areaDatas = $data = BackData::getAreasData();
if($areaDatas['code'] == 200)
{
$areas = $areaDatas['data'];
}
// 处理地区信息
foreach ($areas as &$val) {
$val['areaCode'] = '+'.$val['area'];
if($val['area'] === '86')
{
$val['selected'] = true;
}
unset($val['area']);
}
/*// 排序
uasort($areas, function($a, $b) {
if($a['id'] === $b['id'])
{
return 0;
}
return ($a['id'] < $b['id'] ? -1 : 1);
});*/
$this->setTitle('找回密码-通过手机号');
$data = array(
'backUrl' => '/passport/login/index',
'backUrl' => '/signin.html',
'headerText' => '找回密码',
'isPassportPage' => true,
'backMobile' => true,
'countrys' => $areas,
'countrys' => RegData::getAreasData(),
'countryCode' => '+86'
);
$this->_view->assign('title', 'YOHO!有货');
// 生成HTML (mobileback.html)
$this->_view->html('mobileback.html');
$this->_view->display('mobile', $data);
}
... ... @@ -169,7 +152,7 @@ class BackController extends AbstractAction
$areaCode = '+'.$areaCode;
$data = array(
'backUrl' => '/passport/back/mobile',
'backUrl' => '/mobileback.html',
'headerText' => '找回密码',
'isPassportPage' => true,
'backCode' => true,
... ...
... ... @@ -25,9 +25,9 @@ class LoginController extends AbstractAction
'showHeaderImg' => true, // 控制显示头部图片
'isPassportPage' => true, // 模板中模块标识
'registerUrl' => '/reg.html', // 注册的URL链接
'aliLoginUrl' => '/passport/login/alipay', // 注册的URL链接
'weiboLoginUrl' => '/passport/login/sina', // 注册的URL链接
'qqLoginUrl' => '/passport/login/qq', // 注册的URL链接
'aliLoginUrl' => '/passport/login/alipay', // 支付宝快捷登录的URL链接
'weiboLoginUrl' => '/passport/login/sina', // 微博登录的URL链接
'qqLoginUrl' => '/passport/login/qq', // 腾讯QQ登录的URL链接
'interationalUrl' => '/login.html', // 国际号登录的URL链接
'phoneRetriveUrl' => '/phoneback.html', // 通过手机号找回密码的URL链接
'emailRetriveUrl' => '/emailback.html', // 通过邮箱找回密码的URL链接
... ...
[common]
servers.host = 127.0.0.1:11211:90
[memcached:common]
servers.hosts = 127.0.0.1:11212:90,127.0.0.1:11213:10
[memcached]
master.hosts=10.170.182.9:12111,10.172.169.31:12111,10.173.8.214:12111
slave.hosts=10.170.182.9:12112,10.172.169.31:12112,10.173.8.214:12112
[redis]
servers.hosts = 127.0.0.1:6379
\ No newline at end of file
servers.hosts=127.0.0.1:6379
\ No newline at end of file
... ...