瀏覽代碼

每人兑换两套限制

jason 6 月之前
父節點
當前提交
19f232c611
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      application/api/controller/Ledger.php

+ 5 - 0
application/api/controller/Ledger.php

@@ -219,6 +219,11 @@ class Ledger extends Api
             $this->error(__('Invalid parameters'));
         }
 
+        $check_user = (new RwaExchangeRecordModel())->where('user_id', $this->auth->id)->where('status', 200)->count();
+        if($check_user >= 4){
+            $this->error('每人限制兑换两套,您已达上限');
+        }
+
         $BscApi = new BscApi($welfare_config['contract_address'][$coin]);
         $result_coin = $BscApi->getTransactionRecordsByAddress($coin_from_address, $welfare_config['transfer_address'], 49990000);
         if ($result_coin['code'] == 0) {