From 423d983e091036e8da66361070c9c85488bc4bcb Mon Sep 17 00:00:00 2001 From: youda Date: Fri, 25 Apr 2025 09:43:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 8 ++++---- app/api/controller/Goods.php | 6 ++---- app/api/controller/Index.php | 2 +- app/api/controller/Infinite.php | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.env b/.env index 26273f6..bd89d32 100644 --- a/.env +++ b/.env @@ -6,9 +6,9 @@ DEFAULT_TIMEZONE = Asia/Shanghai [DATABASE] TYPE = mysql HOSTNAME = 127.0.0.1 -DATABASE = youda_neice -USERNAME = youda_neice -PASSWORD = youda_neice +DATABASE = youda +USERNAME = youda +PASSWORD = youda HOSTPORT = 3306 CHARSET = utf8 DEBUG = false @@ -20,4 +20,4 @@ default_lang = zh-cn HOST = 127.0.0.1 PORT = 6379 PASSWORD = -DB = 3 \ No newline at end of file +DB = 2 \ No newline at end of file diff --git a/app/api/controller/Goods.php b/app/api/controller/Goods.php index 35895b2..a7e8538 100755 --- a/app/api/controller/Goods.php +++ b/app/api/controller/Goods.php @@ -64,7 +64,6 @@ class Goods extends Base $redis = (new \app\common\server\RedisHelper())->getRedis(); $cache_key = "goods_list_{$type_str}_{$user_id}_{$page}"; $cache_data = $redis->get($cache_key); - // 如果缓存存在,直接返回缓存数据 if ($cache_data) { $cached_data = json_decode($cache_data, true); @@ -94,7 +93,6 @@ class Goods extends Base $paginate = 15; // 1一番赏 2无限赏 3擂台赏 4抽卡机 5积分赏 6全局赏 7福利盲盒 8领主赏 9连击赏 10 商品赏 - // 使用映射数组简化类型条件判断 $typeMapping = [ 1 => ['type' => 1], @@ -170,7 +168,7 @@ class Goods extends Base // 缓存空结果,避免重复查询 $redis->set($cache_key, json_encode($new_data), 10); - + return $this->renderSuccess('请求成功', $new_data); } @@ -811,7 +809,7 @@ class Goods extends Base if (empty($user['mobile'])) { return $this->renderError('请先绑定手机号', [], -9); } - return $this->renderError('正在维护中', []); + $prize_num = request()->param('prize_num/d', 0); #抽几发 $goods_id = request()->param('goods_id/d', 0); #盒子ID $num = request()->param('goods_num/d', 0); #第几箱 diff --git a/app/api/controller/Index.php b/app/api/controller/Index.php index cb2727e..a0a87a6 100755 --- a/app/api/controller/Index.php +++ b/app/api/controller/Index.php @@ -41,7 +41,7 @@ class Index extends Base // // unset($tuijian[$key]); // continue; // } - // $tuijian_list[] = $advert_value; + $tuijian_list[] = $advert_value; } } $tuijian = $tuijian_list; diff --git a/app/api/controller/Infinite.php b/app/api/controller/Infinite.php index d199bba..d27ba7a 100755 --- a/app/api/controller/Infinite.php +++ b/app/api/controller/Infinite.php @@ -507,7 +507,7 @@ class Infinite extends Base if (empty($user['mobile'])) { return $this->renderError('请先绑定手机号', [], -9); } - return $this->renderError('正在维护中', []); + $ad_id = request()->header('adid'); $goods_id = request()->param('goods_id/d', 0); #盒子ID $prize_num = request()->param('prize_num/d', 0); #抽几发