|
|
@@ -5,6 +5,7 @@ namespace hd\controllers;
|
|
|
use biz\sj\services\MerchantAssetService;
|
|
|
use biz\sj\services\MerchantExtendService;
|
|
|
use biz\sj\services\MerchantService;
|
|
|
+use bizHd\custom\classes\CustomClass;
|
|
|
use bizHd\merchant\services\ShopService;
|
|
|
use bizHd\order\classes\OrderClass;
|
|
|
use bizHd\order\classes\OrderSendClass;
|
|
|
@@ -50,12 +51,17 @@ class OrderController extends BaseController
|
|
|
$post['fromType'] = 1;//商城
|
|
|
$customId = $post['customId'] ?? 0;
|
|
|
if (!empty($customId)) {
|
|
|
- $customId = $this->customId;
|
|
|
+ $customInfo = CustomClass::getCustomInfo($customId);
|
|
|
+ CustomClass::valid($customInfo, $this->sjId);
|
|
|
+ $post['customId'] = $customId;
|
|
|
}
|
|
|
- $post['customId'] = $customId;
|
|
|
- //非门店订单
|
|
|
- $store = 0;
|
|
|
- $post['store'] = $store;
|
|
|
+ //门店订单
|
|
|
+ $post['store'] = 1;
|
|
|
+ //员工信息
|
|
|
+ $shopAdmin = $this->shopAdmin;
|
|
|
+ $shopAdminName = $shopAdmin['name'] ?? '';
|
|
|
+ $post['shopAdminName'] = $shopAdminName;
|
|
|
+ $post['shopAdminId'] = $this->shopAdminId;
|
|
|
|
|
|
$couponId = isset($post['couponId']) && !empty($post['couponId']) ? $post['couponId'] : 0;
|
|
|
|
|
|
@@ -85,7 +91,7 @@ class OrderController extends BaseController
|
|
|
if (empty($goodsStyleList)) {
|
|
|
util::fail('商品款式没有找到');
|
|
|
}
|
|
|
- $styleIdList = array_keys(array_column($goodsStyleList,null,"id"));
|
|
|
+ $styleIdList = array_keys(array_column($goodsStyleList, null, "id"));
|
|
|
if (in_array($goodsStyleId, $styleIdList) == false) {
|
|
|
util::fail('商品款式没有找到!');
|
|
|
}
|
|
|
@@ -220,7 +226,7 @@ class OrderController extends BaseController
|
|
|
UserService::validPayPassword($payPassword, $user);
|
|
|
//支付前验证订单有效性
|
|
|
OrderService::checkBeforePay($order, $this->adminId);
|
|
|
- $capitalType = dict::getDict('capitalType','xhOrder','id');
|
|
|
+ $capitalType = dict::getDict('capitalType', 'xhOrder', 'id');
|
|
|
$totalFee = $order['prePrice'];
|
|
|
$sourceType = 0;
|
|
|
$discountData = OrderService::getDiscountPrice(['price' => $totalFee, 'sourceType' => $sourceType, 'couponId' => $couponId, 'userId' => $this->adminId]);
|
|
|
@@ -258,7 +264,7 @@ class OrderController extends BaseController
|
|
|
} else {
|
|
|
$openId = $this->user['openId'];
|
|
|
}
|
|
|
- $capitalType = dict::getDict('capitalType','xhOrder','id');
|
|
|
+ $capitalType = dict::getDict('capitalType', 'xhOrder', 'id');
|
|
|
//流水类型、优惠卷、微信支付(h5还是小程序支付)类型 带到回调
|
|
|
$wxPayType = 0;
|
|
|
if (httpUtil::isMiniProgram()) {
|
|
|
@@ -375,7 +381,7 @@ class OrderController extends BaseController
|
|
|
if (empty($openId)) {
|
|
|
util::fail('没有找到客户的openId');
|
|
|
}
|
|
|
- $capitalType = dict::getDict('capitalType','xhOrder','id');
|
|
|
+ $capitalType = dict::getDict('capitalType', 'xhOrder', 'id');
|
|
|
//流水类型、优惠卷、微信支付(h5还是小程序支付)类型 带到回调
|
|
|
$wxPayType = 0;
|
|
|
if (httpUtil::isMiniProgram()) {
|
|
|
@@ -451,7 +457,7 @@ class OrderController extends BaseController
|
|
|
$body = '';//商品描述,可空
|
|
|
$timeout_express = "1m";//超时时间
|
|
|
|
|
|
- $capitalType = dict::getDict('capitalType','xhOrder','id');
|
|
|
+ $capitalType = dict::getDict('capitalType', 'xhOrder', 'id');
|
|
|
$passBackParams = 'capitalType=' . $capitalType . '&couponId=' . $couponId . '&merchantId=' . $merchantId;//将流水类型、优惠卷传过去
|
|
|
$passBackParams = urlencode($passBackParams);
|
|
|
|
|
|
@@ -476,7 +482,7 @@ class OrderController extends BaseController
|
|
|
$payPassword = isset($post['payPassword']) ? $post['payPassword'] : 0;
|
|
|
$user = UserService::getUserInfo($this->adminId, false);
|
|
|
UserService::validPayPassword($payPassword, $user);
|
|
|
- $capitalType = dict::getDict('capitalType','xhOrder','id');
|
|
|
+ $capitalType = dict::getDict('capitalType', 'xhOrder', 'id');
|
|
|
$callbackParams = [];
|
|
|
$respond = xhPayToolService::balancePay($callbackParams, $orderSn, $actPrice, $capitalType, $couponId);
|
|
|
$balance = isset($respond['balance']) ? $respond['balance'] : 0;
|
|
|
@@ -597,7 +603,7 @@ class OrderController extends BaseController
|
|
|
$orderSn = $order['orderSn'];
|
|
|
|
|
|
//流水类型列表
|
|
|
- $capitalType = dict::getDict('capitalType','xhOrder','id');
|
|
|
+ $capitalType = dict::getDict('capitalType', 'xhOrder', 'id');
|
|
|
$callbackParams = [];
|
|
|
switch ($payWay) {
|
|
|
case 0:
|