Authored by hf

do fixes bug to product detail page

... ... @@ -99,14 +99,13 @@ class NewsaleData
$param['method'] = 'app.search.newProduct';
} else {
$param['method'] = 'app.search.sales';
$param['p_d'] = '0.1,0.9';
$param['p_d'] = '0.1,0.9';
}
$param['page'] = $page;
$param['limit'] = $limit;
$param['order'] = $order;
$param['yh_channel'] = $channel;
$param = array_merge($param, $queriedParams);
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param, 600); // 缓存10分钟
... ...
... ... @@ -508,6 +508,7 @@ class Helpers
} elseif ($vo['goods_type'] == 'price_gift') {
$arr[$key]['advanceBuy'] = true;
}
// 上市期
if (!empty($vo['expect_arrival_time'])) {
$arr[$key]['appearDate'] = $vo['expect_arrival_time'];
}
... ...
... ... @@ -36,26 +36,26 @@
<div class="my-order">
<div class="order-title">
我的订单
<a class="iconfont" href="/home/order">
<a class="iconfont" href="/home/orders">
查看全部订单 &#xe604;
</a>
</div>
<div class="order-type clearfix">
<a class="type-item" href="/home/order?type=2">
<a class="type-item" href="/home/orders?type=2">
<span class="iconfont">&#xe634;</span>
<br>待付款
{{#if wait_pay_num}}
<span class="num">{{wait_pay_num}}</span>
{{/if}}
</a>
<a class="type-item" href="/home/order?type=3">
<a class="type-item" href="/home/orders?type=3">
<span class="iconfont">&#xe63b;</span>
<br>待发货
{{#if wait_cargo_num}}
<span class="num">{{wait_cargo_num}}</span>
{{/if}}
</a>
<a class="type-item" href="/home/order?type=4">
<a class="type-item" href="/home/orders?type=4">
<span class="iconfont">&#xe633;</span>
<br>待收货
{{#if send_cargo_num}}
... ...
... ... @@ -24,9 +24,6 @@ class ErrorController extends AbstractAction
header('HTTP/1.1 404 Not Found');
header('Status: 404 Not Found');
// @todo debug
//echo $exception->getMessage();
// 设置网站标题
$this->setTitle('页面不存在');
$this->setNavHeader('抱歉,页面不存在!', true, SITE_MAIN);
... ...
... ... @@ -636,7 +636,7 @@ class HomeController extends AbstractAction
*
*/
public function orderAction()
public function ordersAction()
{
// 审判跳转登录页
$this->auditJumpLogin();
... ...
... ... @@ -95,7 +95,7 @@ class DetailModel
// 上市期
if (isset($baseInfo['expectArrivalTime']) && !empty($baseInfo['expectArrivalTime'])) {
$result['periodOfMarket'] = date('n', $baseInfo['expectArrivalTime']) . '月';
$result['periodOfMarket'] = $baseInfo['expectArrivalTime'] . '月';
}
// 促销信息
... ... @@ -103,7 +103,6 @@ class DetailModel
$build = array();
foreach ($baseInfo['promotionBoList'] as $value) {
$build['text'] = $value['promotionTitle'];
//$build['type'] = $value['promotionType'];
$result['goodsDiscount']['list'][] = $build;
}
}
... ... @@ -138,7 +137,7 @@ class DetailModel
foreach ($baseInfo['commentBoWrapper']['commentBoList'] as $value) {
$build['userName'] = $value['nickName'];
$build['desc'] = $value['colorName'] . '/' . $value['sizeName'];
$build['content'] = $value['content'];
$build['content'] = isset($value['content']) ? $value['content'] : '';
$build['time'] = $value['createTime'];
$result['feedbacks']['comments'][] = $build;
}
... ... @@ -286,7 +285,24 @@ class DetailModel
'enTitle' => 'SIZE INFO',
'detail' => array('list' => array()),
);
/* 参考尺码 */
$boyReference = !empty($sizeInfo['productExtra']['boyReference']);
$girlReference = !empty($sizeInfo['productExtra']['girlReference']);
$gender = isset($sizeInfo['gender']) ? $sizeInfo['gender'] : 3;
$referenceName = '参考尺码';
if (($gender == 1 && $boyReference) || ($gender == 2 && $girlReference) ) {
$referenceName = '参考尺码';
}
elseif ($gender == 3 && $boyReference) {
$referenceName = '参考尺码(男)';
}
elseif ($gender == 3 && $girlReference) {
$referenceName = '参考尺码(女)';
}
$showReference = false;
$sizeNameList = array(0 => array('param' => '吊牌尺码')); // 尺码名称
$referenceList = array();
$sizeBoGroup = array(); // 尺码按ID分组
foreach ($sizeInfo['sizeInfoBo']['sizeAttributeBos'] as $attr) {
$sizeBoGroup[$attr['id']][0] = array('param' => $attr['attributeName']);
... ... @@ -464,8 +480,8 @@ class DetailModel
if (is_numeric($productSkn)) {
$preference = DetailData::preference($productSkn, $channel, $brandId);
if (!empty($preference['data'])) {
foreach ($preference['data'] as $value) {
if (!empty($preference)) {
foreach ($preference as $value) {
$result['recommendList'][] = Helpers::formatProduct($value, false, true, true, 299, 388, false, false);
}
}
... ...
... ... @@ -225,11 +225,10 @@ class LoginController extends AbstractAction
{
$sina = Factory::create('sinaweibo');
$access = $sina->getAccessToken();
/* 获取QQ腾讯用户的详细信息 */
/* 获取用户的详细信息 */
$partnerInfo = $sina->getUserInfo($access);
$result = array();
if ($partnerInfo && is_array($partnerInfo)) {
$result = LoginData::signinByOpenID($partnerInfo['screen_name'], $access['uid'], 'sina');
}
... ...
... ... @@ -124,7 +124,7 @@ class DetailController extends AbstractAction
'consults' => array(
'list' => \Product\DetailModel::getConsults($productId),
),
'consultUrl' => Helpers::url('/product/detail/consultform'),
'link' => Helpers::url('/product/detail/consultform', array('product_id' => $productId)),
);
// 渲染模板
... ... @@ -186,7 +186,7 @@ class DetailController extends AbstractAction
$result = array();
if ($this->isAjax()) {
$productSkn = $this->get('productSkn'); // 50000058
$productSkn = $this->get('productSkn');
$brandId = $this->get('brandId');
$channel = Helpers::getChannelByCookie();
$result = \Product\DetailModel::getPreference($productSkn, $channel, $brandId);
... ...
... ... @@ -187,7 +187,6 @@ class NewsaleController extends AbstractAction
$order = Helpers::transOrder($orderVal, $type);
$channel = Helpers::getChannelByCookie();
$data = NewsaleData::selectNewSaleProducts(
$gender, $brand, $sort, $color, $size, $price, $p_d, $channel, $dayLimit, $limit, $page, $order
);
... ...