|
|
@@ -71,27 +71,9 @@ class PurchaseController extends BaseController
|
|
|
$post['sendCost'] = isset($post['sendCost']) && is_numeric($post['sendCost']) ? $post['sendCost'] : 0;
|
|
|
|
|
|
$respond = PurchaseService::createPurchase($post, $ghsInfo);
|
|
|
- $orderSn = $respond->orderSn ?? '';
|
|
|
- $actPrice = $respond->actPrice ?? '';
|
|
|
- $realPrice = $respond->realPrice ?? '';
|
|
|
$transaction->commit();
|
|
|
- //可以付款的倒计时,实际少120秒,避免支付回调时订单已经自动过期
|
|
|
- $count = dict::getDict('sale_purchase_order_valid');
|
|
|
-
|
|
|
- $custom = CustomClass::getById($customId);
|
|
|
- $hasDebtPay = $custom['debt'] ?? 0;
|
|
|
-
|
|
|
- $data = [
|
|
|
- 'orderSn' => $orderSn,
|
|
|
- 'actPrice' => $actPrice,
|
|
|
- 'realPrice' => $realPrice,
|
|
|
- 'hasBalancePay' => 1,
|
|
|
- 'hasPayPassword' => 0,
|
|
|
- 'hasDebtPay' => $hasDebtPay,
|
|
|
- 'count' => $count,
|
|
|
- 'balance' => $this->shop->balance ?? 0,
|
|
|
- ];
|
|
|
- util::success($data);
|
|
|
+
|
|
|
+ util::success($respond);
|
|
|
|
|
|
} catch (Exception $e) {
|
|
|
$transaction->rollBack();
|
|
|
@@ -132,6 +114,11 @@ class PurchaseController extends BaseController
|
|
|
//余额支付 ssh 2021.1.24
|
|
|
public function actionBalancePay()
|
|
|
{
|
|
|
+ $shopAdmin = $this->shopAdmin;
|
|
|
+ if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
|
|
|
+ util::fail('超管才能操作');
|
|
|
+ }
|
|
|
+
|
|
|
$get = Yii::$app->request->get();
|
|
|
$orderSn = $get['orderSn'] ?? 0;
|
|
|
$password = $get['password'] ?? '';
|
|
|
@@ -181,6 +168,13 @@ class PurchaseController extends BaseController
|
|
|
if (isset($info['shopId']) == false || $info['shopId'] != $this->shopId) {
|
|
|
util::fail('没有权限访问');
|
|
|
}
|
|
|
+
|
|
|
+ $customId = $info['customId'] ?? 0;
|
|
|
+ $custom = CustomClass::getById($customId);
|
|
|
+ $hasDebtPay = $custom['debt'] ?? 0;
|
|
|
+ $info['hasDebtPay'] = $hasDebtPay;
|
|
|
+ $info['balance'] = $this->shop->balance ?? 0;
|
|
|
+
|
|
|
util::success($info);
|
|
|
}
|
|
|
|