From 53d38e816cb79e77d8845d37afea96b89e1959ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8D=8E=E6=B8=85?= <18691022700@163.com> Date: Wed, 7 Jan 2026 13:59:52 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=AC=E5=B8=815=E5=88=86=E9=92=9F=E9=99=90?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/UserWallet.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/application/api/model/UserWallet.php b/application/api/model/UserWallet.php index 8d523f6a..c0bd52e3 100644 --- a/application/api/model/UserWallet.php +++ b/application/api/model/UserWallet.php @@ -162,6 +162,13 @@ class UserWallet extends Model //转币 public function give_coin($uid, $give_uid, $coin){ + //从缓存中获取 + $exchange_user = Cache::get('give_coin_user_' . $uid); + if($exchange_user){ + return ['code' => 0, 'msg' => '请5分钟后再试', 'data' => null]; + }else{ + Cache::set('give_coin_user_' . $uid, 1, 5 * 60); + } if(empty($coin)){ return ['code' => 0, 'msg' => '请输入需要转的金币数量', 'data' => null]; }