|
|
@@ -10,7 +10,7 @@
|
|
|
fi.name AS firmName,
|
|
|
ui.phone,
|
|
|
ui.openid,
|
|
|
- IFNULL(ua.balance, 0) + IFNULL(ua.redeem_balance, 0) AS balance,
|
|
|
+ IFNULL(ua.balance, 0) AS balance,
|
|
|
IFNULL(log.total_consumption, 0) AS totalConsumption,
|
|
|
ui.create_time
|
|
|
FROM
|
|
|
@@ -21,7 +21,7 @@
|
|
|
LEFT JOIN (
|
|
|
SELECT user_id, SUM(IFNULL(change_balance, 0)) AS total_consumption
|
|
|
FROM c_user_account_log
|
|
|
- WHERE is_deleted = 0 AND change_type = 2 AND account_type = 1
|
|
|
+ WHERE is_deleted = 0 AND change_type = 1
|
|
|
GROUP BY user_id
|
|
|
) log ON ui.id = log.user_id
|
|
|
<where>
|