Authored by 梁志锋

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

... ... @@ -18,23 +18,23 @@ class Yohobuy
{
/* 正式环境 */
// const API_URL = 'http://api2.open.yohobuy.com/';
// const API_URL2 = 'http://api.open.yohobuy.com/';
// const SERVICE_URL = 'http://service.api.yohobuy.com/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
/**const API_URL = 'http://api2.open.yohobuy.com/';
const API_URL2 = 'http://api.open.yohobuy.com/';
const SERVICE_URL = 'http://service.api.yohobuy.com/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';**/
// const API_URL = 'http://apih5.yoho.cn/';
// const API_URL2 = 'http://apih5.yoho.cn/';
// const SERVICE_URL = 'http://serviceh5.yoho.cn/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
// const API_OLD = 'http://api2.open.yohobuy.com/';
const API_URL = 'http://apih5.yoho.cn/';
const API_URL2 = 'http://apih5.yoho.cn/';
const SERVICE_URL = 'http://serviceh5.yoho.cn/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
const API_OLD = 'http://api2.open.yohobuy.com/';
// /* 测试环境 */
// const API_URL = 'http://192.168.102.205:8080/gateway/'; // 先临时使用网关
const API_URL = 'http://testapi.yoho.cn:28078/';
/* const API_URL = 'http://testapi.yoho.cn:28078/';
const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
const API_OLD = 'http://test2.open.yohobuy.com/';
const API_OLD = 'http://test2.open.yohobuy.com/';*/
/* 预览环境 */
// const API_URL = 'http://preapi.yoho.cn/';
... ...
... ... @@ -39,7 +39,10 @@ class DetailData
} elseif ($productSkn !== null) {
$param['product_skn'] = $productSkn;
}
$param['uid'] = $uid;
if (!empty($uid)) {
$param['uid'] = $uid;
}
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
... ...
... ... @@ -189,8 +189,8 @@ class Helpers
* @return float|string 转换之后的价格
*/
public static function transPrice($price)
{
return !empty($price) ? number_format($price, 2, '.', '') : 0;
{
return !empty($price) ? number_format($price, 2, '.', '') : 0;
}
/**
... ... @@ -218,9 +218,23 @@ class Helpers
$productData['market_price'] = false;
}
// 如果$productData['default_images']为空,就取$productData['goods_list']中第一个,为空就不处理
if (empty($productData['default_images'])) {
$productData['default_images'] = $productData['goods_list'][0]['images_url'];
$flag = false; // 判别默认的商品是否将默认的图片URL赋值到skn
$firstGood = array(); // 第一个skc产品
// 如果设置了默认图片,就取默认的图片
foreach ($productData['goods_list'] as $oneGoods) {
if (empty($firstGood)) {
$firstGood = $oneGoods;
}
// 此skc是默认的,则将图片赋值给skn
if ($oneGoods['is_default'] === 'Y') {
$productData['default_images'] = self::procProductImg($oneGoods);
$flag = true;
}
}
// 如果还未赋值,则取第一个skc产品的默认图片
if (!$flag && !empty($firstGood)) {
$productDatap['default_images'] = self::procProductImg($firstGood);
}
$result = array();
... ... @@ -272,6 +286,25 @@ class Helpers
}
/**
* 根据性别来决定 默认图片获取字段 如果是 2、3 则优先从cover2 --》 cover1 -- 》 images_url
* 否则优先从cover1 --》 cover2 -- 》 images_url
* @param array $images
* @return string 商品图片
*/
private static function procProductImg($images)
{
$imgUrl = isset($images['images_url']) ? $images['images_url'] : '';
$cover1 = isset($images['cover_1']) ? $images['cover_1'] : '';
$cover2 = isset($images['cover_2']) ? $images['cover_2'] : '';
$gender = self::getGenderByCookie();
if ($gender === '2,3') {
return !empty($cover2) ? $cover2 : (!empty($cover1) ? $cover1 : $imgUrl);
} else {
return !empty($cover1) ? $cover1 : (!empty($cover2) ? $cover2 : $imgUrl);
}
}
/**
* 格式化资讯文章
*
* @param array $articleData 需要格式化的资讯数据
... ...
... ... @@ -437,6 +437,7 @@ define("js/category/brand", ["jquery","hammer","swiper","lazyload","index"], fun
var $ = require("jquery"),
Hammer = require("hammer"),
Swiper = require("swiper"),
loading = require("js/plugin/loading"),
lazyLoad = require("lazyload");
var swiper,
... ... @@ -444,6 +445,7 @@ var swiper,
$brandList = $('.brand-list'),
$icon = $('.search-icon'),
$genderItem = $('.genderNav li'),
$searchAction = $('.search-action'),
hotBrandsSwiper;
var searchH = $('.newbrand-search').outerHeight(),
... ... @@ -455,6 +457,8 @@ var brandsData,
$keyword,
clearTextHammer;
loading.showLoadingMask();
//热门品牌滑动
hotBrandsSwiper = new Swiper('.brands-swiper', {
grabCursor: true,
... ... @@ -477,9 +481,14 @@ $('.yoho-header').css({
top: 0
});
if ($('.banner-top').length > 0) {
$('.hot-brands').css('padding-top', '0');
}
(function() {
if ($('.banner-top').length > 0) {
$('.hot-brands').css('padding-top', '0');
}
$('.hide-when-loading').show();
loading.hideLoadingMask();
})();
$fixTitleBar = $('<div class="title-bar fixed-title-bar"><h2></h2></div>');
$fixTitleBar.css({
... ... @@ -586,20 +595,25 @@ if ($('.brand-search-page').length) {
if ($keyword.val().length) {
$icon.css('color', '#000');
$(this).closest('.search-box').css('width', '11.25rem');
$('.search-action').show();
$searchAction.show().find('.clear-text').show();
} else {
$icon.css('color', '#b2b2b2');
$(this).closest('.search-box').css('width', '12.5rem');
$('.search-action').hide();
$searchAction.hide();
}
searchResult();
}).focus();
// 2016.1.13 产品(高扬)要求进入页面默认显示取消按钮
$icon.css('color', '#000');
$keyword.closest('.search-box').css('width', '11.25rem');
$searchAction.show().find('.clear-text').hide();
clearTextHammer = new Hammer($('.clear-text')[0]);
clearTextHammer.on('tap', function(e) {
e.preventDefault();
$('.search-result').html('');
$('#keyword').val('').trigger('input');
e.preventDefault();
e.srcEvent.stopPropagation();
});
... ... @@ -611,13 +625,72 @@ if ($('.brand-search-page').length) {
if ($genderItem.length > 0) {
$genderItem.on('touchstart', function() {
var index = $(this).data('id') + 1;
$('.genderNav ul .active').removeClass('active');
$(this).addClass('active');
window.location.search = 'channel=' + ($(this).data('id') + 1);
$('.hide-when-loading').hide();
loading.showLoadingMask();
function reload() {
window.location.search = 'channel=' + index;
}
setTimeout(reload.bind(this), 100);
});
}
});
define("js/plugin/loading", ["jquery"], function(require, exports, module){
/**
* Loading mask
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/29
*/
var $ = require("jquery");
var $page = $('.yoho-page');
var $loading,
hasInit = false;
/** modify by liangzhifeng at 2015.11.2 */
// 初始化
function init($container) {
var html = '<div class="loading-mask hide">' +
'<div class="loading">' +
'<div></div><div></div><div></div>' +
'</div>' +
'</div>';
hasInit = true;
if ($container === undefined) {
$container = $page;
}
$container.append(html);
$loading = $container.children('.loading-mask');
}
//显示loading
function showLoadingMask() {
if (!hasInit) {
init();
hasInit = true;
}
$loading.removeClass('hide');
}
//隐藏loading
function hideLoadingMask() {
$loading.addClass('hide');
}
exports.init = init;
exports.showLoadingMask = showLoadingMask;
exports.hideLoadingMask = hideLoadingMask;
});
define("js/guang/entry", ["jquery","lazyload","swiper","hammer","mlellipsis","iscroll-probe","index"], function(require, exports, module){
/**
* 逛打包入口
... ... @@ -1048,58 +1121,6 @@ function show(con, dur) {
exports.show = show;
});
define("js/plugin/loading", ["jquery"], function(require, exports, module){
/**
* Loading mask
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/29
*/
var $ = require("jquery");
var $page = $('.yoho-page');
var $loading,
hasInit = false;
/** modify by liangzhifeng at 2015.11.2 */
// 初始化
function init($container) {
var html = '<div class="loading-mask hide">' +
'<div class="loading">' +
'<div></div><div></div><div></div>' +
'</div>' +
'</div>';
hasInit = true;
if ($container === undefined) {
$container = $page;
}
$container.append(html);
$loading = $container.children('.loading-mask');
}
//显示loading
function showLoadingMask() {
if (!hasInit) {
init();
hasInit = true;
}
$loading.removeClass('hide');
}
//隐藏loading
function hideLoadingMask() {
$loading.addClass('hide');
}
exports.init = init;
exports.showLoadingMask = showLoadingMask;
exports.hideLoadingMask = hideLoadingMask;
});
define("js/plugin/wx-share", ["jquery"], function(require, exports, module){
/**
* 微信分享
... ... @@ -2272,7 +2293,7 @@ var $searchBox = $('.search-box'),
$box = $('.box'),
$indexSearch = $('.index-search'),
$indexLogo = $('.index-logo'),
$channelLink = $('.index-channel a');
$channelLink = $('.index-channel a:not(#yohood)');
var $search = $searchBox.children('input[type="text"]'),
$cancelSearch = $box.children('.no-search'),
... ... @@ -5389,6 +5410,8 @@ var $chosePanel = $('#chose-panel'),
hasChooseSize,
$curSizeBlock,
$sizeRowList,
$curColorBlock,
$colorRowList,
cbFn,
$allChoseItems,
queryString,
... ... @@ -5404,7 +5427,10 @@ function init() {
$imgsThumb = $('.chose-panel').find('.thumb');
$allChoseItems = $('.chose-items');
$sizeRowList = $('.size-list ul');
$colorRowList = $('.color-list ul');
$leftNum = $('#left-num');
curColorIndex = 0;
curSizeIndex = 0;
}
function checkColorSizeNum() {
... ... @@ -5470,37 +5496,58 @@ function updateConformButtonClassAndText() {
}
}
//重置颜色块的库存为0的样式
function resetColorZeroStock($siblingBlock) {
var numArray,
i;
//显示剩余件数
function displayGoodNum(curGoodNum) {
if (!hasChooseSize) {
$siblingBlock.find('ul>li').each(function() {
if (0 === $(this).data('num')) {
$(this).addClass('zero-stock');
} else {
$(this).removeClass('zero-stock');
}
});
//数量大于0
if (curGoodNum > 0) {
if ($soonSoldOut.length > 0) {
$allChoseItems.find('.num .left-num').html('即将售罄');
} else {
$allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件');
}
$leftNum.val(curGoodNum);
//数量小于0
} else {
numArray = ($curSizeBlock.data('numstr') + '').split('/');
for (i = 0; i < numArray.length; i++) {
if ('0' === numArray[i]) {
$siblingBlock.find('.block').eq(i).addClass('zero-stock');
} else {
$siblingBlock.find('.block').eq(i).removeClass('zero-stock');
$allChoseItems.find('.num .left-num').html('');
$leftNum.val(0);
}
}
//老的选中尺码去掉勾选,新的选中尺码加上勾选
function changeSizeChosed(newSizeIndex) {
var sizes,
queryString,
i;
if (curColorIndex && $curSizeBlock && $curSizeBlock.length > 0) {
$curSizeBlock.removeClass('chosed');
sizes = $sizeRowList.eq(newSizeIndex).children();
for (i = 0; i < sizes.length; i++) {
if ($(sizes[i]).data('name') === $curSizeBlock.data('name')) {
$curSizeBlock = $(sizes[i]);
queryString = '#' + $curSizeBlock.data('name');
curColorIndex = $(queryString).data('index');
}
}
$curSizeBlock.addClass('chosed');
return $curSizeBlock.data('num');
}
return 0;
}
// 选择了颜色切换商品图片
function changeGoodImgWhenClickColor() {
if (hasChooseColor && curColorIndex >= 0) {
$imgsThumb.addClass('hide').eq(curColorIndex).removeClass('hide');
//老的选中颜色去掉勾选,新的选中颜色加上勾选
function changeColorChosed(newColorIndex) {
if (curSizeIndex && $curColorBlock && $curColorBlock.length > 0) {
$curColorBlock.removeClass('chosed');
$curColorBlock = $($colorRowList.eq(newColorIndex).children().get(curSizeIndex - 1));
$curColorBlock.addClass('chosed');
return $curColorBlock.data('num');
}
return 0;
}
init();
... ... @@ -5518,144 +5565,109 @@ $yohoPage.on('touchstart', '.chose-panel', function(e) {
$yohoPage.on('touchstart', '.color-list .block', function() {
var $this = $(this),
index,
curSizeBlock,
$preSiblingBlock,
$curSizeRow,
numArray,
i,
index = $this.index(),
curGoodNum;
var $siblingBlock = $this.closest('.block-list').siblings(':first');
$this.siblings('.chosed').removeClass('chosed');
index = $this.index();
$preSiblingBlock = $siblingBlock.find('.chosed');
$curSizeRow = $sizeRowList.eq(index);
// 当前颜色已经是选中状态,再点击时
if ($this.hasClass('chosed')) {
//颜色原来已经是勾选时,要清空剩余件数的提示
//清空剩余件数的提示
$allChoseItems.find('.num .left-num').html('');
$leftNum.val(0);
hasChooseColor = false;
$this.removeClass('zero-stock');
if ($curSizeBlock) {
numArray = ($curSizeBlock.data('numstr') + '').split('/');
for (i = 0; i < numArray.length; i++) {
if ('0' === numArray[i]) {
$('.color-list .block').eq(i).addClass('zero-stock');
}
}
}
//当前尺码行隐藏
$sizeRowList.eq(curSizeIndex).addClass('hide');
//目标尺码行显示
$sizeRowList.eq(0).removeClass('hide');
curSizeIndex = 0;
//老的选中尺码去掉勾选,新的选中尺码加上勾选
changeSizeChosed(0);
// 当前颜色不是选中状态,选中时
} else {
hasChooseColor = true;
//把当前选中颜色对应的尺码那一行显示出来
$sizeRowList.addClass('hide');
$curSizeRow.removeClass('hide').addClass('show');
// 尺码行当前行隐藏
$sizeRowList.eq(curSizeIndex).addClass('hide');
// 之前选中的尺码去掉勾选样式
if ($preSiblingBlock.length > 0) {
$preSiblingBlock.removeClass('chosed');
curSizeBlock = $curSizeRow.children().get(curSizeIndex);
$curSizeBlock = $(curSizeBlock);
}
//老的选中尺码去掉勾选,新的选中尺码加上勾选
curGoodNum = changeSizeChosed(index + 1);
// 当前选中颜色对应的尺码行,其对应的尺码加上勾选样式 (前提是要判断下这个尺码是否存在)
if (curSizeBlock) {
curGoodNum = $(curSizeBlock).data('num');
$(curSizeBlock).addClass('chosed');
// 显示剩余数量
displayGoodNum(curGoodNum);
//如果当前有尺码被选中,且数量等于0,则颜色块添加数量为0的样式
if (curGoodNum > 0) {
if ($soonSoldOut.length > 0) {
$allChoseItems.find('.num .left-num').html('即将售罄');
} else {
$allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件');
}
//尺码对应行显示
$sizeRowList.eq(index + 1).removeClass('hide');
$leftNum.val(curGoodNum);
} else {
$allChoseItems.find('.num .left-num').html('');
$leftNum.val(0);
}
}
curSizeIndex = index + 1;
$curColorBlock = $this;
// 修改颜色时修改商品图片
$imgsThumb.addClass('hide').eq(index).removeClass('hide');
}
// 当前颜色块 切换勾选样式
// 颜色块切换勾选样式
$this.siblings('.chosed').removeClass('chosed');
$this.toggleClass('chosed');
curColorIndex = index;
$('#good-num').val(1);
// 修改颜色时修改商品图片
changeGoodImgWhenClickColor();
// 设置按钮的样式和文字
updateConformButtonClassAndText();
}).on('touchstart', '.size-list .block', function() {
var $this = $(this),
index,
$curSizeRow,
curGoodNum;
var $siblingBlock = $this.closest('.block-list').siblings(':first');
$this.siblings('.chosed').removeClass('chosed');
index = $this.index();
$curSizeRow = $sizeRowList.eq(index);
// 当前尺码已经是选中状态,再点击时
if ($this.hasClass('chosed')) {
//尺码原来已经是勾选时,要清空剩余件数的提示
//清空剩余件数的提示
$allChoseItems.find('.num .left-num').html('');
$('#left-num').val(0);
$leftNum.val(0);
hasChooseSize = false;
curSizeIndex = null;
$curSizeBlock = null;
//当前颜色行隐藏
$colorRowList.eq(curColorIndex).addClass('hide');
//目标颜色行显示
$colorRowList.eq(0).removeClass('hide');
curColorIndex = 0;
//老的选中颜色去掉勾选,新的选中颜色加上勾选
changeColorChosed(0);
// 当前尺码不是选中状态,选中时
} else {
hasChooseSize = true;
curGoodNum = $this.data('num');
// 之前选中的尺码去掉勾选样式
if ($curSizeBlock) {
$curSizeBlock.removeClass('chosed');
}
index = $('#' + $this.data('name')).data('index') - 1;
// 如果当前有尺码被选中,且数量等于0, 否则显示剩余件数
if (curGoodNum > 0 && hasChooseColor) {
if ($soonSoldOut.length > 0) {
$allChoseItems.find('.num .left-num').html('即将售罄');
} else {
$allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件');
}
$('#left-num').val(curGoodNum);
} else {
$allChoseItems.find('.num .left-num').html('');
$('#left-num').val(0);
}
// 颜色当前行隐藏
$colorRowList.eq(curColorIndex).addClass('hide');
if (curGoodNum === 0 && hasChooseColor) {
$this.addClass('zero-stock');
}
curSizeIndex = index;
//老的选中颜色去掉勾选,新的选中颜色加上勾选
curGoodNum = changeColorChosed(index + 1);
// 显示剩余数量
displayGoodNum(curGoodNum);
//颜色对应行显示
$colorRowList.eq(index + 1).removeClass('hide');
curColorIndex = index + 1;
$curSizeBlock = $this;
}
// 颜色块切换勾选样式
$this.siblings('.chosed').removeClass('chosed');
$this.toggleClass('chosed');
$('#good-num').val(1);
// 重置颜色块的样式
resetColorZeroStock($siblingBlock);
// 设置按钮的样式和文字
updateConformButtonClassAndText();
});
... ... @@ -5779,8 +5791,7 @@ $yohoPage.on('touchstart', '.btn-minus', function() {
});
exports.init = init;
exports.show = show;
exports.show = show;
});
define("js/product/detail/desc", ["jquery","lazyload","swiper","index"], function(require, exports, module){
/**
... ... @@ -5926,9 +5937,6 @@ var commentsNum,consultsNum;
var navtabEle = document.getElementById('nav-tab'),
navtabHammer = navtabEle && new Hammer(navtabEle),
// consultFooterEle = $('.consult-content-footer')[0],
// consultFooterHammer = consultFooterEle && new Hammer(consultFooterEle),
gotoConsultEle = document.getElementById('goto-consult'),
gotoConsultHammer = gotoConsultEle && new Hammer(gotoConsultEle),
... ... @@ -8945,6 +8953,7 @@ function showChooseGifDialog() {
window.location.href = cartContentShow().find('.freebie > a').attr('href');
}, function() {
var info = window.cookie('order-info');
if (info) {
window.setCookie('order-info', '');
}
... ... @@ -9022,8 +9031,10 @@ if ($('.freebie').length > 0) {
}
$('.btn-balance').on('touchend', function() {
lowStockCount = 0;
var info = window.cookie('order-info');
lowStockCount = 0;
if (shouldLowStocks()) {
tip.show('所选商品中有' + lowStockCount + '种库存不足的商品');
return false;
... ... @@ -9166,7 +9177,6 @@ $('.icon-del').on('touchstart', function(e) {
autoHide: true,
fast: true
});
//window.setCookie('order-info', '');
window.setCookie('_yoho-cart-refreshByDelete', true);
window.location.href = '/cart/index/index?cartType=' + $('#cartType').val();
} else {
... ... @@ -9389,7 +9399,9 @@ if (document.referrer && document.referrer.indexOf('/cart/index/index') !== -1)
orderInfo('couponName', null);
}
orderInfo('cartType', queryString.cartType || queryString.carttype || 'ordinary');
if (queryString.cartType || queryString.carttype || !orderInfo('cartType')) {
orderInfo('cartType', queryString.cartType || queryString.carttype || 'ordinary');
}
function dispacthTapEvt(e) {
var $cur = $(e.target).closest('li');
... ... @@ -9420,19 +9432,20 @@ $('.checkbox').on('touchstart', function() {
}
});
$('.invoice').on('touchend', '.checkbox', function() {
$invoice.on('touchend', '.checkbox', function() {
var $this = $(this);
if ($this.hasClass('icon-cb-checked')) {
$('.invoice').addClass('focus');
$invoice.addClass('focus');
}
if ($this.hasClass('icon-checkbox')) {
$('.invoice').removeClass('focus');
$invoice.removeClass('focus');
}
});
function orderCompute() {
var yohoCoin = orderInfo('yohoCoin');
$.ajax({
method: 'POST',
url: '/cart/index/orderCompute',
... ... @@ -9520,7 +9533,7 @@ function submitOrder() {
var url;
if (!res) {
tip.show('网络出错');
tip.show('系统繁忙,请稍后再试!');
return;
}
if (res.code === 200) {
... ... @@ -9537,7 +9550,7 @@ function submitOrder() {
tip.show(res.message);
}
}).fail(function() {
tip.show('网络出错');
tip.show('系统繁忙,请稍后再试!');
}).always(function() {
isSubmiting = false;
loading.hideLoadingMask();
... ... @@ -9582,10 +9595,12 @@ $('.coin').on('touchend', function() {
orderCompute();
});
$invoice.on('touchend', function() {
$invoice.on('touchend', '.checkbox', function(e) {
var $this = $(this);
orderInfo('invoice', $this.find('.checkbox').hasClass('icon-cb-checked'));
orderInfo('invoice', $this.hasClass('icon-cb-checked'));
e.preventDefault();
e.stopPropagation();
});
$invoice.find('[name="invoice-title"]').on('blur', function() {
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
... ... @@ -50,22 +50,28 @@
商品总金额
<span>{{sumPrice}}</span>
</li>
{{#if salePrice}}
<li>
活动金额
<span>{{salePrice}}</span>
</li>
{{/if}}
<li>
运费
<span>{{freight}}</span>
</li>
{{#if coupon}}
<li>
优惠券
<span>{{coupon}}</span>
</li>
{{/if}}
{{#if yohoCoin}}
<li>
YOHO币
<span>{{yohoCoin}}</span>
</li>
{{/if}}
<li>
实付金额
<span>{{price}}</span>
... ...
[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
session.hosts=10.170.182.9:12111,10.172.169.31:12111,10.173.8.214:12111
[redis]
servers.hosts=127.0.0.1:6379
\ No newline at end of file
... ...
[memcached]
master.hosts=192.168.166.16:12111,192.168.166.17:12111,192.168.166.18:12111
slave.hosts=192.168.166.16:12112,192.168.166.17:12112,192.168.166.18:12112
session.hosts=192.168.166.16:12111,192.168.166.17:12111,192.168.166.18:12111
[redis]
servers.hosts=127.0.0.1:6379
\ No newline at end of file
... ...
... ... @@ -466,7 +466,7 @@ class HomeController extends AbstractAction
$serviceUrl = 'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409&info=';
if ($uid) {
$time = time() . '000';
$info = 'userId=' . $uid . '&name=' . $this->_uname . '&memo=&hashCode=' . md5(rawurlencode($uid . $this->_uname . $time . '1231')) . '&timestamp=' . $time;
$info = 'userId=' . $uid . '&name=' . $this->_uname . '&memo=&hashCode=' . md5( strtoupper( rawurlencode($uid . $this->_uname . $time . '1231') ) ) . '&timestamp=' . $time;
$serviceUrl .= rawurlencode($info);
}
... ...
... ... @@ -145,10 +145,10 @@ class OrderModel
$result['orderTime'] = date('Y-m-d H:i:s', $orderDetail['data']['create_time']);
$result['goods'] = Helpers::formatOrderGoods($orderDetail['data']['order_goods'], $count, true);
$result['sumPrice'] = $orderDetail['data']['goods_total_amount']; // 商品总金额
$result['salePrice'] = $orderDetail['data']['promotion_amount']; // 活动金额
$result['salePrice'] = self::filterOrderPrice($orderDetail['data']['promotion_amount']); // 活动金额
$result['freight'] = $orderDetail['data']['shipping_cost']; // 运费
$result['coupon'] = $orderDetail['data']['coupons_amount']; // 优惠券
$result['yohoCoin'] = $orderDetail['data']['yoho_coin_num']; // YOHO币
$result['coupon'] = self::filterOrderPrice($orderDetail['data']['coupons_amount']); // 优惠券
$result['yohoCoin'] = self::filterOrderPrice($orderDetail['data']['yoho_coin_num']); // YOHO币
$result['price'] = $orderDetail['data']['amount']; // 实付金额
$result['goodsAmount'] = $orderDetail['data']['payment_amount']; // 商品总金额没有人民币符号
$result['orderCount'] = $count; // 订单总件数
... ... @@ -267,4 +267,15 @@ class OrderModel
return $result;
}
/**
* 过滤掉为0的价格数据
*
* @param $price
* @return string 过滤之后的价格
*/
private static function filterOrderPrice($price)
{
return empty(intval(preg_replace('/[+|\-|¥]/s', '', $price))) ? '' : $price;
}
}
... ...
... ... @@ -175,6 +175,11 @@ class DetailModel
$colorStorageNum = 0;
$totalStorageNum = 0; // 总库存数
foreach ($baseInfo['goodsList'] as $value) {
// 如果status为0,即skc下架时就跳过该商品
if ($value['status'] === 0) {
continue;
}
$colorStorageNum = 0;
// 商品分组
... ...
... ... @@ -18,7 +18,7 @@ class BrandController extends AbstractAction
public function indexAction()
{
$this->setTitle('品牌一览');
$this->setNavHeader('品牌一览');
$this->setNavHeader('品牌一览', '/boys?go=1&t=' . time());
/* 判断参数是否有效 */
$channel = null;
... ...
[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
session.hosts=10.170.182.9:12111,10.172.169.31:12111,10.173.8.214:12111
[redis]
servers.hosts=127.0.0.1:6379
\ No newline at end of file
... ...
[memcached]
master.hosts=192.168.166.16:12111,192.168.166.17:12111,192.168.166.18:12111
slave.hosts=192.168.166.16:12112,192.168.166.17:12112,192.168.166.18:12112
session.hosts=192.168.166.16:12111,192.168.166.17:12111,192.168.166.18:12111
[redis]
servers.hosts=127.0.0.1:6379
\ No newline at end of file
... ...