shish 5 years ago
parent
commit
c3bfce6ac7

+ 5 - 4
app-pt/controllers/CashController.php

@@ -54,13 +54,14 @@ class CashController extends BaseController
             if ($cashAmount <= 0) {
                 util::fail('提现金额有问题');
             }
+            $miniCashAmount = dict::getDict('miniCashAmount');
             if (getenv('YII_ENV', 'local') != 'production') {
-                if ($cashAmount > 5) {
-                    util::fail('测试环境提现金额不能超过5元');
+                if ($cashAmount > $miniCashAmount) {
+                    util::fail("测试环境提现金额不能超过{$miniCashAmount}元");
                 }
             }
-            if ($cashAmount < 5) {
-                util::fail('余额不足5元');
+            if ($cashAmount < $miniCashAmount) {
+                util::fail("余额不足{$miniCashAmount}元");
             }
 
             $getAmount = $cashAmount;

+ 6 - 5
biz/sj/classes/CashClass.php

@@ -4,6 +4,7 @@ namespace biz\sj\classes;
 
 use biz\shop\classes\ShopClass;
 use bizHd\base\classes\BaseClass;
+use common\components\dict;
 use common\components\noticeUtil;
 use common\components\orderSn;
 use common\components\util;
@@ -46,14 +47,14 @@ class CashClass extends BaseClass
         if (bccomp($txBalance, $shop->balance) == 1) {
             util::fail('余额有问题,总余额比可提现余额还少');
         }
-
+        $miniCashAmount = dict::getDict('miniCashAmount');
         if (getenv('YII_ENV', 'local') != 'production') {
-            if ($txBalance > 5) {
-                util::fail('测试环境提现金额不能超过5元');
+            if ($txBalance > $miniCashAmount) {
+                util::fail("测试环境提现金额不能超过{$miniCashAmount}元");
             }
         }
-        if (bccomp(5, $txBalance) == 1) {
-            util::fail('可提现余额不足5元');
+        if (bccomp($miniCashAmount, $txBalance) == 1) {
+            util::fail("可提现余额不足{$miniCashAmount}元");
         }
 
         //可提现余额减少,总余额减少,冻结金额增加

+ 3 - 0
common/components/dict.php

@@ -9,6 +9,9 @@ class dict
 
     public static $data = [
 
+        //余额满miniCashAmount才能提现
+        'miniCashAmount' => 5,
+
         //本条流水的余额是否可以提现
         'yeTx' => [
             //不可以