소스 검색

礼物送自己/未实名限额

zhangxiaobin 1 년 전
부모
커밋
89768041f0
3개의 변경된 파일15개의 추가작업 그리고 7개의 파일을 삭제
  1. 12 5
      application/api/controller/Money.php
  2. 1 1
      application/api/controller/Party.php
  3. 2 1
      application/extra/site.php

+ 12 - 5
application/api/controller/Money.php

@@ -57,10 +57,6 @@ class Money extends Common
         if (!preg_match("/^-?\d+$/",$amounts)) {
             $this->error('金额必须是整数');
         }
-
-        if ($this->auth->is_auth != 2) {//实名后允许充值
-            throw new Exception('请先实名认证');
-        }
         if ($this->auth->power->recharge == 1) {//禁止充值
             throw new Exception('禁止充值');
         }
@@ -81,7 +77,18 @@ class Money extends Common
         $out_trade_no = date("YmdHis") . rand(100000, 999999);
         $title = "充值钻石";
         $amount = $recharInfo["money"] / 100;
-
+        if ($this->auth->is_auth != 2) {//实名后允许充值
+            //未实名认证最大可充值金额
+            $maxMoney = config('site.un_authentication_max');
+            $rechargeMoneyWhere['user_id'] = $user_id;
+            $rechargeMoneyWhere['status'] = 1;
+            $rechargeMoney = model('RecharOrder')->where($rechargeMoneyWhere)->sum('money');
+            $userRechargeMoney = !empty($rechargeMoney) ? (int)$rechargeMoney : 0;
+            $userMoney = bcadd($amount,$userRechargeMoney);
+            if ($userMoney > $maxMoney) {
+                $this->error('请先实名认证');
+            }
+        }echo '<pre>';var_dump(3);exit;
         if ($params_from == "ios") {
             $jewel = $recharInfo['jewel'];
         } else {

+ 1 - 1
application/api/controller/Party.php

@@ -1601,7 +1601,7 @@ class Party extends Common
         $backGiftId = 0;
         $boxgiftInfo = [];
         // 不可以赠送给自己
-        if(in_array($userauthid,$user_id_arr)) $this->error("不可以赠送给自己!");
+        //if(in_array($userauthid,$user_id_arr)) $this->error("不可以赠送给自己!");
         if($is_back == 1) {
             // 获取背包礼物信息
             $giftInfo = \app\common\model\GiftBack::get($gift_id);

+ 2 - 1
application/extra/site.php

@@ -103,7 +103,7 @@ return [
     'switch' => '1',
     'appShare' => '/uploads/20210422/75744fbe87ee36e52ffffcb82acdc403.png',
     'roomLimit' => '10',
-    'domain_name' => 'http://ggyuyin.huxiukeji.cn',
+    'domain_name' => 'https://ggyuyin.huxiukeji.cn',
     'intro_image' => '/uploads/20230703/35b10db56529aa19086eeb3d1d0bb6b0.png',
     'egggift_content' => '<p>我是奖励概览</p>',
     'sign_gift' => '1',
@@ -113,4 +113,5 @@ return [
     'exchange_define' => '1',
     'withdraw_define' => '1',
     'sign_img' => '/uploads/20230714/f02676a5491e5a88141ce9a9a8c20a77.png',
+    'un_authentication_max' => '100',
 ];