Authored by 梁志锋

Merge remote-tracking branch 'origin/hotfix/coupon'

Showing 37 changed files with 282 additions and 281 deletions
... ... @@ -12,120 +12,100 @@ class ChannelConfig
//首页
'boys' => array(
array(
'sort' => 147,
'misort' => 44,
'viewNum' => 5
), //休闲/运动鞋
array(
'sort' => 129,
'misort' => 11,
'viewNum' => 5
), //休闲裤
), //T恤
array(
'sort' => 152,
'misort' => 28,
'viewNum' => 5
), //双肩包
), //短裤
array(
'misort' => 11,
'misort' => 61,
'viewNum' => 5
), //T恤
), //太阳镜/眼镜
array(
'sort' => 115,
'misort' => 26,
'viewNum' => 5
), //衬衫
), //休闲裤
array(
'sort' => 130,
'misort' => 27,
'viewNum' => 5
), //牛仔裤
array(
'misort' => 60,
'viewNum' => 5
), //帽子
array(
'sort' => 124,
'misort' => 49,
'viewNum' => 5
), //夹克
), //双肩包
array(
'sort' => 119,
'misort' => 12,
'viewNum' => 5
), //卫衣
), //衬衫
array(
'sort' => 162,
'misort' => 13,
'viewNum' => 5
), //手表
), //polo
array(
'sort' => 148,
'misort' => 60,
'viewNum' => 5
), //
), //
array(
'misort' => 65,
'misort' => 46,
'viewNum' => 5
), //首饰
), //凉鞋/拖鞋
array(
'sort' => 151,
'misort' => 66,
'viewNum' => 5
), //时装鞋
), //配饰
array(
'misort' => 61,
'misort' => 65,
'viewNum' => 5
), //太阳镜/眼镜
), //首饰
array(
'misort' => 39,
'misort' => 59,
'viewNum' => 5
), //袜子
), //手表
array(
'sort' => 346,
'misort' => 48,
'viewNum' => 5
), //运动裤
), //时装鞋
array(
'sort' => 131,
'misort' => 14,
'viewNum' => 5
), //短裤
), //背心
array(
'misort' => 66,
'misort' => 19,
'viewNum' => 5
), //配饰
), //西装
array(
'misort' => 309,
'viewNum' => 5
), //内裤
array(
'misort' => 30,
'misort' => 259,
'viewNum' => 5
), //打底裤/紧身裤
), //美妆
array(
'sort' => 342,
'misort' => 237,
'viewNum' => 5
), //邮差
), //钱包/手包/卡包/钥匙
),
//女首上架分类
'girls' => array(
array(
'misort' => 16,
'viewNum' => 4
), // 卫衣
array(
'misort' => 12,
'viewNum' => 4
), //衬衫
array(
'misort' => 44,
'viewNum' => 4
), //休闲/运动鞋
array(
'misort' => 11,
'viewNum' => 4
), //T恤
array(
'misort' => 21,
'viewNum' => 4
), //夹克
array(
'misort' => 257,
'misort' => 44,
'viewNum' => 4
), //毛衣/针织
), //休闲/运动鞋
array(
'misort' => 22,
'misort' => 31,
'viewNum' => 4
), //大衣/风衣
), //连衣裙
array(
'misort' => 26,
'viewNum' => 4
... ... @@ -135,45 +115,65 @@ class ChannelConfig
'viewNum' => 4
), //牛仔裤
array(
'misort' => 31,
'misort' => 12,
'viewNum' => 4
), //连衣裙
), //衬衫
array(
'misort' => 32,
'viewNum' => 4
), //半身裙
array(
'misort' => 28,
'viewNum' => 4
), //短裤
array(
'misort' => 14,
'viewNum' => 4
), //背心
array(
'misort' => 46,
'viewNum' => 4
), //凉鞋/拖鞋
array(
'misort' => 48,
'viewNum' => 4
), //时装鞋
array(
'misort' => 50,
'viewNum' => 4
), //单肩/手拎包
array(
'misort' => 49,
'viewNum' => 4
), //双肩包
array(
'misort' => 50,
'misort' => 61,
'viewNum' => 4
), //手拎包/单肩包
), //太阳镜/眼镜
array(
'misort' => 60,
'viewNum' => 4
), //帽子
array(
'misort' => 59,
'viewNum' => 4
), //手表
array(
'misort' => 65,
'viewNum' => 4
), //首饰
array(
'misort' => 59,
'misort' => 363,
'viewNum' => 4
), //手表
), //文胸
array(
'misort' => 61,
'misort' => 309,
'viewNum' => 4
), //太阳镜
), //内裤
array(
'misort' => 66,
'misort' => 259,
'viewNum' => 4
), //配饰
) //美妆
),
//潮童上架分类
'kids' => array(
... ... @@ -186,17 +186,17 @@ class ChannelConfig
'viewNum' => 4
), //衬衫
array(
'misort' => 396,
'misort' => 451,
'viewNum' => 4
), //卫衣
), //POLO
array(
'misort' => 400,
'misort' => 371,
'viewNum' => 4
), //毛衣/针织
), //连衣裙
array(
'misort' => 404,
'misort' => 370,
'viewNum' => 4
), //夹克
), //半身裙
array(
'misort' => 369,
'viewNum' => 4
... ... @@ -206,80 +206,72 @@ class ChannelConfig
'viewNum' => 4
), //牛仔裤
array(
'misort' => 371,
'viewNum' => 4
), //连衣裙
array(
'misort' => 370,
'misort' => 372,
'viewNum' => 4
), //半身裙
), //短裤
array(
'misort' => 368,
'viewNum' => 4
), //休闲/运动鞋
array(
'misort' => 392,
'misort' => 382,
'viewNum' => 4
), //双肩包
), //凉鞋/拖鞋
array(
'misort' => 414,
'misort' => 392,
'viewNum' => 4
), //帽子
), //双肩包
array(
'misort' => 372,
'misort' => 429,
'viewNum' => 4
), //短裤
), //太阳镜/眼镜
array(
'misort' => 384,
'misort' => 464,
'viewNum' => 4
), //打底裤/紧身裤
), //雨伞/雨衣
array(
'misort' => 382,
'misort' => 386,
'viewNum' => 4
), //凉鞋/拖鞋
), //背心
array(
'misort' => 402,
'misort' => 384,
'viewNum' => 4
), //马甲
), //打底裤/紧身裤
array(
'misort' => 386,
'misort' => 448,
'viewNum' => 4
), //背心
), //玩具娱乐
array(
'misort' => 406,
'misort' => 414,
'viewNum' => 4
), //大衣/风衣
), //帽子
array(
'misort' => 430,
'misort' => 380,
'viewNum' => 4
), //羽绒服
), //泳衣
array(
'misort' => 423,
'misort' => 419,
'viewNum' => 4
), //棉衣
), //配饰
array(
'misort' => 417,
'viewNum' => 4
), //套装
)//套装
),
//创意生活上架分类
'lifestyle' => array(
array(
'sort' => 171,
'viewNum' => 5
), //耳机
array(
'sort' => 398,
'misort' => 259,
'viewNum' => 5
), //智能装备
), //美妆
array(
'sort' => 185,
'misort' => 266,
'viewNum' => 5
), //相机
), //雨伞
array(
'misort' => 259,
'sort' => 171,
'viewNum' => 5
), //美妆
), //耳机
array(
'sort' => 267,
'viewNum' => 5
... ... @@ -289,25 +281,21 @@ class ChannelConfig
'viewNum' => 5
), //手机/ipad壳套
array(
'sort' => 211,
'misort' => 103,
'viewNum' => 5
), //数码配件
array(
'sort' => 292,
'misort' => 280,
'viewNum' => 5
), //玩
), //玩具娱乐
array(
'sort' => 272,
'viewNum' => 5
), //储物收纳
array(
'sort' => 183,
'sort' => 185,
'viewNum' => 5
), //居家用品
), //相机
array(
'sort' => 273,
'misort' => 101,
'viewNum' => 5
), //厨具/餐
), //
array(
'sort' => 271,
'viewNum' => 5
... ...
... ... @@ -25,6 +25,7 @@ class PayData
{
$param = Yohobuy::param();
$param['client_type'] = 'web';
$param['uid'] = intval($uid);
$param['private_key'] = Yohobuy::$privateKeyList['web'];
$param['method'] = 'web.SpaceOrders.getOrderCountByUid';
... ... @@ -233,6 +234,8 @@ class PayData
public static function pcpayNotify($orderCode, $payment, $amount, $bankName = '', $bankCode = '', $tradeNo = '', $bankBillNo = '')
{
$param = Yohobuy::param();
$param['client_type'] = 'web';
$param['private_key'] = Yohobuy::$privateKeyList['web'];
$param['method'] = 'web.SpaceOrders.pcpayNotify';
$param['order_code'] = $orderCode;
$param['payment'] = $payment;
... ... @@ -257,6 +260,8 @@ class PayData
{
// 构建必传参数
$param = Yohobuy::param();
$param['client_type'] = 'web';
$param['private_key'] = Yohobuy::$privateKeyList['web'];
$param['method'] = 'app.SpaceOrders.payConfirm';
$param['order_code'] = $orderCode;
$param['payment_id'] = $paymentId;
... ...
... ... @@ -42,8 +42,6 @@ class Service extends PayAbstract
public function getPayRequestPars(Reqparams $params)
{
// $baseUrl = $this->getBaseNoticeUrl($params->isTest);
// $loseTime = intval(($params->orderTime + 7200 - time()) / 60);
// $loseTime = intval((strtotime(date("Y-m-d 10:00:00", strtotime("+1 day")))-time())/60);
UdpLog::info("【{$this->logProjectPrefix}-支付宝银行支付】,function:getPayRequestPars,参数", $params);
$parameter = array(
'service' => $this->config->service,
... ... @@ -58,7 +56,7 @@ class Service extends PayAbstract
'payment_type' => $this->config->payment_type,
'defaultbank' => $params->paymentParameter,
'seller_email' => $this->config->sellerMail,
// 'it_b_pay' => $loseTime . 'm'
'it_b_pay' => $params->payExpireMinute . 'm',
);
if ($this->config->anti_fishing['timestamp_enable']) {
$anti_phishing_key = $this->getTimestamp();
... ...
... ... @@ -47,8 +47,6 @@ class Service extends PayAbstract
{
UdpLog::info("【{$this->logProjectPrefix}-支付宝支付】,function:getPayRequestPars,参数", $params);
// $baseUrl = $this->getBaseNoticeUrl($params->isTest);
// $loseTime = intval(($params->orderTime + 7200 -time())/60);
// $loseTime = intval((strtotime(date("Y-m-d 10:00:00", strtotime("+1 day")))-time())/60); //第二天十点
$parameter = array(
'service' => $this->config->service,
'partner' => $this->config->partner,
... ... @@ -58,13 +56,14 @@ class Service extends PayAbstract
/* 业务参数 */
'subject' => $params->goodsName,
'out_trade_no' => $params->orderCode,
// 'it_b_pay' => $loseTime . 'm',
'it_b_pay' => $params->payExpireMinute . 'm',
'total_fee' => $params->totalFee / 100, //单位为元
'payment_type' => $this->config->payment_type,
'seller_email' => $this->config->sellerMail,
'sign_id_ext' => $params->uid,
'sign_name_ext' => $params->userName
);
if ($this->config->anti_fishing['timestamp_enable']) {
$anti_phishing_key = $this->getTimestamp();
if (!empty($anti_phishing_key)) {
... ...
... ... @@ -11,17 +11,25 @@ namespace WebPlugin\Pay;
class Reqparams
{
public function __construct($_orderCode, $_totalFee, $_goodName, $client_ip, $_orderTime, $_paymentParameter="", $_isTest=false, $uid=0, $userName='')
public function __construct($_orderCode, $_totalFee, $_goodName, $client_ip, $_orderTime, $_paymentParameter="", $_isTest=false, $uid=0, $userName='', $_payExpire = '')
{
$this->orderCode = $_orderCode;
$this->totalFee = $_totalFee;
$this->goodsName = $_goodName;
$this->spbill_create_ip = $client_ip;
$this->orderTime = $_orderTime;
$this->paymentParameter = $_paymentParameter;
$this->isTest = $_isTest;
$this->uid = $uid;
$this->userName = $userName;
//到期时间,默认为当前时间加2个小时的时间戳
$_payExpire = empty($_payExpire) ? strtotime('+2 hours') : strtotime($_payExpire);
$payExpireMinute = 0;//剩余分钟数
if ($_payExpire && ($expireTime = $_payExpire - time()) > 0) {
$payExpireMinute = floor($expireTime / 60);
}
$this->orderCode = $_orderCode;
$this->totalFee = $_totalFee;
$this->goodsName = $_goodName;
$this->spbill_create_ip = $client_ip;
$this->orderTime = $_orderTime;
$this->payExpireMinute = $payExpireMinute;
$this->paymentParameter = $_paymentParameter;
$this->isTest = $_isTest;
$this->uid = $uid;
$this->userName = $userName;
}
/**
... ...
... ... @@ -337,7 +337,7 @@
<ul>
<li>
<input checked name="juangroup" type="radio" value="">
<label>直接输入优惠码: </label>
<label>直接输入优惠码: </label>
<input type="text" class="textbox" id="juancode" />
</li>
</ul>
... ...
... ... @@ -269,7 +269,7 @@
<ul>
<li>
<input name="juangroup" type="radio" value="">
<label>直接输入优惠码: </label>
<label>直接输入优惠码: </label>
<input type="text" class="textbox" id="juancode" />
</li>
{{#each juanlist}}
... ...
... ... @@ -269,7 +269,7 @@
<ul>
<li>
<input name="juangroup" type="radio" value="">
<label>直接输入优惠码: </label>
<label>直接输入优惠码: </label>
<input type="text" class="textbox" id="juancode" />
</li>
{{#each juanlist}}
... ...
... ... @@ -45,7 +45,7 @@
</li>
<li>
<i class="tell-icon iconfont">&#xe61c;</i>
<span>400-9889-9646</span>
<span>400-8899-646</span>
</li>
{{/ tool}}
</ul>
... ...
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.
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.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.

48.3 KB | W: | H:

48.3 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

8.64 KB | W: | H:

8.64 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

48.3 KB | W: | H:

48.3 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

8.64 KB | W: | H:

8.64 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -772,7 +772,6 @@ $('.to-play input.submit').click(function() {
redEnvelopes = $('.use-envelopes input:checked').attr('data-use'),
$juangroupInput = $('.play-juan.is-select input[name="juangroup"]:checked'),
codeVal = $juangroupInput.val(),
promotionVal = $juangroupInput.closest('li').find('#juancode').val();
juanCode = !!codeVal ? codeVal : $juangroupInput.closest('li').find('#juancode').val();
$loading.show();
... ... @@ -798,7 +797,6 @@ $('.to-play input.submit').click(function() {
paymentType: paymentType,
remark: remark,
couponCode: juanCode,
promotionCode: promotionVal,
yohoCoin: yohoCoin,
isPreContact: ytoTrue(isPreContact),
isPrintPrice: ytoTrue(isPrintPrice),
... ...
... ... @@ -370,19 +370,16 @@ var Order = {
var expressVal = $('.express-list input[name="carriagegroup"]:checked').val();
var biVal = $('#biprice.is-select').val();
var codeVal = $juangroupInput.val();
var promotionVal = $juangroupInput.closest('li').find('#juancode').val();
var cartType = $('.address-manage').attr('cart-type');
var redEnvelopes = $('.use-envelopes input:checked').attr('data-use');
var resultData;
codeVal = codeVal ? codeVal : $juangroupInput.closest('li').find('#juancode').val();
resultData = {
cartType: cartType,
deliveryWay: expressVal,
couponCode: codeVal,
promotionCode: promotionVal,
yohoCoin: biVal
//redEnvelopes: e.$useEnvelopesInput.length > 0 ? ~~e.$hasEnvelopes.text().substring(1) : '0'
... ...
{
"name": "web-yohobuy",
"version": "0.0.26",
"version": "0.0.28",
"description": "web yohobuy static",
"keywords": [],
"homepage": "",
... ...
... ... @@ -199,13 +199,19 @@ class ItemModel
if (!empty($banner['brandId'])) {
$domainBrand = BrandsModel::getBrandByDomain($banner['brandDomain']);
if (empty($domainBrand['type']) || $domainBrand['type'] !== 2) {
//多品店不显示
$banner = array();
} else {
$basisData = ShopModel::basisTemplate($domainBrand['shopId']);
$banner['bgImg'] = empty($basisData['shopTopBanner']['banner']) ?
$banner['bgImg'] : $basisData['shopTopBanner']['banner'];
if (!empty($domainBrand['type']) && !empty($domainBrand['shopId'])) {
switch (intval($domainBrand['type'])) {
case 1:
//多品店不显示
$banner = array();
break;
case 2:
//单品店显示新版的店铺banner
$basisData = ShopModel::basisTemplate($domainBrand['shopId']);
$banner['bgImg'] = empty($basisData['shopTopBanner']['banner']) ?
$banner['bgImg'] : $basisData['shopTopBanner']['banner'];
break;
}
}
}
... ...
... ... @@ -426,7 +426,10 @@ class ShopModel
}
}
return $result;
return array(
'title' => empty($result[0]['title']) ? '' : $result[0]['title'],
'list'=> $result
);
}
/**
... ... @@ -571,13 +574,8 @@ class ShopModel
$list = self::$fun(self::getResourceData($list), $parameters);
switch ($fun) {
case 'shopTopBanner':
$data[$fun] = $list;
break;
case 'signboard':
$data[$fun] = array(
'title' => isset($list[0]['title']) ? $list[0]['title'] : '',
'list'=> $list
);
$data[$fun] = $list;
break;
}
}
... ...
... ... @@ -169,9 +169,10 @@ class PayModel
$orderCount = 0;
$orders = PayData::getOrderCountByUid($uid);
if (isset($orders['data']) && !empty($orders['data'])) {
$orderCount = $orders['data']['total'];
if (!empty($orders['data']['count'])) {
$orderCount = $orders['data']['count'];
}
$result['isOldUser'] = (intval($orderCount) > self::OLD_USER_LIMIT) ? true : false;
// 订单数(用于订单统计)
$result['orderCount'] = $orderCount;
... ... @@ -282,7 +283,10 @@ class PayModel
$paymentParameter = $alipayToken;
}
$reqParams = new Reqparams($orderCode, $totalFee, '有货订单号:' . $orderCode, '', $orderDetail['data']['create_time'], $paymentParameter, $isTest, $uid, $userName);
$reqParams = new Reqparams(
$orderCode, $totalFee, '有货订单号:' . $orderCode, '', $orderDetail['data']['create_time'],
$paymentParameter, $isTest, $uid, $userName, $orderDetail['data']['pay_expire']
);
$reqPars = $payService->getPayRequestPars($reqParams);
if (empty($reqPars)) {
$result['error'] = true;
... ...
... ... @@ -173,9 +173,10 @@ class PaymentModel
//查询用户订单数接口
$orders = PayData::getOrderCountByUid($uid);
if (isset($orders['data']) && !empty($orders['data'])) {
$orderCount = $orders['data']['total'];
if (!empty($orders['data']['count'])) {
$orderCount = $orders['data']['count'];
}
$result['isOldUser'] = (intval($orderCount) > self::OLD_USER_LIMIT) ? true : false;
// 订单数(用于订单统计)
$result['orderCount'] = $orderCount;
... ... @@ -324,14 +325,28 @@ class PaymentModel
$input->SetBody('有货订单号:' . $orderCode);
$input->SetOut_trade_no('YOHOBuy_' . $orderCode); // 商户订单号
$input->SetTotal_fee($totalFee);
$input->SetTime_start(date("YmdHis"));
$input->SetTime_expire(date("YmdHis", time() + 600));
//到期时间
if (!empty($orderDetail['data']['pay_expire']) && ($payExpireTime = strtotime($orderDetail['data']['pay_expire']))) {
$payExpireTime = $payExpireTime;
} else {
$payExpireTime = time();
}
$input->SetTime_start(date("YmdHis", strtotime('-2 hours', $payExpireTime)));
//最短失效时间间隔必须大于5分钟 [https://pay.weixin.qq.com/wiki/doc/api/native.php?chapter=9_1]
$input->SetTime_expire(date("YmdHis", $payExpireTime + 300));
$input->SetTrade_type("NATIVE");
$input->SetProduct_id($orderCode);
$notify = new WxPayNativePay();
$payResult = $notify->GetPayUrl($input);
//错误信息,EQ:超时
if (!empty($payResult['return_code']) && $payResult['return_code'] === 'FAIL') {
self::$code['message'] = $payResult['return_msg'];
break;
}
if ($payResult['result_code'] === 'FAIL') {
//错误信息,EQ:多次涮新
if (!empty($payResult['result_code']) && $payResult['result_code'] === 'FAIL') {
self::$code['message'] = $payResult['err_code_des'];
break;
}
... ... @@ -521,7 +536,10 @@ class PaymentModel
$paymentParameter = $alipayToken;
}
$reqParams = new Reqparams($orderCode, $totalFee, '有货订单号:' . $orderCode, '', $orderDetail['data']['create_time'], $paymentParameter, $isTest, $uid, $userName);
$reqParams = new Reqparams(
$orderCode, $totalFee, '有货订单号:' . $orderCode, '', $orderDetail['data']['create_time'],
$paymentParameter, $isTest, $uid, $userName, $orderDetail['data']['pay_expire']
);
$reqPars = $payService->getPayRequestPars($reqParams);
UdpLog::info(
"【支付-参数】,function:getPayData,orderCode:{$orderCode},接口返回",
... ...
... ... @@ -7,7 +7,7 @@ use WebPlugin\UdpLog;
/**
* 购物车相关的控制器
*
*
* @name IndexController
* @package Cart
* @copyright yoho.inc
... ... @@ -24,13 +24,13 @@ class IndexController extends WebAction
{
$uid = $this->getUid(false);
$shoppingKey = Helpers::getShoppingKeyByCookie();
// 显示一次并清除已删除的COOKIE记录
$cartDelList = $this->getCookie('cart-del-list');
if (!empty($cartDelList)) {
$this->setCookie('cart-del-list', '');
}
$this->setTitle('购物车', true, ' | ');
$this->setSimpleHeader();
$this->_view->display('cart', array(
... ... @@ -39,10 +39,10 @@ class IndexController extends WebAction
'uid' => $uid ? $uid : '',
));
}
/**
* 购物车商品选择与取消
*
*
* @param string skuList 商品sku列表,json格式,如{"744403":1,"777777":3}
* @param bool hasPromotion 标识是不是有promotion_id参数, 后端会去调用不同的接口
* @return json
... ... @@ -61,10 +61,10 @@ class IndexController extends WebAction
$this->echoJson($result);
}
/**
* 修改购物车商品数量
*
*
* @param int sku 商品到尺码的编吗
* @param int increaseNum 增加1
* @param int decreaseNum 减少1
... ... @@ -76,12 +76,12 @@ class IndexController extends WebAction
if ($this->isAjax()) {
$shoppingKey = Helpers::getShoppingKeyByCookie();
$uid = $this->getUid(false);
$sku = $this->post('sku', 0);
$increaseNum = $this->post('increaseNum', null);
$decreaseNum = $this->post('decreaseNum', null);
$result = CartModel::modifyProductNum($uid, $sku, $increaseNum, $decreaseNum, $shoppingKey);
if (!empty($result['code']) && $result['code'] == 200) {
$this->setShoppingCookie($uid);
... ... @@ -90,10 +90,10 @@ class IndexController extends WebAction
$this->echoJson($result);
}
/**
* 移出购物车
*
*
* @param string skuList 商品sku列表,json格式,如[{"product_sku":1047193,"buy_number":1,"promotion_id":0}]
* @param bool hasPromotion 标识是不是有promotion_id参数, 后端会去调用不同的接口
* @return json
... ... @@ -112,15 +112,15 @@ class IndexController extends WebAction
$this->setShoppingCookie($uid);
}
}
$this->echoJson($result);
}
/**
* 移入收藏夹
*
*
* 支持批量移入收藏夹
*
*
* @param string 商品sku列表,json格式,如{"744403":1,"777777":3}
* @param bool hasPromotion 标识是不是有promotion_id参数, 后端会去调用不同的接口
* @return json
... ... @@ -141,32 +141,32 @@ class IndexController extends WebAction
$this->echoJson($result);
}
/**
* 检查是否收藏
*
*
* @param string sknList 商品productId列表,如["123123","123412"]
*/
public function checkFavAction()
{
$result = array('code' => 200, 'message' => '是否收藏', 'data' => array());
if ($this->isAjax()) {
$uid = $this->getUid(false);
$pidList = $this->post('pidList', '');
$result['data'] = CartModel::checkUserIsFav($uid, $pidList);
}
$this->echoJson($result);
}
/**
* 凑单商品异步请求
*/
public function getTogetherProductAction()
{
$result = array('code' => 200, 'data' => array(), 'message' => '凑单商品');
$result = array('code' => 200, 'data' => array(), 'message' => '凑单商品');
if ($this->isAjax()) {
$page = $this->get('page', 1);
$result = CartModel::getTogetherProduct($page);
... ... @@ -181,15 +181,15 @@ class IndexController extends WebAction
public function getHistroyProductAction()
{
$result = array('code' => 200, 'data' => array(), 'message' => '浏览记录');
// 按照产品把明扬的指示,去掉最近浏览记录
$this->echoJson($result); exit();
do {
if (!$this->isAjax()) {
break;
}
$page = $this->get('page', 1);
// $uid = $this->getUid(false);
// if ($uid) {
... ... @@ -197,7 +197,7 @@ class IndexController extends WebAction
// $result = CartModel::getBrowseProduct($uid, $udid, $page);
// break;
// }
$sknList = $this->getCookie('_browseskn');
if (empty($sknList)) {
break;
... ... @@ -209,7 +209,7 @@ class IndexController extends WebAction
$this->echoJson($result);
}
/**
* 确认订单
*/
... ... @@ -217,67 +217,67 @@ class IndexController extends WebAction
{
$type = $this->get('type', 1);
$refer = Helpers::url('/cart/index/orderEnsure', array('type' => $type));
// 审判用户是否已登录
$this->auditJumpLogin(false, $refer);
$this->setTitle('填写订单', true, ' | ');
$this->setSimpleHeader();
$cartType = ($type == 2) ? 'advance' : 'ordinary';
$isAdvanceCart = ($type == 2) ? true : false;
$uid = $this->getUid(false);
$orderEnsure = CartModel::cartPay($uid, $cartType, $isAdvanceCart);
if (empty($orderEnsure)) {
$this->go(Helpers::url('/shopping/cart'));
}
$this->_view->display('order-ensure', array(
'orderEnsurePage' => true,
'orderEnsurePage' => true,
'orderEnsure' => $orderEnsure,
));
}
/**
* 异步获取地址信息
*
*
* @return json
*/
public function getAddressAction()
{
$result = array('code' => 200, 'data' => array(), 'message' => '地址信息');
if ($this->isAjax()) {
$uid = $this->getUid(false);
$result['data'] = CartModel::userAddressList($uid);
}
$this->echoJson($result);
}
/**
* 设置为默认的地址
*
*
* @param int id 地址ID
* @return json
*/
public function setDefaultAddressAction()
{
$result = array();
if ($this->isAjax()) {
$uid = $this->getUid(false);
$addressId = $this->post('id');
$result = CartModel::setDefaultAddress($uid, $addressId);
}
$this->echoJson($result);
}
/**
* 保存地址信息
*
*
* @param int $id 地址ID ,当修改操作的时候需要传,添加时候不需要传
* @param string $address 地址信息
* @param int $areaCode 城市码
... ... @@ -292,7 +292,7 @@ class IndexController extends WebAction
public function saveAddressAction()
{
$result = array();
if ($this->isAjax()) {
$uid = $this->getUid(false);
$id = $this->post('id', null);
... ... @@ -312,38 +312,38 @@ class IndexController extends WebAction
}
}
}
$this->echoJson($result);
}
/**
* 删除地址
*
*
* @param int id 地址ID
*/
public function delAddressAction()
{
$result = array();
if ($this->isAjax()) {
$uid = $this->getUid(false);
$addressId = $this->post('id');
$result = CartModel::delAddress($uid, $addressId);
}
$this->echoJson($result);
}
/**
* 获取省市区县信息列表
*
*
* @param int id
* @return json
*/
public function getAreaListAction()
{
$result = array('code' => 200, 'message' => '地区信息', 'data' => array());
if ($this->isAjax()) {
$id = $this->get('id', 0);
$result['data'] = CartModel::getAreaList($id);
... ... @@ -351,16 +351,16 @@ class IndexController extends WebAction
$this->echoJson($result);
}
/**
* 获取优惠券列表
*
*
* @return json
*/
public function getCouponListAction()
{
$result = array('code' => 200, 'message' => '优惠券信息', 'data' => array());
if ($this->isAjax()) {
$uid = $this->getUid(false);
$result['data'] = CartModel::getCouponList($uid);
... ... @@ -368,10 +368,10 @@ class IndexController extends WebAction
$this->echoJson($result);
}
/**
* 购物车选择改变字段,重新运算订单数据
*
*
* @param string $cartType 购物车类型,ordinary表示普通, advance表示预售
* @param int $deliveryWay 配送方式,1表示普通快递,2表示顺丰速运
* @param int $paymentType 支付方式,1表示在线支付,2表示货到付款
... ... @@ -390,17 +390,18 @@ class IndexController extends WebAction
$paymentType = $this->post('paymentType', 1);
$couponCode = $this->post('couponCode', null);
$yohoCoin = $this->post('yohoCoin', null);
$promotionCode = $this->post('promotionCode', null);
$redEnvelopes = $this->post('redEnvelopes', null);
$uid = $this->getUid(false);
$result = CartModel::orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode, $yohoCoin, $redEnvelopes);
$result = CartModel::orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode, $promotionCode, $yohoCoin, $redEnvelopes);
}
$this->echoJson($result);
}
/**
* 确认结算订单
*
*
* @param int $addressId 地址ID
* @param int $cartType 购物车类型ID
* @param int $deliveryTimeId 寄送时间ID
... ... @@ -426,71 +427,47 @@ class IndexController extends WebAction
if (!$this->isAjax()) {
break;
}
// 判断用户是否登录
$uid = $this->getUid(false);
if (!$uid) {
$result['message'] = '请先登录';
break;
}
$addressId = $this->post('addressId', null);
$cartType = $this->post('cartType', 'ordinary'); // 默认普通购物车
$deliveryTimeId = $this->post('deliveryTimeId', 1); // 默认只工作日配送
$deliveryWayId = $this->post('deliveryWayId', 1); // 默认普通快递
$invoiceTitle = $this->post('invoiceTitle', null); // 发票抬头
$invoiceId = $this->post('invoiceId', null); // 发票类型
$invoiceId = $this->post('invoiceId', null); // 发票类型
$paymentId = $this->post('paymentId', 15); // 支付ID
$paymentType = $this->post('paymentType', 1); // 默认在线支付
$remark = $this->post('remark', ''); // 备注信息
$couponCode = $this->post('couponCode', null); // 优惠码
$couponCode = $this->post('couponCode', null); // 优惠券
$promotionCode = $this->post('promotionCode', null); // 优惠码
$yohoCoin = $this->post('yohoCoin', 1); // YOHO币
$isPreContact = $this->post('isPreContact', false); // 送货前是否联系
$isPrintPrice = $this->post('isPrintPrice', true); // 是否打印价格
$redEnvelopes = $this->post('redEnvelopes', null);
// 调用下单接口
$result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceTitle, $invoiceId,
$paymentId, $paymentType, $remark, $couponCode, $yohoCoin, $isPreContact, $isPrintPrice, $redEnvelopes);
$result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceTitle, $invoiceId,
$paymentId, $paymentType, $remark, $couponCode, $promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $redEnvelopes);
// 判断是否下单成功
if (empty($result['data']['order_code'])) {
UdpLog::info('【结算信息】判断是否下单成功','order_code'.$result['data']['order_code']);
break;
}
// 跳转到支付的URL链接
$result['data']['payUrl'] = Helpers::url('/shopping/pay', array('ordercode' => $result['data']['order_code']));
}
while (false);
// $result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $couponCode, $yohoCoin);
//
// 记录下单异常的数据
if (empty($result)) {
$message = 'uid:' . $uid . ',addressId:' . $addressId . ',cartType:' . $cartType . ',deliveryTime:' . $deliveryTime
. ',deliveryWay:' . $deliveryWay . 'invoiceTitle:' . $invoiceTitle . ',invoiceId:' . $invoiceId . ',yohoCoin:' . $yohoCoin
. ',paymentId:' . $paymentId . ',paymentType:' . $paymentType . ',remark:' . $remark . ',couponCode:' . $couponCode . "\n";
UdpLog::info('【下单】下单异常数据','message:'.$message,'返回:'.json_encode($result));
}
// // 返回数据
// else {
// // 提交成功清除Cookie
// $this->setCookie('order-info', null);
//
// $this->echoJson($result);
// }
//
// if ($uid && !empty($result['data'])) {
// try {
// UnionTrans::set($uid, $result['data']['order_code'], $result['data']['order_amount']);
// } catch (Exception $e) {
// // do nothing
// }
// }
$this->echoJson($result);
}
/**
* 加入购物车
*
... ... @@ -534,12 +511,12 @@ class IndexController extends WebAction
$this->echoJson($result);
}
/**
* 获取商品信息
*/
public function getProductInfoAction()
{
{
$productId = $this->get('productId');
$uid = $this->getUid();
$vipLevel = -1;
... ... @@ -552,10 +529,10 @@ class IndexController extends WebAction
}
$this->_view->display('goods-detail', $data);
}
/**
* 获取购物车商品总数
*
*
* @return jsonp
*/
public function countAction()
... ... @@ -564,10 +541,10 @@ class IndexController extends WebAction
$uid = $this->getUid(false);
$shoppingKey = Helpers::getShoppingKeyByCookie();
$result = CartModel::getCartCount($uid, $shoppingKey);
$this->helpJsonCallbackResult($callback, 200, '总数', $result);
}
/**
* 设置购物车COOKIE信息
*/
... ... @@ -585,5 +562,5 @@ class IndexController extends WebAction
)));
}
}
}
\ No newline at end of file
}
... ...
... ... @@ -5,7 +5,7 @@ use Shopping\PayModel;
use WebPlugin\Pay\PayFactory;
use WebPlugin\Pay\Rspparams;
use WebPlugin\Pay\weixin\PayNotifyCallBack;
use WebPlugin\UdpLog;
/**
* 支付Notice
*/
... ... @@ -24,6 +24,7 @@ class NoticeController extends WebAction
public function alipaynoticeAction()
{
$res = $this->getParseResponse($_POST, 2);
UdpLog::info("【支付宝异步】,function:alipaynoticeAction,参数", array('pars' => $_POST, 'res' => $res));
if ($res->payResult != -1) {
$this->payResultProc($res, 2);
echo "success";
... ... @@ -37,6 +38,7 @@ class NoticeController extends WebAction
public function alipayreturnAction()
{
$res = $this->getParseResponse($_GET, 2);
UdpLog::info("【支付宝同步】,function:alipayreturnAction,参数", array('pars' => $_GET, 'res' => $res));
$dealResult = $this->payResultProc($res, 2);
$dealResult['payData'] = array('payWay' => '支付宝');
$this->commonShowResult($dealResult);
... ... @@ -48,6 +50,7 @@ class NoticeController extends WebAction
public function alibarcodenoticeAction()
{
$res = $this->getParseResponse($_POST, 17);
UdpLog::info("【支付宝二维码支付异步】,function:alibarcodenoticeAction,参数", array('pars' => $_POST, 'res' => $res));
if ($res->payResult != -1) {
$this->payResultProc($res, 17);
echo "success";
... ... @@ -61,6 +64,7 @@ class NoticeController extends WebAction
public function alibarcodereturnAction()
{
$res = $this->getParseResponse($_GET, 17);
UdpLog::info("【支付宝二维码支付同步】,function:alibarcodereturnAction,参数", array('pars' => $_GET, 'res' => $res));
$dealResult = $this->payResultProc($res, 17);
$dealResult['payData'] = array('payWay' => '支付宝');
$this->commonShowResult($dealResult);
... ... @@ -225,6 +229,7 @@ class NoticeController extends WebAction
$uid = $this->getSession(self::SESSION_UID_KEY);
$this->setSession(self::SESSION_UID_KEY, null);
}
UdpLog::info("【微信扫码支付结果商户通知地址】,function:wechatqrcodenotifyAction");
$notify = new PayNotifyCallBack($uid);
$notify->handle(false);
}
... ... @@ -248,6 +253,7 @@ class NoticeController extends WebAction
$payment = PayModel::getPaymentById(21);
$payService = PayFactory::factory($payment);
$res = $payService->parseResponse(array('orderCode' => $orderCode));
UdpLog::info("【微信扫码支付返回】,function:wechatqrcodereturnAction,参数", array('pars' => $_GET, 'res' => $res));
$dealResult = $this->payResultProc($res, 21);
$dealResult['payData'] = array('payWay' => '微信扫码支付');
} while (false);
... ...
... ... @@ -95,7 +95,7 @@ class IndexController extends WebAction
//调用模型获得品牌页数据
$data = BrandsModel::getBrandSearchData($condition, $options);
$data['signboard'] = isset($result['signboard']) ? $result['signboard'] : '';//水牌
//统计前三个商品
$skn=array();
$arr=array();
... ... @@ -315,7 +315,6 @@ class IndexController extends WebAction
*/
public function shopHome($shopId)
{
$domain = $this->param('named');
// 设置头部数据
$this->setWebNavHeader();
$misort = $this->get('misort');
... ...
... ... @@ -50,7 +50,7 @@ application.template.ext = ".phtml"
application.assets.path = ROOT_PATH "/assets/web"
; 应用的版本号
application.version = "0.0.26"
application.version = "0.0.28"
; 网站SEO信息
application.seo.title = "YOHO!有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证"
... ...
... ... @@ -50,7 +50,7 @@ application.template.ext = ".phtml"
application.assets.path = ROOT_PATH "/assets/web"
; 应用的版本号
application.version = "0.0.26"
application.version = "0.0.28"
; 网站SEO信息
application.seo.title = "YOHO!有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证"
... ...
... ... @@ -50,7 +50,7 @@ application.template.ext = ".phtml"
application.assets.path = ROOT_PATH "/assets/web"
; 应用的版本号
application.version = "0.0.26"
application.version = "0.0.28"
; 网站SEO信息
application.seo.title = "YOHO!有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证"
... ...
... ... @@ -50,7 +50,7 @@ application.template.ext = ".phtml"
application.assets.path = ROOT_PATH "/assets/web"
; 应用的版本号
application.version = "0.0.26"
application.version = "0.0.28"
; 网站SEO信息
application.seo.title = "YOHO!有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证"
... ...