Commit 855dfb86 authored by liuyuzhen's avatar liuyuzhen

新订单确认页面

parent ecd4f9e0
......@@ -122,6 +122,31 @@ class CartController extends \Our\Controller_AbstractApi{
}
/**
* 购物车购买
*/
public function checkoutNewAction(){
$cartService = \Business\Cart\CartServiceModel::getInstance();
$data = $this->req[\Our\NameConst::data];
$sess=\Yaf\Session::getInstance();
$currentAddress = $sess->get('currentAddress');
$address = $cartService->checkCurrentAddress($currentAddress,$this->memberId);
$storeCartList = $cartService->checkCart($data,$this->memberId);
$pBundlingService = \Business\Goods\GroupSaleServiceModel::getInstance();
$cartList = $pBundlingService->getFormatCartListForOrder($storeCartList,$this->memberId,true);
$gcIds = isset($cartList['gcIds'])?$cartList['gcIds']:array();
$storeCartData = array('cartList'=>$cartList['list'],'storeIds'=>$storeCartList['storeIds'],'goodsIds'=>$storeCartList['goodsIds'],'goodsCommonIds'=>$storeCartList['goodsCommonIds'],'blIds'=>$storeCartList['blIds'],'gcIds'=>$gcIds);
//var_dump($storeCartData);
$storeCartData = $cartService->checkCouponForCart($storeCartData,$this->memberId);
//$this->success($storeCartData);
$storeCartData = $cartService->getDeliveryTypeForCartNew($address,$storeCartData);
$data = $cartService->getFormatCartListForOrderNew($storeCartData,$address);
$this->success($data);
}
/**
* 立即购买
*/
......@@ -144,6 +169,28 @@ class CartController extends \Our\Controller_AbstractApi{
}
/**
* 立即购买
*/
public function buyNowNewAction(){
$cartService = \Business\Cart\CartServiceModel::getInstance();
$data = $this->req[\Our\NameConst::data];
$sess=\Yaf\Session::getInstance();
$currentAddress = $sess->get('currentAddress');
$address = $cartService->checkCurrentAddress($currentAddress,$this->memberId);
$cartService->checkBuynow($data,$this->memberId);
$pBundlingService = \Business\Goods\GroupSaleServiceModel::getInstance();
$cartList = $pBundlingService->getFormatBuyNowListForOrder($data,$this->memberId);
$gcIds = isset($cartList['gcIds'])?$cartList['gcIds']:array();
$storeCartData = array('cartList'=>$cartList['list'],'storeIds'=>array_keys($cartList['list']),'goodsIds'=>$cartList['goodsIds'],'goodsCommonIds'=>$cartList['goodsCommonIds'],'blIds'=>$cartList['blIds'],'gcIds'=>$gcIds);
$storeCartData = $cartService->checkCouponForCart($storeCartData,$this->memberId);
$storeCartData = $cartService->getDeliveryTypeForCartNew($address,$storeCartData);
//$this->success($storeCartData);
$data = $cartService->getFormatCartListForOrderNew($storeCartData,$address);
$this->success($data);
}
public function addOrderAction(){
$cartService = \Business\Cart\CartServiceModel::getInstance();
$data = $this->req[\Our\NameConst::data];
......
......@@ -22,6 +22,8 @@ class ApiConst
//一个小时
const oneHour = 3600;
const halfHour = 1800;
const twoMinSecond = 120;
const fiveMinutes=180;
......@@ -35,6 +37,7 @@ class ApiConst
//八小时秒数
const EightHoursSecond = 28800;
const hundred = 100;
const thousand = 1000;
//1分钟秒数
const oneMinSecond = 60;
//成功状态码
......
......@@ -6,9 +6,9 @@ use Our\ImageUtil;
class GroupSaleServiceModel extends \Business\AbstractModel {
private $pBundingField = 'han_p_bundling.bl_id AS blId,bl_name AS name,bl_title,store_id,store_name,bl_state,bl_quota_starttime,bl_image,bl_storage,bl_discount_price AS discountPrice,bl_sum_price AS sumPrice,bl_quota_endtime AS endTime,image,is_transport,transport_id,snapshot_id,goods_freight,goods_free';
private $pBundingField = 'han_p_bundling.bl_id AS blId,bl_name AS name,bl_title,store_id,store_name,bl_state,bl_quota_starttime,bl_image,bl_storage,bl_discount_price AS discountPrice,bl_sum_price AS sumPrice,bl_quota_endtime AS endTime,image,is_transport,transport_id,snapshot_id,goods_freight,goods_free,delivery_template_id';
private $pBundingFieldWithDel = 'han_p_bundling.bl_id AS blId,bl_name AS name,bl_title,store_id,store_name,bl_state,bl_quota_starttime,bl_image,bl_storage,bl_discount_price AS discountPrice,bl_sum_price AS sumPrice,bl_quota_endtime AS endTime,image,is_transport,transport_id,snapshot_id,goods_freight,goods_free,is_del';
private $pBundingFieldWithDel = 'han_p_bundling.bl_id AS blId,bl_name AS name,bl_title,store_id,store_name,bl_state,bl_quota_starttime,bl_image,bl_storage,bl_discount_price AS discountPrice,bl_sum_price AS sumPrice,bl_quota_endtime AS endTime,image,is_transport,transport_id,snapshot_id,goods_freight,goods_free,is_del,delivery_template_id';
private $pBundingGoodsField = 'bl_count_price AS discountPrice,num,goods_id,bl_id';
......@@ -693,6 +693,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
$tempObj['goodsList'] = \Our\Common::convertUnderline($pBundling['goodsList']);
$tempObj['goodsOriginalPrice'] = $pBundling['sumPrice'];
$tempObj['snapshot_id'] = (isset($pBundling['snapshot_id'])&&$pBundling['snapshot_id']>\Our\ApiConst::zero)?$pBundling['snapshot_id']:\Our\ApiConst::zero;
$tempObj['delivery_template_id'] = (isset($pBundling['delivery_template_id'])&&$pBundling['delivery_template_id'])?$pBundling['delivery_template_id']:\Our\ApiConst::zero;
} else if ($tempCart['type'] == \Our\ApiConst::addGoodsToCart) {
$priceArray = \Goods\GoodsUtil::getInstance()->getRealPrice($tempCart['goods_id'],$memberId,null, \Our\ApiConst::addGoodsToCart,$dbName,true);
if(is_array($priceArray)){
......@@ -737,6 +738,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
$tempObj['gc_id']=$goodsCommonStorages[$tempCart['goods_commonid']]['gc_id'];
$tempObj['gc_id_2']=$goodsCommonStorages[$tempCart['goods_commonid']]['gc_id_2'];
$tempObj['gc_id_3']=$goodsCommonStorages[$tempCart['goods_commonid']]['gc_id_3'];
$tempObj['delivery_template_id']=$goodsCommonStorages[$tempCart['goods_commonid']]['delivery_template_id']?$goodsCommonStorages[$tempCart['goods_commonid']]['delivery_template_id']:\Our\ApiConst::zero;
$allGcIds[] = $tempObj['gcId'];
$storeGcIds[] = $tempObj['gcId'];
if ($goodsStorage['onlineFlag'] == \Our\ApiConst::one) {
......@@ -887,6 +889,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
}
$storeTotalPrice += $pBundling['discountPrice']*$tempObj['goodsNum'];
$tempObj['goodsList'] = \Our\Common::convertUnderline($pBundling['goodsList']);
$tempObj['delivery_template_id'] = $pBundling['delivery_template_id']?$pBundling['delivery_template_id']:\Our\ApiConst::zero;
$tempObj['goodsOriginalPrice'] = $pBundling['sumPrice'];
}else if(isset($data['goodsId'])){
......@@ -945,6 +948,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
$tempObj['gc_id']=$goodsCommonStorages[$goods['goods_commonid']]['gc_id'];
$tempObj['gc_id_2']=$goodsCommonStorages[$goods['goods_commonid']]['gc_id_2'];
$tempObj['gc_id_3']=$goodsCommonStorages[$goods['goods_commonid']]['gc_id_3'];
$tempObj['delivery_template_id']=$goodsCommonStorages[$goods['goods_commonid']]['delivery_template_id']?$goodsCommonStorages[$goods['goods_commonid']]['delivery_template_id']:\Our\ApiConst::zero;
$allGcIds[] = $tempObj['gcId'];
$storeGcIds[] = $tempObj['gcId'];
if ($goodsStorage['onlineFlag'] == \Our\ApiConst::one) {
......
This diff is collapsed.
......@@ -261,7 +261,7 @@ class GoodsModel extends \DAO\AbstractModel {
}
if($fromCart){
$sql = \Our\Common::format(' goods_commonid in ({0})',implode(',',$goodsCommonIds));
$field = 'goods_commonid,goods_id,goods_storage,goods_state,goods_verify,is_transport,transport_id,gc_id,gc_id_1,gc_id_2,gc_id_3,snapshot_id,goods_image,goods_freight,goods_free';
$field = 'goods_commonid,goods_id,goods_storage,goods_state,goods_verify,is_transport,transport_id,gc_id,gc_id_1,gc_id_2,gc_id_3,snapshot_id,goods_image,goods_freight,goods_free,delivery_template_id';
}else if($noRedisGoodsCommonIds){
$sql = \Our\Common::format(' goods_commonid in ({0})',implode(',',$noRedisGoodsCommonIds));
$field = 'goods_commonid,goods_id,goods_storage,goods_state,goods_verify';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment