Merge branch 'dev' of https://gitea.lihaink.cn/mkm/shop-new into dev
This commit is contained in:
commit
2338f133a1
@ -897,7 +897,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function v2CreateOrder($key, int $pay_type, $user, array $cartId, array $extend, array $mark, array $receipt_data, array $takes = null, array $useCoupon = null, bool $useIntegral = false, int $addressId = null, array $post)
|
public function v2CreateOrder($key, int $pay_type, $user, array $cartId, array $extend, array $mark, array $receipt_data, array $takes = null, array $useCoupon = null, bool $useIntegral = false, int $addressId = null, array $post,$remarkMoney)
|
||||||
{
|
{
|
||||||
$uid = $user->uid;
|
$uid = $user->uid;
|
||||||
// $orderInfo = $this->v2CartIdByOrderInfo($user, $cartId, $takes, $useCoupon, $useIntegral, $addressId, true);
|
// $orderInfo = $this->v2CartIdByOrderInfo($user, $cartId, $takes, $useCoupon, $useIntegral, $addressId, true);
|
||||||
@ -1134,6 +1134,14 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
|||||||
$totalCost = bcadd($totalCost, $cost, 2);
|
$totalCost = bcadd($totalCost, $cost, 2);
|
||||||
$totalNum += $merchantCart['order']['total_num'];
|
$totalNum += $merchantCart['order']['total_num'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//当$remarkMoney不为0得时候就是输入金额匹配去处理得
|
||||||
|
$pay_price = $orderInfo['order_price'];
|
||||||
|
$coupon_price = bcadd($orderInfo['total_platform_coupon_price'], $orderInfo['order_coupon_price'], 2);
|
||||||
|
if($remarkMoney){
|
||||||
|
$pay_price = $remarkMoney;//输入得金额
|
||||||
|
$coupon_price = $orderInfo['order_price'] -$pay_price;
|
||||||
|
}
|
||||||
$groupOrder = [
|
$groupOrder = [
|
||||||
'uid' => $uid,
|
'uid' => $uid,
|
||||||
'group_order_sn' => count($orderList) === 1 ? $orderList[0]['order_sn'] : ($this->getNewOrderId(StoreOrderRepository::TYPE_SN_ORDER) . '0'),
|
'group_order_sn' => count($orderList) === 1 ? $orderList[0]['order_sn'] : ($this->getNewOrderId(StoreOrderRepository::TYPE_SN_ORDER) . '0'),
|
||||||
@ -1143,8 +1151,8 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
|||||||
'real_name' => $address['real_name'] ?? '',
|
'real_name' => $address['real_name'] ?? '',
|
||||||
'user_phone' => $address['phone'] ?? '',
|
'user_phone' => $address['phone'] ?? '',
|
||||||
'user_address' => $user_address,
|
'user_address' => $user_address,
|
||||||
'pay_price' => $orderInfo['order_price'],
|
'pay_price' => $pay_price,
|
||||||
'coupon_price' => bcadd($orderInfo['total_platform_coupon_price'], $orderInfo['order_coupon_price'], 2),
|
'coupon_price' => $coupon_price,
|
||||||
'pay_postage' => $totalPostage,
|
'pay_postage' => $totalPostage,
|
||||||
'cost' => $totalCost,
|
'cost' => $totalCost,
|
||||||
'coupon_id' => $orderInfo['usePlatformCouponId'] > 0 ? $orderInfo['usePlatformCouponId'] : '',
|
'coupon_id' => $orderInfo['usePlatformCouponId'] > 0 ? $orderInfo['usePlatformCouponId'] : '',
|
||||||
@ -1157,7 +1165,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
|||||||
'sale_type' => $saleType,
|
'sale_type' => $saleType,
|
||||||
];
|
];
|
||||||
event('order.create.before', compact('groupOrder', 'orderList'));
|
event('order.create.before', compact('groupOrder', 'orderList'));
|
||||||
$group = Db::transaction(function () use ($ex, $user, $topUid, $spreadUid, $uid, $receipt_data, $cartIds, $allUseCoupon, $groupOrder, $orderList, $orderInfo, $useCoupon) {
|
$group = Db::transaction(function () use ($ex, $user, $topUid, $spreadUid, $uid, $receipt_data, $cartIds, $allUseCoupon, $groupOrder, $orderList, $orderInfo, $useCoupon,$pay_type) {
|
||||||
$storeGroupOrderRepository = app()->make(StoreGroupOrderRepository::class);
|
$storeGroupOrderRepository = app()->make(StoreGroupOrderRepository::class);
|
||||||
$storeCartRepository = app()->make(StoreCartRepository::class);
|
$storeCartRepository = app()->make(StoreCartRepository::class);
|
||||||
$attrValueRepository = app()->make(ProductAttrValueRepository::class);
|
$attrValueRepository = app()->make(ProductAttrValueRepository::class);
|
||||||
@ -1169,7 +1177,9 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
|||||||
$userMerchantRepository = app()->make(UserMerchantRepository::class);
|
$userMerchantRepository = app()->make(UserMerchantRepository::class);
|
||||||
$storeCouponUserDao = new StoreCouponUserDao();
|
$storeCouponUserDao = new StoreCouponUserDao();
|
||||||
|
|
||||||
//减库存
|
//减库存 ---不为对公转账
|
||||||
|
|
||||||
|
if ($pay_type != Enum::public) {
|
||||||
foreach ($orderList as $order) {
|
foreach ($orderList as $order) {
|
||||||
foreach ($order['cartInfo']['list'] as $cart) {
|
foreach ($order['cartInfo']['list'] as $cart) {
|
||||||
if (!isset($uniqueList[$cart['productAttr']['product_id'] . $cart['productAttr']['unique']]))
|
if (!isset($uniqueList[$cart['productAttr']['product_id'] . $cart['productAttr']['unique']]))
|
||||||
@ -1212,6 +1222,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($orderInfo['order_type'] == 10 && !app()->make(StoreDiscountRepository::class)->decStock($orderList[0]['cartInfo']['list'][0]['source_id'])) {
|
if ($orderInfo['order_type'] == 10 && !app()->make(StoreDiscountRepository::class)->decStock($orderList[0]['cartInfo']['list'][0]['source_id'])) {
|
||||||
throw new ValidateException('套餐库不足');
|
throw new ValidateException('套餐库不足');
|
||||||
|
@ -83,7 +83,7 @@ class StoreOrder extends BaseController
|
|||||||
$payType = $this->request->param('pay_type');
|
$payType = $this->request->param('pay_type');
|
||||||
$key = (string)$this->request->param('key');
|
$key = (string)$this->request->param('key');
|
||||||
$post = (array)$this->request->param('post');
|
$post = (array)$this->request->param('post');
|
||||||
|
$remarkMoney = $this->request->param('money')??0;//匹配金额
|
||||||
if(!$key){
|
if(!$key){
|
||||||
return app('json')->fail('订单操作超时,请刷新页面');
|
return app('json')->fail('订单操作超时,请刷新页面');
|
||||||
}
|
}
|
||||||
@ -108,9 +108,9 @@ class StoreOrder extends BaseController
|
|||||||
// if (!$addressId)
|
// if (!$addressId)
|
||||||
// return app('json')->fail('请选择地址');
|
// return app('json')->fail('请选择地址');
|
||||||
|
|
||||||
$groupOrder = app()->make(LockService::class)->exec('order.create', function () use ($key, $orderCreateRepository, $receipt_data, $mark, $extend, $cartId, $payType, $takes, $couponIds, $useIntegral, $addressId, $post) {
|
$groupOrder = app()->make(LockService::class)->exec('order.create', function () use ($key, $orderCreateRepository, $receipt_data, $mark, $extend, $cartId, $payType, $takes, $couponIds, $useIntegral, $addressId, $post,$remarkMoney) {
|
||||||
$orderCreateRepository->isScanOrder = (int)$this->request->param('source') == 999;
|
$orderCreateRepository->isScanOrder = (int)$this->request->param('source') == 999;
|
||||||
return $orderCreateRepository->v2CreateOrder($key, array_search($payType, StoreOrderRepository::PAY_TYPE), $this->request->userInfo(), $cartId, $extend, $mark, $receipt_data, $takes, $couponIds, $useIntegral, $addressId, $post);
|
return $orderCreateRepository->v2CreateOrder($key, array_search($payType, StoreOrderRepository::PAY_TYPE), $this->request->userInfo(), $cartId, $extend, $mark, $receipt_data, $takes, $couponIds, $useIntegral, $addressId, $post,$remarkMoney);
|
||||||
});
|
});
|
||||||
|
|
||||||
if ($isPc) {
|
if ($isPc) {
|
||||||
|
File diff suppressed because one or more lines are too long
1
public/system/css/chunk-e8cbb7b8.59418d44.css
Normal file
1
public/system/css/chunk-e8cbb7b8.59418d44.css
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/system/js/chunk-075409c3.a500307b.js
Normal file
1
public/system/js/chunk-075409c3.a500307b.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/system/js/chunk-113c7094.972e13d9.js
Normal file
1
public/system/js/chunk-113c7094.972e13d9.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/system/js/chunk-1212e895.906041e2.js
Normal file
1
public/system/js/chunk-1212e895.906041e2.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/system/js/chunk-15c05727.f302b04a.js
Normal file
1
public/system/js/chunk-15c05727.f302b04a.js
Normal file
File diff suppressed because one or more lines are too long
1
public/system/js/chunk-20790b18.76f2eaa1.js
Normal file
1
public/system/js/chunk-20790b18.76f2eaa1.js
Normal file
File diff suppressed because one or more lines are too long
1
public/system/js/chunk-228621c4.b6f27310.js
Normal file
1
public/system/js/chunk-228621c4.b6f27310.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/system/js/chunk-2b358f74.f1b8d21c.js
Normal file
1
public/system/js/chunk-2b358f74.f1b8d21c.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/system/js/chunk-2e75bd31.beb36745.js
Normal file
1
public/system/js/chunk-2e75bd31.beb36745.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/system/js/chunk-2fb83738.fe9c1d6f.js
Normal file
1
public/system/js/chunk-2fb83738.fe9c1d6f.js
Normal file
File diff suppressed because one or more lines are too long
1
public/system/js/chunk-3361eb27.43823d4a.js
Normal file
1
public/system/js/chunk-3361eb27.43823d4a.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/system/js/chunk-34132a2e.bcf3706d.js
Normal file
1
public/system/js/chunk-34132a2e.bcf3706d.js
Normal file
File diff suppressed because one or more lines are too long
1
public/system/js/chunk-3936811c.77a1bc31.js
Normal file
1
public/system/js/chunk-3936811c.77a1bc31.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/system/js/chunk-470780e0.afbe8705.js
Normal file
1
public/system/js/chunk-470780e0.afbe8705.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/system/js/chunk-51078492.dbd92db4.js
Normal file
1
public/system/js/chunk-51078492.dbd92db4.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/system/js/chunk-5f298bb4.2234c986.js
Normal file
1
public/system/js/chunk-5f298bb4.2234c986.js
Normal file
File diff suppressed because one or more lines are too long
1
public/system/js/chunk-617e4c8e.d16213a7.js
Normal file
1
public/system/js/chunk-617e4c8e.d16213a7.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/system/js/chunk-686ae425.29bf1db0.js
Normal file
1
public/system/js/chunk-686ae425.29bf1db0.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/system/js/chunk-6f5b4683.037315ec.js
Normal file
1
public/system/js/chunk-6f5b4683.037315ec.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/system/js/chunk-71b9caaa.a8b85ee1.js
Normal file
1
public/system/js/chunk-71b9caaa.a8b85ee1.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/system/js/chunk-782da10b.f6bb0e7d.js
Normal file
1
public/system/js/chunk-782da10b.f6bb0e7d.js
Normal file
File diff suppressed because one or more lines are too long
1
public/system/js/chunk-7975ef21.aadd2fdc.js
Normal file
1
public/system/js/chunk-7975ef21.aadd2fdc.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/system/js/chunk-7b663446.9f168ff4.js
Normal file
1
public/system/js/chunk-7b663446.9f168ff4.js
Normal file
File diff suppressed because one or more lines are too long
1
public/system/js/chunk-7c5c48a6.060c4067.js
Normal file
1
public/system/js/chunk-7c5c48a6.060c4067.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/system/js/chunk-9b82d688.30d17899.js
Normal file
1
public/system/js/chunk-9b82d688.30d17899.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/system/js/chunk-b7f65e7c.14840836.js
Normal file
1
public/system/js/chunk-b7f65e7c.14840836.js
Normal file
File diff suppressed because one or more lines are too long
1
public/system/js/chunk-c72367fa.712edaca.js
Normal file
1
public/system/js/chunk-c72367fa.712edaca.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/system/js/chunk-d319c860.13c5b198.js
Normal file
1
public/system/js/chunk-d319c860.13c5b198.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/system/js/chunk-e8cbb7b8.5eedd3df.js
Normal file
1
public/system/js/chunk-e8cbb7b8.5eedd3df.js
Normal file
File diff suppressed because one or more lines are too long
1
public/system/js/chunk-ef1ace64.197218a4.js
Normal file
1
public/system/js/chunk-ef1ace64.197218a4.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user