From 2faf33fcde8cbc68f05cdc36146a98918897f76a Mon Sep 17 00:00:00 2001 From: 19173159168 Date: Sat, 23 Aug 2025 23:19:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E4=BB=98=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/orders/ZcOrderSubMapper.xml | 1 + .../templates/orders/distrib/distrib.html | 25 ++++++++++++- .../templates/orders/orderSub/orderSub.html | 35 ++++++++++++++----- 3 files changed, 51 insertions(+), 10 deletions(-) diff --git a/ruoyi-admin/src/main/resources/mapper/orders/ZcOrderSubMapper.xml b/ruoyi-admin/src/main/resources/mapper/orders/ZcOrderSubMapper.xml index fef18de..a1369ba 100644 --- a/ruoyi-admin/src/main/resources/mapper/orders/ZcOrderSubMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/orders/ZcOrderSubMapper.xml @@ -48,6 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') + order by paid_at desc
  • - + - @@ -135,6 +135,9 @@ var prefix = ctx + "orders/distrib"; $(function() { + // 初始化时间范围为近一周 + initDateRange(); + var options = { url: prefix + "/list", createUrl: prefix + "/add", @@ -250,6 +253,26 @@ }); + // 初始化日期范围为近一周 + function initDateRange() { + var now = new Date(); + var oneWeekAgo = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000); + + var startDate = formatDate(oneWeekAgo); + var endDate = formatDate(now); + + $("#beginFirstOrderTime").val(startDate); + $("#endFirstOrderTime").val(endDate); + } + + // 格式化日期为 yyyy-MM-dd 格式 + function formatDate(date) { + var year = date.getFullYear(); + var month = (date.getMonth() + 1).toString().padStart(2, '0'); + var day = date.getDate().toString().padStart(2, '0'); + return year + '-' + month + '-' + day; + } + function loadSummaryStats() { var formData = $("#formId").serialize(); $.ajax({ diff --git a/ruoyi-admin/src/main/resources/templates/orders/orderSub/orderSub.html b/ruoyi-admin/src/main/resources/templates/orders/orderSub/orderSub.html index ab85daf..5624b13 100644 --- a/ruoyi-admin/src/main/resources/templates/orders/orderSub/orderSub.html +++ b/ruoyi-admin/src/main/resources/templates/orders/orderSub/orderSub.html @@ -20,14 +20,27 @@
  • - - - - - - - - +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • @@ -74,6 +87,7 @@ var removeFlag = [[${@permission.hasPermi('orders:orderSub:remove')}]]; var suborderTypeDatas = [[${@dict.getType('key_order_suborder_type')}]]; var paymentMethodDatas = [[${@dict.getType('key_order_payment_method')}]]; + var payStatusDatas = [[${@dict.getType('key_order_pay_status')}]]; var prefix = ctx + "orders/orderSub"; $(function() { @@ -129,7 +143,10 @@ { field: 'payStatus', align: 'center', - title: '支付状态' + title: '支付状态', + formatter: function(value, row, index) { + return $.table.selectDictLabel(payStatusDatas, value); + } }, { field: 'paidAt',