From dda41873572ff21efb630112270434284ab4ec02 Mon Sep 17 00:00:00 2001 From: wangxiaowei Date: Mon, 5 Aug 2024 18:26:42 +0800 Subject: [PATCH] =?UTF-8?q?admin=E6=A8=A1=E5=9D=97=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=99=BE=E4=BA=BF=E8=BF=94=E8=A1=A5=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/Billions.php | 20 +++ app/admin/logic/BillionsLogic.php | 69 +++++++++ app/admin/view/billions/lists.html | 233 +++++++++++++++++++++++++++++ 3 files changed, 322 insertions(+) create mode 100644 app/admin/controller/Billions.php create mode 100644 app/admin/logic/BillionsLogic.php create mode 100755 app/admin/view/billions/lists.html diff --git a/app/admin/controller/Billions.php b/app/admin/controller/Billions.php new file mode 100644 index 00000000..3c8e34f5 --- /dev/null +++ b/app/admin/controller/Billions.php @@ -0,0 +1,20 @@ +request->isAjax()) { + $get = $this->request->get(); + + return JsonServer::success('获取成功', BillionsLogic::lists($get)); + } + return view(''); + } +} \ No newline at end of file diff --git a/app/admin/logic/BillionsLogic.php b/app/admin/logic/BillionsLogic.php new file mode 100644 index 00000000..fca517f4 --- /dev/null +++ b/app/admin/logic/BillionsLogic.php @@ -0,0 +1,69 @@ +join('user u', 'b.user_id = u.id') + ->where($where) + ->order('billions_id', 'desc') + ->field('b.*, u.id, u.nickname, u.avatar') + ->paginate([ + 'page' => $get['page'] ?? 1, + 'list_rows' => $get['limit'] ?? 10, + 'var_page' => 'page' + ])->toArray(); + + foreach ($lists['data'] as &$v) { + if ($v['type'] == 1) { + $v['order_sn'] = Order::where('id', $v['order_id'])->value('order_sn'); + $v['name'] = Shop::where('id',$v['shop_id'])->value('name'); + } else if ($v['type'] == 2) { + $v['order_sn'] = RechargeOrder::where('id', $v['order_id'])->value('order_sn'); + } else if ($v['type'] == 3) { + $v['order_sn'] = UserBillionsRechargeBalance::where('id', $v['order_id'])->value('order_sn'); + } + + if ($v['goods_id']) { + $v['goods_info'] = Goods::field('name, image')->find($v['goods_id']); + } + + if ($v['avatar']) { + $v['avatar'] = UrlServer::getFileUrl($v['avatar']); + } + } + self::getRanking($lists['data']); + return ['count' => $lists['total'], 'lists' => $lists['data']]; + } + + public static function getRanking(&$data = []){ + $where[] = ['state', '=', 0]; + + foreach ($data as &$v) { + $where[] = ['billions_id', '<=', $v['billions_id']]; + $v['raking'] = Billions::where($where)->count(); + } + } +} \ No newline at end of file diff --git a/app/admin/view/billions/lists.html b/app/admin/view/billions/lists.html new file mode 100755 index 00000000..515963ae --- /dev/null +++ b/app/admin/view/billions/lists.html @@ -0,0 +1,233 @@ +{layout name="layout1" /} + +
+
+ +
+
+
+ +
+

*本地生活商家入驻信息列表。

+
+
+
+
+ + +
+
+
+ +
+ +
+
+ +
+ 搜索 + 重置 +
+
+
+ + +
+
+ + + + + + + + + + + + + + + +
+
+
+ + \ No newline at end of file