|
|
@@ -3,11 +3,11 @@
|
|
|
namespace hd\controllers;
|
|
|
|
|
|
use biz\recharge\classes\RechargeClass;
|
|
|
+use biz\shop\classes\ShopClass;
|
|
|
use biz\sj\classes\SjClass;
|
|
|
use bizHd\wx\classes\WxOpenClass;
|
|
|
use common\components\dict;
|
|
|
use common\components\httpUtil;
|
|
|
-use common\components\imgUtil;
|
|
|
use common\components\util;
|
|
|
use Yii;
|
|
|
|
|
|
@@ -26,14 +26,22 @@ class RechargeController extends BaseController
|
|
|
public function actionRenew()
|
|
|
{
|
|
|
$sj = $this->sj;
|
|
|
- $parentId = $sj['parentId'] ?? 0;
|
|
|
- $parentSj = SjClass::getById($parentId);
|
|
|
- $sjName = $parentSj['name'] ?? '';
|
|
|
+ $shopId = $sj['parentShopId'] ?? 0;
|
|
|
+ $shopName = '';
|
|
|
+ $rechargeNum = getenv('RECHARGE_NUM') ?? 268;
|
|
|
+ if (!empty($shopId)) {
|
|
|
+ $shop = ShopClass::getShopInfo($shopId);
|
|
|
+ if (!empty($shop)) {
|
|
|
+ $shopName = $shop['shopName'] ?? '';
|
|
|
+ $num = $shop['rechargeNum'] ?? 0;
|
|
|
+ $rechargeNum += $num;
|
|
|
+ }
|
|
|
+ }
|
|
|
$data = [
|
|
|
- 'renew' => getenv('RENEW_PRICE'),
|
|
|
- 'recharge' => getenv('RECHARGE_PRICE'),
|
|
|
- 'shopName' => $sjName,
|
|
|
- 'userNum' => 150
|
|
|
+ 'renew' => getenv('RENEW_PRICE') ?? 3980,
|
|
|
+ 'recharge' => getenv('RECHARGE_PRICE') ?? 5980,
|
|
|
+ 'shopName' => $shopName,
|
|
|
+ 'userNum' => $rechargeNum
|
|
|
];
|
|
|
util::success($data);
|
|
|
}
|
|
|
@@ -43,8 +51,9 @@ class RechargeController extends BaseController
|
|
|
{
|
|
|
ini_set('date.timezone', 'Asia/Shanghai');
|
|
|
$wxPay = dict::getConfig('payWay', 'wxPay');
|
|
|
+ $price = getenv('RECHARGE_PRICE') ?? 5980;
|
|
|
$data = [
|
|
|
- 'amount' => 5980,
|
|
|
+ 'amount' => $price,
|
|
|
'payWay' => $wxPay,
|
|
|
'sjId' => $this->sjId,
|
|
|
'sjStyle' => SjClass::STYLE_RETAIL,
|
|
|
@@ -67,7 +76,7 @@ class RechargeController extends BaseController
|
|
|
if (httpUtil::isMiniProgram()) {
|
|
|
$wxPayType = 1;
|
|
|
}
|
|
|
- $attach = "couponId=0&capitalType=" . $capitalType . '&wxPayType=' . $wxPayType;
|
|
|
+ $attach = "couponId=0&capitalType=" . $capitalType . '&wxPayType=' . $wxPayType + '&renew=1';
|
|
|
//订单30分钟后过期
|
|
|
$now = time();
|
|
|
$expireTime = $now + 1800;
|