|
|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
namespace hd\controllers;
|
|
|
|
|
|
+use biz\set\classes\SetClass;
|
|
|
use biz\sj\services\MerchantExtendService;
|
|
|
use biz\sj\services\MerchantService;
|
|
|
use bizHd\saas\services\RenewService;
|
|
|
@@ -31,10 +32,17 @@ class RenewController extends BaseController
|
|
|
$addData['shopAdminId'] = $shopAdminId;
|
|
|
$shopAdmin = $this->shopAdmin;
|
|
|
$adminName = $shopAdmin['name'] ?? '';
|
|
|
+ $sjId = $shopAdmin['merchantId'] ?? 0;
|
|
|
$addData['shopAdminName'] = $adminName;
|
|
|
- $price = 0.01;
|
|
|
+
|
|
|
+ $set = SetClass::getByCondition(['style' => SetClass::SET_STYLE_GHS], true, 'id asc');
|
|
|
+ if (empty($set)) {
|
|
|
+ util::fail('没有找到套餐');
|
|
|
+ }
|
|
|
+ $price = $set->price;
|
|
|
$prePrice = $price;
|
|
|
$actPrice = $price;
|
|
|
+ $setId = $set->id;
|
|
|
$addData['actPrice'] = $actPrice;
|
|
|
$addData['prePrice'] = $prePrice;
|
|
|
$addData['merchantId'] = $this->sjId;
|
|
|
@@ -45,14 +53,15 @@ class RenewController extends BaseController
|
|
|
$orderId = $order['id'];
|
|
|
$orderSn = $order['orderSn'];
|
|
|
$couponId = 0;
|
|
|
- $name = '基础版开通续费';
|
|
|
+ $name = $set->name . '开通及续费';
|
|
|
$totalFee = $actPrice;
|
|
|
$admin = $this->admin;
|
|
|
//小程序使用miniOpenId
|
|
|
$openId = $admin['miniOpenId'];
|
|
|
|
|
|
$capitalType = dict::getDict('capitalType', 'xhRenew', 'id');
|
|
|
- $attach = 'capitalType=' . $capitalType . '&couponId=' . $couponId;//将流水类型、优惠卷传过去
|
|
|
+ //将流水类型、优惠卷传过去
|
|
|
+ $attach = 'capitalType=' . $capitalType . '&couponId=' . $couponId . '&setId=' . $setId . '&sjId=' . $sjId;
|
|
|
$wx = Yii::getAlias("@vendor/weixin");
|
|
|
require_once($wx . '/lib/WxPay.Api.php');
|
|
|
require_once($wx . '/example/WxPay.JsApiPay.php');
|