wesmiler пре 1 недеља
родитељ
комит
9be1e67bb5
2 измењених фајлова са 22 додато и 19 уклоњено
  1. 9 9
      app/Http/Controllers/Api/v1/IndexController.php
  2. 13 10
      app/Services/Api/BalanceLogService.php

+ 9 - 9
app/Http/Controllers/Api/v1/IndexController.php

@@ -33,17 +33,17 @@ class IndexController extends webApp
                     'app_name' => ConfigService::make()->getConfigByCode('app_name'),
                     'app_logo' => get_image_url(ConfigService::make()->getConfigByCode('app_logo')),
                     'app_version' => ConfigService::make()->getConfigByCode('app_version'),
-                    'withdraw_balance_desc' => format_content(ConfigService::make()->getConfigByCode('withdraw_balance_desc', '')),
-                    'withdraw_property_desc' => format_content(ConfigService::make()->getConfigByCode('withdraw_property_desc', '')),
+                    'withdraw_1_desc' => format_content(ConfigService::make()->getConfigByCode('withdraw_1_desc', '')),
+                    'withdraw_2_desc' => format_content(ConfigService::make()->getConfigByCode('withdraw_2_desc', '')),
                     'goods_disclaimer' => format_content(ConfigService::make()->getConfigByCode('goods_disclaimer', '')),
                     'wxpay_open' => ConfigService::make()->getConfigByCode('wxpay_open', 0),
-                    'withdraw_open' => ConfigService::make()->getConfigByCode('withdraw_open', 0),
-                    'withdraw_min' => ConfigService::make()->getConfigByCode('withdraw_min', 0),
-                    'withdraw_fee' => ConfigService::make()->getConfigByCode('withdraw_fee', 0),
-                    'withdraw_property_open' => ConfigService::make()->getConfigByCode('withdraw_property_open', 0),
-                    'withdraw_property_fee' => ConfigService::make()->getConfigByCode('withdraw_property_fee', 0),
-                    'property_withdraw_rate' => ConfigService::make()->getConfigByCode('property_withdraw_rate', 0),
-                    'transfer_bd_score_open' => ConfigService::make()->getConfigByCode('transfer_bd_score_open', 0),
+                    'withdraw_1_open' => ConfigService::make()->getConfigByCode('withdraw_1_open', 0),
+                    'withdraw_1_min' => ConfigService::make()->getConfigByCode('withdraw_1_min', 0),
+                    'withdraw_1_fee' => ConfigService::make()->getConfigByCode('withdraw_1_fee', 0),
+                    'withdraw_2_open' => ConfigService::make()->getConfigByCode('withdraw_2_open', 0),
+                    'withdraw_2_fee' => ConfigService::make()->getConfigByCode('withdraw_2_fee', 0),
+                    'withdraw_2_rate' => ConfigService::make()->getConfigByCode('withdraw_2_rate', 0),
+                    'transfer_3_open' => ConfigService::make()->getConfigByCode('transfer_3_open', 0),
                     'notices' => NoticeService::make()->getRecommandList(),
                 ];
                 RedisService::set($cacheKey, $config, 3600);

+ 13 - 10
app/Services/Api/BalanceLogService.php

@@ -151,6 +151,7 @@ class BalanceLogService extends BaseService
     public function withdraw($userId, $params)
     {
         // 参数验证
+        $payType = isset($params['pay_type']) && $params['pay_type']? intval($params['pay_type']) : 10;
         $accountType = isset($params['account_type']) && $params['account_type']? intval($params['account_type']) : 1;
         $money = isset($params['money'])? floatval($params['money']) : 0;
         $accountId = isset($params['account_id'])? intval($params['account_id']) : 0;
@@ -164,17 +165,19 @@ class BalanceLogService extends BaseService
             return false;
         }
 
-        $openWithdraw = ConfigService::make()->getConfigByCode('withdraw_open',1);
-        if(!$openWithdraw){
-            $this->error = 2304;
-            return false;
-        }
+            $openWithdraw = ConfigService::make()->getConfigByCode("withdraw_{$accountType}_open",1);
+            if(!$openWithdraw){
+                $this->error = 2304;
+                return false;
+            }
+
+            $withdrawMin = ConfigService::make()->getConfigByCode("withdraw_{$accountType}_min",0.1);
+            if($withdrawMin>0 && $money < $withdrawMin){
+                $this->error = lang(2305,['money'=>$withdrawMin]);
+                return false;
+            }
+
 
-        $withdrawMin = ConfigService::make()->getConfigByCode('withdraw_min',0.1);
-        if($withdrawMin>0 && $money < $withdrawMin){
-            $this->error = lang(2305,['money'=>$withdrawMin]);
-            return false;
-        }