Эх сурвалжийг харах

Merge branch 'master' of http://git.huaml.com/zhh/huahuibao

林琦海 5 жил өмнө
parent
commit
19c3dd8c29

+ 19 - 10
app-hd/controllers/RechargeController.php

@@ -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;

+ 1 - 1
common/components/stringUtil.php

@@ -46,7 +46,7 @@ class stringUtil
 	}
 	
 	//是否所有都是英文字母 ssh 2021.1
-	public static function isLetter()
+	public static function isLetter($str)
 	{
 		if (preg_match("/^[a-zA-Z\s]+$/", $str)) {
 			return true;

+ 1 - 0
sql.sql

@@ -2204,6 +2204,7 @@ ALTER TABLE xhShopAd RENAME TO xhShopImg;
 ALTER TABLE `xhCategory` MODIFY `status` TINYINT(4) NOT NULL DEFAULT '1' COMMENT '状态 0停用1启用';
 ALTER TABLE xhGoods MODIFY `py` VARCHAR(20) NOT NULL DEFAULT '' COMMENT '拼音' AFTER goodsName;
 ALTER TABLE xhGoodsCategory ADD py VARCHAR(50) NOT NULL DEFAULT '' COMMENT '拼音' AFTER `goodsName`;
+ALTER TABLE `xhShop` ADD rechargeNum INT NOT NULL DEFAULT 0 COMMENT '充值续期数量' AFTER `mayGathering`;
 
 执行命令将原有的商品拼音补齐 yii goods/py