Переглянути джерело

Weenier 168otc项目部署 0630

wesmiler 3 роки тому
батько
коміт
7975e819ba

+ 4 - 1
app/Services/Api/MemberService.php

@@ -63,7 +63,7 @@ class MemberService extends BaseService
      */
      */
     public function getInfo($where, array $field = [])
     public function getInfo($where, array $field = [])
     {
     {
-        $field = $field ? $field : ['id', 'username', 'realname', 'nickname', 'openid', 'idcard','google_secret', 'trade_password', 'trc_address', 'erc_address','erc_hexaddress', 'source', 'idcard_check', 'idcard_front_img', 'idcard_back_img', 'safe_level', 'user_type', 'member_level', 'usdt_num', 'user_type', 'status', 'credit', 'avatar'];
+        $field = $field ? $field : ['id', 'username', 'realname', 'nickname', 'openid', 'idcard','google_secret', 'password', 'trade_password', 'trc_address', 'erc_address','erc_hexaddress', 'source', 'idcard_check', 'idcard_front_img', 'idcard_back_img', 'safe_level', 'user_type', 'member_level', 'usdt_num', 'user_type', 'status', 'credit', 'avatar'];
         if (is_array($where)) {
         if (is_array($where)) {
             $info = $this->model->where($where)->select($field)->first();
             $info = $this->model->where($where)->select($field)->first();
         } else {
         } else {
@@ -82,6 +82,8 @@ class MemberService extends BaseService
             $info['cny_num'] = $info['usdt_num'] && $tradePrice>0? moneyFormat($info['usdt_num']*$tradePrice, 6) : '0.0000';
             $info['cny_num'] = $info['usdt_num'] && $tradePrice>0? moneyFormat($info['usdt_num']*$tradePrice, 6) : '0.0000';
             $info['is_collection'] = MemberPaymentService::make()->checkHasByUser($info['id']);
             $info['is_collection'] = MemberPaymentService::make()->checkHasByUser($info['id']);
             $info['set_trade_password'] = $info['trade_password']? 1 : 0;
             $info['set_trade_password'] = $info['trade_password']? 1 : 0;
+            $info['set_trade_password'] = $info['trade_password']==$info['password']? 2 : $info['set_trade_password'];
+            unset($info['password']);
             unset($info['trade_password']);
             unset($info['trade_password']);
 
 
             // 收款二维码
             // 收款二维码
@@ -116,6 +118,7 @@ class MemberService extends BaseService
         $data = [
         $data = [
             'username' => $username,
             'username' => $username,
             'password' => get_password($password . md5($password.'otc')),
             'password' => get_password($password . md5($password.'otc')),
+            'trade_password' => get_password($password . md5($password.'otc')),
             'mobile' => isPhone($username) ? $username : '',
             'mobile' => isPhone($username) ? $username : '',
             'avatar' => $avatar ? $avatar : '',
             'avatar' => $avatar ? $avatar : '',
             'status' => 1,
             'status' => 1,

+ 21 - 15
app/Services/Common/CoinLogService.php

@@ -214,6 +214,20 @@ class CoinLogService extends BaseService
             return false;
             return false;
         }
         }
 
 
+        $config = ConfigService::make()->getConfigOptionByGroup(6);
+        $coinOutFree = isset($config['coin_out_free'])? floatval($config['coin_out_free']) : 0;
+        $googleLimitTime = isset($config['google_limit_time'])? floatval($config['google_limit_time']) : 0;
+        $fee = floatval($num * $coinOutFree/100);
+
+        // TRC20
+        if($contactType == 1){
+            $coinOutMin = isset($config['trc_out_limit'])? floatval($config['trc_out_limit']) : 0;
+            $coinOutMax = isset($config['trc_out_max'])? floatval($config['trc_out_max']) : 0;
+        }else{
+            $coinOutMin = isset($config['erc_out_limit'])? floatval($config['erc_out_limit']) : 0;
+            $coinOutMax = isset($config['erc_out_max'])? floatval($config['erc_out_max']) : 0;
+        }
+
         // 谷歌验证码
         // 谷歌验证码
         $checkGoogle = isset($params['check_google'])? $params['check_google'] : 1;
         $checkGoogle = isset($params['check_google'])? $params['check_google'] : 1;
         if($checkGoogle){
         if($checkGoogle){
@@ -228,7 +242,7 @@ class CoinLogService extends BaseService
 
 
             // 刚验证更新的谷歌验证码24小时内不得提币
             // 刚验证更新的谷歌验证码24小时内不得提币
             if($verifyTime && $verifyTime> time()){
             if($verifyTime && $verifyTime> time()){
-                $this->error = '2019';
+                $this->error = lang('2019',['time'=>$googleLimitTime]);
                 return false;
                 return false;
             }
             }
 
 
@@ -236,23 +250,15 @@ class CoinLogService extends BaseService
                 $this->error = '2018';
                 $this->error = '2018';
                 return false;
                 return false;
             }
             }
-        }
-
-
-        $config = ConfigService::make()->getConfigOptionByGroup(6);
-        $coinOutFree = isset($config['coin_out_free'])? floatval($config['coin_out_free']) : 0;
-        $coinOutFree = isset($config['coin_out_free'])? floatval($config['coin_out_free']) : 0;
-        $fee = floatval($num * $coinOutFree/100);
-
-        // TRC20
-        if($contactType == 1){
-            $coinOutMin = isset($config['trc_out_limit'])? floatval($config['trc_out_limit']) : 0;
-            $coinOutMax = isset($config['trc_out_max'])? floatval($config['trc_out_max']) : 0;
         }else{
         }else{
-            $coinOutMin = isset($config['erc_out_limit'])? floatval($config['erc_out_limit']) : 0;
-            $coinOutMax = isset($config['erc_out_max'])? floatval($config['erc_out_max']) : 0;
+            // 身份认证
+            if($userInfo['idcard_check'] != 1){
+                $this->error = '2018';
+                return false;
+            }
         }
         }
 
 
+
         // 单笔限额
         // 单笔限额
         if($num<$coinOutMin || $num > $coinOutMax){
         if($num<$coinOutMin || $num > $coinOutMax){
             $this->error = '5004';
             $this->error = '5004';

+ 0 - 1
app/Services/Common/TradeOrderService.php

@@ -142,7 +142,6 @@ class TradeOrderService extends BaseService
             }
             }
         }
         }
 
 
