更新
This commit is contained in:
parent
3d461544f0
commit
f940cd20bc
@ -29,6 +29,7 @@ class StoreCartDao extends BaseDao
|
|||||||
|
|
||||||
const SOURCE_STORE_CLOUD = 101; //店铺内云商品
|
const SOURCE_STORE_CLOUD = 101; //店铺内云商品
|
||||||
const SOURCE_CLOUD = 102; //云仓内店铺商品
|
const SOURCE_CLOUD = 102; //云仓内店铺商品
|
||||||
|
const CITY_CLOUD = 103; //市级云仓商品
|
||||||
const SOURCE_COMMUNITY_RESALE = 201; //转售商品
|
const SOURCE_COMMUNITY_RESALE = 201; //转售商品
|
||||||
const SOURCE_COMMUNITY_ENTRUST = 202; //委托商品
|
const SOURCE_COMMUNITY_ENTRUST = 202; //委托商品
|
||||||
|
|
||||||
|
@ -63,6 +63,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
|||||||
$svip_integral_rate = $svip_status ? app()->make(MemberinterestsRepository::class)->getSvipInterestVal(MemberinterestsRepository::HAS_TYPE_PAY) : 0;
|
$svip_integral_rate = $svip_status ? app()->make(MemberinterestsRepository::class)->getSvipInterestVal(MemberinterestsRepository::HAS_TYPE_PAY) : 0;
|
||||||
//订单活动类型
|
//订单活动类型
|
||||||
$order_type = 0;
|
$order_type = 0;
|
||||||
|
$source = 2;
|
||||||
//虚拟订单
|
//虚拟订单
|
||||||
$order_model = 0;
|
$order_model = 0;
|
||||||
//虚拟订单自定义数据
|
//虚拟订单自定义数据
|
||||||
@ -84,7 +85,10 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
|||||||
throw new ValidateException('[超出限购总数:'. $cart['product']['once_max_count'].']'.mb_substr($cart['product']['store_name'],0,10).'...');
|
throw new ValidateException('[超出限购总数:'. $cart['product']['once_max_count'].']'.mb_substr($cart['product']['store_name'],0,10).'...');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($cart['product_type'] > 0) $order_type = $cart['product_type'];
|
if ($cart['product_type'] > 0){
|
||||||
|
$order_type = $cart['product_type'];
|
||||||
|
$source = $cart['source'];
|
||||||
|
}
|
||||||
if ($cart['product_type']<=97 &&$cart['product_type'] > 0 && (($cart['product_type'] != 10 && count($merchantCart['list']) != 1) || count($merchantCartList) != 1)) {
|
if ($cart['product_type']<=97 &&$cart['product_type'] > 0 && (($cart['product_type'] != 10 && count($merchantCart['list']) != 1) || count($merchantCartList) != 1)) {
|
||||||
throw new ValidateException('活动商品必须单独购买');
|
throw new ValidateException('活动商品必须单独购买');
|
||||||
}
|
}
|
||||||
@ -900,7 +904,6 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
|||||||
$order_total_price = bcadd($order_total_price, $merchantCart['order']['svip_discount'], 2);
|
$order_total_price = bcadd($order_total_price, $merchantCart['order']['svip_discount'], 2);
|
||||||
}
|
}
|
||||||
unset($merchantCart);
|
unset($merchantCart);
|
||||||
|
|
||||||
$status = ($address || $order_model || $allow_no_address) ? ($noDeliver ? 'noDeliver' : 'finish') : 'noAddress';
|
$status = ($address || $order_model || $allow_no_address) ? ($noDeliver ? 'noDeliver' : 'finish') : 'noAddress';
|
||||||
$order = $merchantCartList;
|
$order = $merchantCartList;
|
||||||
$total_price = $order_total_price;
|
$total_price = $order_total_price;
|
||||||
@ -908,6 +911,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
|||||||
$total_coupon = bcadd($order_svip_discount, bcadd(bcadd($total_platform_coupon_price, $order_coupon_price, 2), $order_total_integral_price, 2), 2);
|
$total_coupon = bcadd($order_svip_discount, bcadd(bcadd($total_platform_coupon_price, $order_coupon_price, 2), $order_total_integral_price, 2), 2);
|
||||||
return compact(
|
return compact(
|
||||||
'order_type',
|
'order_type',
|
||||||
|
'source',
|
||||||
'order_model',
|
'order_model',
|
||||||
'order_extend',
|
'order_extend',
|
||||||
'order_total_postage',
|
'order_total_postage',
|
||||||
@ -1105,6 +1109,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
|||||||
$_order = [
|
$_order = [
|
||||||
'cartInfo' => $merchantCart,
|
'cartInfo' => $merchantCart,
|
||||||
'activity_type' => $orderInfo['order_type'],
|
'activity_type' => $orderInfo['order_type'],
|
||||||
|
'source' => $orderInfo['source']??2,
|
||||||
'commission_rate' => (float)$rate,
|
'commission_rate' => (float)$rate,
|
||||||
'order_type' => $merchantCart['order']['isTake'] ? 1 : 0,
|
'order_type' => $merchantCart['order']['isTake'] ? 1 : 0,
|
||||||
'is_virtual' => $order_model ? 1 : 0,
|
'is_virtual' => $order_model ? 1 : 0,
|
||||||
@ -1309,7 +1314,6 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
|||||||
];
|
];
|
||||||
|
|
||||||
foreach ($cartInfo['list'] as $cart) {
|
foreach ($cartInfo['list'] as $cart) {
|
||||||
|
|
||||||
$productPrice = $cart['true_price'];
|
$productPrice = $cart['true_price'];
|
||||||
$extension_one = $cart['extension_one'];
|
$extension_one = $cart['extension_one'];
|
||||||
$extension_two = $cart['extension_two'];
|
$extension_two = $cart['extension_two'];
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
namespace app\common\repositories\store\order;
|
namespace app\common\repositories\store\order;
|
||||||
|
|
||||||
|
use app\common\dao\store\order\StoreCartDao;
|
||||||
use app\common\dao\store\order\StoreOrderDao;
|
use app\common\dao\store\order\StoreOrderDao;
|
||||||
use app\common\model\store\order\StoreGroupOrder;
|
use app\common\model\store\order\StoreGroupOrder;
|
||||||
use app\common\model\store\order\StoreOrder;
|
use app\common\model\store\order\StoreOrder;
|
||||||
|
@ -93,8 +93,12 @@ class StoreCart extends BaseController
|
|||||||
case 99: //委托商品
|
case 99: //委托商品
|
||||||
$result = app()->make(ProductRepository::class)->cartCheck($data,$this->request->userInfo());
|
$result = app()->make(ProductRepository::class)->cartCheck($data,$this->request->userInfo());
|
||||||
[$source, $sourceId, $pid] = explode(':', $this->request->param('source', '0'), 3) + ['', '', ''];
|
[$source, $sourceId, $pid] = explode(':', $this->request->param('source', '0'), 3) + ['', '', ''];
|
||||||
$data['source'] = (in_array($source, [0, 1]) && $pid == $data['product_id']) ? $source : 0;
|
if($source==StoreCartDao::CITY_CLOUD){
|
||||||
if ($data['source'] > 0) $data['source_id'] = intval($sourceId);
|
$data['source'] = $source;
|
||||||
|
}else{
|
||||||
|
$data['source'] = (in_array($source, [0, 1]) && $pid == $data['product_id']) ? $source : 0;
|
||||||
|
if ($data['source'] > 0) $data['source_id'] = intval($sourceId);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 1: //秒杀商品
|
case 1: //秒杀商品
|
||||||
$result = app()->make(ProductRepository::class)->cartSeckillCheck($data,$this->request->userInfo());
|
$result = app()->make(ProductRepository::class)->cartSeckillCheck($data,$this->request->userInfo());
|
||||||
|
@ -95,7 +95,6 @@ class StoreOrder extends BaseController
|
|||||||
if (!is_array($receipt)) throw new ValidateException('发票信息有误');
|
if (!is_array($receipt)) throw new ValidateException('发票信息有误');
|
||||||
$validate->check($receipt);
|
$validate->check($receipt);
|
||||||
}
|
}
|
||||||
|
|
||||||
$uid = $this->request->uid();
|
$uid = $this->request->uid();
|
||||||
// halt(count($cartId), count($cartRepository->validIntersection($cartId, $uid)));
|
// halt(count($cartId), count($cartRepository->validIntersection($cartId, $uid)));
|
||||||
if (!($count = count($cartId)) || $count != count($cartRepository->validIntersection($cartId, $uid)))
|
if (!($count = count($cartId)) || $count != count($cartRepository->validIntersection($cartId, $uid)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user