From bb6d4abeae0f90247b109964481b9fdda28b3b26 Mon Sep 17 00:00:00 2001 From: youda Date: Mon, 9 Jun 2025 12:20:12 +0800 Subject: [PATCH] 111 --- app/admin/controller/Goods.php | 2 +- app/api/controller/Config.php | 2 +- app/api/controller/Goods.php | 2 +- app/api/controller/Index.php | 22 ++++++++++------------ app/api/controller/Infinite.php | 6 +++--- app/api/controller/Mall.php | 5 ++++- 6 files changed, 20 insertions(+), 19 deletions(-) diff --git a/app/admin/controller/Goods.php b/app/admin/controller/Goods.php index a757595..0b059bd 100755 --- a/app/admin/controller/Goods.php +++ b/app/admin/controller/Goods.php @@ -2174,7 +2174,7 @@ class Goods extends Base $data['pay_currency'] = isset($data['pay_currency']) ? 1 : 0; $data['pay_currency2'] = isset($data['pay_currency2']) ? 1 : 0; $data['pay_coupon'] = isset($data['pay_coupon']) ? 1 : 0; - $data['is_deduction'] = isset($data['is_deduction']) ? 1 : 0; + // $data['is_deduction'] = $data['is_deduction']; // 查询是否已存在 $exist = \app\common\model\GoodsExtend::getByGoodsId($goods_id); diff --git a/app/api/controller/Config.php b/app/api/controller/Config.php index 3a8f7df..29450c9 100755 --- a/app/api/controller/Config.php +++ b/app/api/controller/Config.php @@ -26,7 +26,7 @@ class Config extends Base return $this->renderSuccess('获取成功', [ 'good_type' => $goodsTypeList, 'app_setting' => $app_setting, - 'version' => '112' + 'version' => '113' ]); } /** diff --git a/app/api/controller/Goods.php b/app/api/controller/Goods.php index 76fdec6..51234c0 100755 --- a/app/api/controller/Goods.php +++ b/app/api/controller/Goods.php @@ -1202,7 +1202,7 @@ class Goods extends Base } } #普通赏 - $data = OrderList::field('id,user_id,shang_id,goodslist_id,goodslist_title,goodslist_imgurl,goodslist_money,count(id) as prize_num') + $data = OrderList::field('id,user_id,shang_id,goodslist_id,goodslist_title,goodslist_imgurl,goodslist_money,count(id) as prize_num,doubling,is_lingzhu,goodslist_type,goodslist_id,parent_goods_list_id') ->append(['shang_title']) ->where('user_id', '=', $user['id']) ->where('order_id', '=', $order_info['id']) diff --git a/app/api/controller/Index.php b/app/api/controller/Index.php index 4b7b72f..c9123dd 100755 --- a/app/api/controller/Index.php +++ b/app/api/controller/Index.php @@ -92,18 +92,16 @@ class Index extends Base // 设置header $type = \request()->param('type/d', 0); - - // 使用Redis缓存 - // $redis = (new \app\common\server\RedisHelper())->getRedis(); - // $cacheKey = 'danye:content:' . $type; - - // // 尝试从缓存获取数据 - // $cacheData = $redis->get($cacheKey); - // if ($cacheData) { - // $cacheData = json_decode($cacheData, true); - // return json(['status' => 1, 'msg' => '请求成功', 'data' => $cacheData['content'], 'is_image_optimizer' => $cacheData['is_image_optimizer']]); - // } - + $client = request()->header('client', 'MP-WEIXIN'); + if ($type == 4 || $type == 5) { + if ($client == "APP_ANDROID"||$client == "APP_IOS") { + if ($type == 4) { + $type = 30; + } else { + $type = 31; + } + } + } // 缓存不存在,查询数据库 $info = Danye::where(['id' => $type])->find(); $is_image_optimizer = 0; diff --git a/app/api/controller/Infinite.php b/app/api/controller/Infinite.php index d0767fd..3d78ea4 100755 --- a/app/api/controller/Infinite.php +++ b/app/api/controller/Infinite.php @@ -14,7 +14,7 @@ use app\common\model\User; use app\common\model\Order; use app\common\model\OrderList; use app\common\model\UserVip; -use app\common\model\UserCoupon; +use app\common\model\UserCoupon; use think\facade\Db; use think\facade\Log; use app\common\model\CouponReceive as CouponReceiveModel; @@ -872,7 +872,7 @@ class Infinite extends Base } $prize_num = $order_info['prize_num'] ?? 0; #普通赏 - $data = OrderList::field('id,user_id,shang_id,goodslist_id,goodslist_title,goodslist_imgurl,goodslist_money,doubling,is_lingzhu') + $data = OrderList::field('id,user_id,shang_id,goodslist_id,goodslist_title,goodslist_imgurl,goodslist_money,doubling,is_lingzhu,goodslist_type,goodslist_id,parent_goods_list_id') ->append(['shang_title']) ->where('user_id', '=', $user['id']) ->where('order_id', '=', $order_info['id']) @@ -904,7 +904,7 @@ class Infinite extends Base } } //重抽卡数量 - $item_card_count = Db::name('user_item_card')->where(['user_id' => $user['id'], 'status' => 1])->count(); + $item_card_count =0;// Db::name('user_item_card')->where(['user_id' => $user['id'], 'status' => 1])->count(); $new_data = [ 'user_info' => [ diff --git a/app/api/controller/Mall.php b/app/api/controller/Mall.php index 2735db4..2561718 100755 --- a/app/api/controller/Mall.php +++ b/app/api/controller/Mall.php @@ -20,7 +20,7 @@ use app\common\model\DiamondOrder; use think\facade\Db; use app\common\model\CouponReceive as CouponReceiveModel; use \think\Request; - +use app\common\model\GoodsExtend; class Mall extends Base { static $shang_prize_id = [34, 38];#抽奖赏品id @@ -47,12 +47,15 @@ class Mall extends Base $price = $goods['price']; #抽奖数量 $goods['prize_num'] = $prize_num; + $goods_type = $goods['type']; + $goodsExtend = GoodsExtend::getGoodsExtendByGoodsId($goods_id, $goods_type); $data = [ 'goods' => $goods, 'price' => round($price, 2), 'integral' => round($price * 100, 2), 'use_integral' => round($user['money2'], 2), 'money' => round($user['money'], 2), + 'goodsExtend' => $goodsExtend, ]; return $this->renderSuccess("请求成功", $data); }