From e61603715f2a85bc9103be680a422c688a7e672a Mon Sep 17 00:00:00 2001 From: youda Date: Fri, 18 Apr 2025 11:16:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 6 +++--- app/api/controller/FuLiWu.php | 15 +++++++++++---- app/api/controller/Goods.php | 2 +- app/api/controller/Index.php | 2 +- app/api/controller/Warehouse.php | 4 ++++ app/api/middleware.php | 2 +- app/common/service/PaymentCalculator.php | 4 ++-- 7 files changed, 23 insertions(+), 12 deletions(-) diff --git a/.env b/.env index d30629e..a15c551 100644 --- a/.env +++ b/.env @@ -6,9 +6,9 @@ DEFAULT_TIMEZONE = Asia/Shanghai [DATABASE] TYPE = mysql HOSTNAME = 127.0.0.1 -DATABASE = youda_test -USERNAME = youda_test -PASSWORD = youda_test +DATABASE = youda +USERNAME = youda +PASSWORD = youda HOSTPORT = 3306 CHARSET = utf8 DEBUG = false diff --git a/app/api/controller/FuLiWu.php b/app/api/controller/FuLiWu.php index a9d3af5..d699d45 100755 --- a/app/api/controller/FuLiWu.php +++ b/app/api/controller/FuLiWu.php @@ -32,14 +32,14 @@ class FuLiWu extends Base if ($type_str != 1 && $type_str != 3) { return $this->renderError('参数错误'); } - $order='sort desc,id desc'; + $order = 'sort desc,id desc'; $whe = []; $whe[] = ['status', '=', $type_str]; $paginate = 15; $whe[] = ['type', '=', 15]; $whe[] = ['is_open', '=', $type_str == 1 ? 0 : 1]; - if($type_str!=1){ - $order='open_time desc'; + if ($type_str != 1) { + $order = 'open_time desc'; } $user_id = $this->getUserId(); if ($user_id == 0) { @@ -131,6 +131,8 @@ class FuLiWu extends Base $goods_detail['imgurl'] = imageUrl($goods_detail['imgurl']); if (!empty($goods_detail['imgurl_detail'])) { $goods_detail['imgurl_detail'] = imageUrl($goods_detail['imgurl_detail']); + } else { + $goods_detail['imgurl_detail'] = $goods_detail['imgurl']; } // 获取福利屋中的奖品列表 @@ -144,7 +146,12 @@ class FuLiWu extends Base // 处理奖品列表,添加图片地址 foreach ($goodslist as &$item) { $item['imgurl'] = imageUrl($item['imgurl']); - $item['imgurl_detail'] = imageUrl($item['imgurl_detail']); + + if (!empty($item['imgurl_detail'])) { + $item['imgurl_detail'] = imageUrl($item['imgurl_detail']); + } else { + $item['imgurl_detail'] = $item['imgurl']; + } // 获取奖品类型信息 $shang_info = Shang::field('title,color')->where(['id' => $item['shang_id']])->find(); $item['shang_title'] = $shang_info ? $shang_info['title'] : ''; diff --git a/app/api/controller/Goods.php b/app/api/controller/Goods.php index 2b4f532..3e36538 100755 --- a/app/api/controller/Goods.php +++ b/app/api/controller/Goods.php @@ -704,7 +704,7 @@ class Goods extends Base $coupon_id = request()->param('coupon_id/d', 0); //优惠券 #盒子信息 - $goods = Goodsmodel::field('id,title,imgurl_detail,type,price,status,is_shou_zhe,quanju_xiangou,lock_is,choujiang_xianzhi,lock_time,daily_xiangou')->where(['id' => $goods_id]) + $goods = Goodsmodel::field('id,title,imgurl_detail,type,price,status,is_shou_zhe,quanju_xiangou,lock_is,choujiang_xianzhi,lock_time,flw_start_time,flw_end_time,daily_xiangou')->where(['id' => $goods_id]) ->find(); if (!$goods) { return $this->renderError("盒子不存在"); diff --git a/app/api/controller/Index.php b/app/api/controller/Index.php index 226d2bb..c3f809c 100755 --- a/app/api/controller/Index.php +++ b/app/api/controller/Index.php @@ -237,7 +237,7 @@ class Index extends Base $result = $posterService->getUserPoster($userId); // 检查是否需要直接输出图片 - $outputImage = request()->param('output/d', 0); + $outputImage = request()->param('output/d', 1); if ($result['status']) { if ($outputImage) { diff --git a/app/api/controller/Warehouse.php b/app/api/controller/Warehouse.php index a135eb2..bb6c081 100755 --- a/app/api/controller/Warehouse.php +++ b/app/api/controller/Warehouse.php @@ -681,6 +681,10 @@ class Warehouse extends Base if ($type != 1 && $type != 2) { return $this->renderError("请求参数错误"); } + $isTest = \app\common\helper\ConfigHelper::getSystemTestKey("disable_wechat_pay"); + if ($isTest == "1") { + return $this->renderError("发货未开放"); + } $recovery_info = request()->param('recovery_info', ''); if (empty($recovery_info)) { return $this->renderError("请选择兑换的赏品"); diff --git a/app/api/middleware.php b/app/api/middleware.php index 588ea6d..4c7ffbd 100755 --- a/app/api/middleware.php +++ b/app/api/middleware.php @@ -8,7 +8,7 @@ return [ // OPTIONS预检请求处理中间件 \app\api\middleware\OptionsRequestMiddleware::class, // GET请求签名验证中间件 - \app\api\middleware\SignatureVerifyMiddleware::class, + // \app\api\middleware\SignatureVerifyMiddleware::class, // 注意:原来的Allow中间件已被拆分为上面三个专门的中间件,不再需要 // \app\api\middleware\Allow::class, ]; diff --git a/app/common/service/PaymentCalculator.php b/app/common/service/PaymentCalculator.php index 026fb81..42157d9 100644 --- a/app/common/service/PaymentCalculator.php +++ b/app/common/service/PaymentCalculator.php @@ -263,7 +263,7 @@ class PaymentCalculator $user_id = $user['id']; $choujiang_xianzhi = $goods['choujiang_xianzhi']; - if ($choujiang_xianzhi && $choujiang_xianzhi > 0) { + if ($choujiang_xianzhi && $choujiang_xianzhi > 0 || $goods['type'] == 15) { // 验证福利屋活动 if ($goods['type'] == 15) { // 获取用户在该福利屋活动期间的消费情况 @@ -278,7 +278,7 @@ class PaymentCalculator 'status' => 0, 'msg' => "需在指定时间" . date('Y-m-d H:i:s', $goods['flw_start_time']) . "-" . date('Y-m-d H:i:s', $goods['flw_end_time']) . "消耗达到" . $choujiang_xianzhi - . "钻石,即可加入房间,还需" . round(($choujiang_xianzhi - $consumptionData['total_consumed']), 2) . "钻石." + . "钻石,即可加入房间,还需" . removeTrailingZeros( round(($choujiang_xianzhi - $consumptionData['total_consumed']), 2)) . "钻石." ]; } } else {