-
         return [
         return [
             'pageSize' => $pageSize,
             'pageSize' => $pageSize,
             'total' => isset($list['total']) ? $list['total'] : 0,
             'total' => isset($list['total']) ? $list['total'] : 0,

+ 4 - 1
app/Services/Common/UserService.php

@@ -15,6 +15,7 @@ use App\Http\Validator\MemberValidator;
 use App\Models\MemberModel;
 use App\Models\MemberModel;
 use App\Models\UserModel;
 use App\Models\UserModel;
 use App\Services\BaseService;
 use App\Services\BaseService;
+use App\Services\ConfigService;
 use App\Services\EmailService;
 use App\Services\EmailService;
 use App\Services\SmsService;
 use App\Services\SmsService;
 use App\Services\UsdtWalletService;
 use App\Services\UsdtWalletService;
@@ -422,7 +423,9 @@ class UserService extends BaseService
         // 设置新谷歌验证码
         // 设置新谷歌验证码
         $google = GoogleAuthenticator::CreateSecret();
         $google = GoogleAuthenticator::CreateSecret();
         $googleSecret = isset($google['secret'])? $google['secret'] : '';
         $googleSecret = isset($google['secret'])? $google['secret'] : '';
-        $result = $this->model->where(['id'=> $userId])->update(['google_secret'=> $googleSecret,'google_verify_time'=> time() + 86400]);
+        $googleLimitTime = ConfigService::make()->getConfigByCode('google_limit_time');
+        $googleLimitTime = $googleLimitTime>0? $googleLimitTime : 1;
+        $result = $this->model->where(['id'=> $userId])->update(['google_secret'=> $googleSecret,'google_verify_time'=> time() + $googleLimitTime*3600]);
         if (!$result) {
         if (!$result) {
             return message("谷歌验证码更新设置失败", false);
             return message("谷歌验证码更新设置失败", false);
         }
         }