...
|
...
|
@@ -573,12 +573,26 @@ class CartModel |
|
|
*/
|
|
|
public static function cartPay($uid, $cartType, $isAdvanceCart)
|
|
|
{
|
|
|
$result = array();
|
|
|
/* 调接口订单确认接口 */
|
|
|
$pay = CartData::cartPay($uid, $cartType);
|
|
|
|
|
|
return self::filterCartPay($pay, $cartType, $isAdvanceCart);
|
|
|
}
|
|
|
/**
|
|
|
* 处理购物车返回
|
|
|
* @param type $pay 获取商品数据
|
|
|
* @param string $cartType 购物车类型,ordinary表示普通购物车
|
|
|
* @param bool $isAdvanceCart 是否是预售商品列表
|
|
|
* @return type []
|
|
|
*/
|
|
|
private static function filterCartPay($pay, $cartType, $isAdvanceCart)
|
|
|
{
|
|
|
// 存放分析用的数据
|
|
|
$analysisData = array('ipinyou' => '');
|
|
|
$result = array();
|
|
|
|
|
|
do {
|
|
|
/* 调接口订单确认接口 */
|
|
|
$pay = CartData::cartPay($uid, $cartType);
|
|
|
|
|
|
if (!$pay || empty($pay['data']['goods_list'])) {
|
|
|
break;
|
|
|
}
|
...
|
...
|
@@ -775,8 +789,7 @@ class CartModel |
|
|
|
|
|
//JIT拆单需求 package
|
|
|
$result['packages'] = self::getPackageInfo($pay['data']['shopping_cart_data']);
|
|
|
}
|
|
|
while (false);
|
|
|
} while (false);
|
|
|
|
|
|
return $result;
|
|
|
}
|
...
|
...
|
@@ -1403,11 +1416,23 @@ class CartModel |
|
|
*/
|
|
|
public function addTicket($uid, $productSku, $buyNumber, $yohoNum = 0)
|
|
|
{
|
|
|
$data = CartData::addTicket($uid, $productSku, $buyNumber, $yohoNum);
|
|
|
if (!empty($data['data'])) {
|
|
|
return $data['data'];
|
|
|
}
|
|
|
return CartData::addTicket($uid, $productSku, $buyNumber, $yohoNum);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 订单确认-处理添加商品
|
|
|
* @param int $uid 用户ID
|
|
|
* @param type int $productSku 产品sku
|
|
|
* @param type int $buyNumber 购买数量,范围1-4
|
|
|
* @param type int $yohoNum yoho币
|
|
|
* @return type
|
|
|
*/
|
|
|
public function filterTicket($uid, $productSku, $buyNumber, $yohoNum = 0)
|
|
|
{
|
|
|
$cartType = 'advance';
|
|
|
|
|
|
$data = self::addTicket($uid, $productSku, $buyNumber, $yohoNum);
|
|
|
|
|
|
return $data;
|
|
|
return self::filterCartPay($data, $cartType, false);
|
|
|
}
|
|
|
} |
...
|
...
|
|