|
@@ -53,9 +53,9 @@ class OrderService
|
|
if (empty($package)) {
|
|
if (empty($package)) {
|
|
throw new Exception('未找到套餐信息');
|
|
throw new Exception('未找到套餐信息');
|
|
}
|
|
}
|
|
- if ($package['company_id'] != $companyId) {
|
|
|
|
|
|
+ /*if ($package['company_id'] != $companyId) {
|
|
throw new Exception('您绑定的门店和购买套餐门店不一致');
|
|
throw new Exception('您绑定的门店和购买套餐门店不一致');
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
if ($payType == 'wallet') {//验证余额
|
|
if ($payType == 'wallet') {//验证余额
|
|
$userWalletWhere['user_id'] = $userId;
|
|
$userWalletWhere['user_id'] = $userId;
|
|
$userWalletWhere['company_id'] = $companyId;
|
|
$userWalletWhere['company_id'] = $companyId;
|
|
@@ -208,6 +208,21 @@ class OrderService
|
|
} else {
|
|
} else {
|
|
$checkCodeStr = Random::alnum(8);
|
|
$checkCodeStr = Random::alnum(8);
|
|
}
|
|
}
|
|
|
|
+ if ($package['type'] == 2) {//卡券类型直接已完成
|
|
|
|
+ $orderStatus = 3;
|
|
|
|
+ $userCouponsParams = [
|
|
|
|
+ 'package_id' => $packageId,
|
|
|
|
+ 'company_id' => $companyId,
|
|
|
|
+ 'user_id' => $userId,
|
|
|
|
+ 'payorder_id'=> $payOrderId,
|
|
|
|
+ ];
|
|
|
|
+ $userCouponsRes = $userService->packageCoupons($userCouponsParams);
|
|
|
|
+ if (!$userCouponsRes['status']) {
|
|
|
|
+ throw new Exception($userCouponsRes['msg']);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ $orderStatus = 1;
|
|
|
|
+ }
|
|
$orderData = [
|
|
$orderData = [
|
|
'check_code' => $checkCodeStr,
|
|
'check_code' => $checkCodeStr,
|
|
'orderno' => createUniqueNo('O', $userId),//订单号
|
|
'orderno' => createUniqueNo('O', $userId),//订单号
|
|
@@ -224,7 +239,7 @@ class OrderService
|
|
'server_info' => isset($package['info']) ? $package['info'] : '',//套餐内容
|
|
'server_info' => isset($package['info']) ? $package['info'] : '',//套餐内容
|
|
'server_images' => isset($package['images']) ? $package['images'] : '',//套餐图片
|
|
'server_images' => isset($package['images']) ? $package['images'] : '',//套餐图片
|
|
'pay_fee' => isset($package['price']) ? $package['price'] : 0.00,//套餐价格
|
|
'pay_fee' => isset($package['price']) ? $package['price'] : 0.00,//套餐价格
|
|
- 'status' => 1,//状态:1=待核销,2=待处理,3=已完成,4=已取消
|
|
|
|
|
|
+ 'status' => $orderStatus,//状态:1=待核销,2=待处理,3=已完成,4=已取消
|
|
'pay_time' => $time,
|
|
'pay_time' => $time,
|
|
'paytype' => $orderPayType,//支付方式:1=线下,2=余额,3=微信
|
|
'paytype' => $orderPayType,//支付方式:1=线下,2=余额,3=微信
|
|
'total_fee' => isset($package['price']) ? $package['price'] : 0.00,//支付总额
|
|
'total_fee' => isset($package['price']) ? $package['price'] : 0.00,//支付总额
|