From 70fa4c54320a59e9c55643339adfe2a64e85b6fb Mon Sep 17 00:00:00 2001 From: manghe Date: Fri, 14 Mar 2025 05:25:27 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/Cardextractor.php | 21 +++++++++---------- app/admin/view/Cardextractor/card_shang.html | 10 +++++---- .../view/Cardextractor/card_shang_edit.html | 6 ++++++ app/config/session.php | 2 +- config/menu.php | 5 ++++- 5 files changed, 27 insertions(+), 17 deletions(-) diff --git a/app/admin/controller/Cardextractor.php b/app/admin/controller/Cardextractor.php index dde2746..a5c97ac 100755 --- a/app/admin/controller/Cardextractor.php +++ b/app/admin/controller/Cardextractor.php @@ -471,15 +471,14 @@ class Cardextractor extends Base public function card_shang(Request $request) { $goods_id = request()->param('goods_id/d', 0); - if ($goods_id <= 0) { - return $this->renderError("非法请求"); - } + // if ($goods_id <= 0) { + // return $this->renderError("非法请求"); + // } $goods = GoodsModel::where(['id' => $goods_id])->find(); - if (!$goods) { - return $this->renderError("请求参数错误"); - } - $data = Shang::where('goods_id', '=', $goods_id) - ->order('sort desc,id asc') + // if (!$goods) { + // return $this->renderError("请求参数错误"); + // } + $data = Shang::where('id','<',39) ->order('sort desc,id asc') ->select()->toArray(); #概率 $pro = array_sum(array_column($data, 'pro')); @@ -568,9 +567,9 @@ class Cardextractor extends Base if (RegZero($data['sort'])) { return $this->renderError("排序输入不规范,请输入整数"); } - if (empty($data['imgurl'])) { - return $this->renderError("请上传等级图标"); - } + // if (empty($data['imgurl'])) { + // return $this->renderError("请上传等级图标"); + // } $data['update_time'] = time(); Db::startTrans(); $res[] = $info->allowField([])->update($data); diff --git a/app/admin/view/Cardextractor/card_shang.html b/app/admin/view/Cardextractor/card_shang.html index b18bf47..07a28d2 100755 --- a/app/admin/view/Cardextractor/card_shang.html +++ b/app/admin/view/Cardextractor/card_shang.html @@ -5,7 +5,7 @@
- 添加等级 + 共有数据: {$count}条
@@ -15,6 +15,7 @@ 等级名称 等级图标 发光特效 + 颜色 等级概率({$pro}%) 排序 操作 @@ -26,15 +27,16 @@ {$vo['title']} {if $vo['imgurl']}{/if} {if $vo['special_imgurl']}{/if} + {$vo['color']} {$vo['pro']*1}% {$vo['sort']} 编辑 - 等级奖品 - - 删除 + + + diff --git a/app/admin/view/Cardextractor/card_shang_edit.html b/app/admin/view/Cardextractor/card_shang_edit.html index f6a7de1..beb4b6f 100755 --- a/app/admin/view/Cardextractor/card_shang_edit.html +++ b/app/admin/view/Cardextractor/card_shang_edit.html @@ -19,6 +19,12 @@ %
+
+ +
+ +
+
diff --git a/app/config/session.php b/app/config/session.php index 49403e5..8ee075f 100755 --- a/app/config/session.php +++ b/app/config/session.php @@ -14,5 +14,5 @@ return [ 'store' => null, // 前缀 'prefix' => '', - 'expire' => 3600, + 'expire' => 36000, ]; diff --git a/config/menu.php b/config/menu.php index a0daa2d..98bd45f 100755 --- a/config/menu.php +++ b/config/menu.php @@ -215,7 +215,10 @@ return [ 'url' => '/admin/sign', 'name' => '签到设置', ], - + [ + 'url' => '/admin/card_shang', + 'name' => '抽奖等级设置', + ], ], ],