Browse Source

用户列表

skyline 1 năm trước cách đây
mục cha
commit
e9029b9553

+ 1 - 1
admin-web/src/views/admin/account/index.vue

@@ -156,7 +156,7 @@ const state = reactive({
     data: [] as Array<any>,
     loading: false,
     columns: [
-      {label: '用户ID',width: 180,  prop: 'userId', resizable: true, fixed: 'left'},
+      {label: '用户ID',width: 200,  prop: 'userId', resizable: true, fixed: 'left'},
       // {label: '用户名',width: 150,  prop: 'userName', resizable: true, fixed: 'left'},
       {label: '手机号', width: 120, prop: 'mobilePhone', resizable: true, fixed: 'left'},
       {label: '余额', width: 80, prop: 'balance', resizable: true, fixed: 'left'},

+ 16 - 36
car-wash-mapper/src/main/resources/mappers/miniapp/UserMapper.xml

@@ -54,22 +54,18 @@
             t3.recharge_times,
             t3.recharge_amount,
             t2.charge_times,
-            t2.total_power,
-            t2.total_money,
-            t2.pay_amount,
-            t2.discount_amount
+            t2.amount_received,
+            t2.discount_money
             FROM
             t_user t1
             LEFT JOIN
             (SELECT
             user_id,
             COUNT(IFNULL(1, 0)) charge_times,
-            SUM(IFNULL(total_power, 0)) total_power,
-            SUM(IFNULL(total_money, 0)) total_money,
-            SUM(IFNULL(pay_amount, 0)) pay_amount,
-            SUM(IFNULL(discount_amount, 0)) discount_amount
+            SUM(IFNULL(amount_received, 0)) amount_received,
+            SUM(IFNULL(discount_money, 0)) discount_money
             FROM
-            t_charge_order
+            t_wash_order
             WHERE user_id in
             <foreach collection="list" item="item" open="(" separator="," close=")">
                 #{item}
@@ -107,11 +103,9 @@
             user.`last_login_time`,
             t.recharge_times,
             t.recharge_amount,
-            t1.charge_times,
-            t1.total_power,
-            t1.total_money,
-            t1.pay_amount,
-            t1.discount_amount
+            t1.wash_times,
+            t1.amount_received,
+            t1.discount_money
             FROM t_user `user`
             LEFT JOIN
             (SELECT user_id,
@@ -140,36 +134,22 @@
             THEN 1
             ELSE NULL
             END
-            ) charge_times,
+            ) wash_times,
             SUM(
             CASE
-            WHEN o.`total_power` > 0
-            THEN o.`total_power`
+            WHEN o.`amount_received` > 0
+            THEN o.`amount_received`
             ELSE 0
             END
-            ) total_power,
+            ) amount_received,
             SUM(
             CASE
-            WHEN o.`total_money` > 0
-            THEN o.`total_money`
+            WHEN o.`discount_money` > 0
+            THEN o.`discount_money`
             ELSE 0
             END
-            ) total_money,
-            SUM(
-            CASE
-            WHEN o.`pay_amount` > 0
-            THEN o.`pay_amount`
-            ELSE 0
-            END
-            ) pay_amount,
-            SUM(
-            CASE
-            WHEN o.`discount_amount` > 0
-            THEN o.`discount_amount`
-            ELSE 0
-            END
-            ) discount_amount
-            FROM t_charge_order o
+            ) discount_money
+            FROM t_wash_order o
             GROUP BY o.user_id) t1
             ON t1.user_id = user.id
             ORDER BY register_time DESC