Skip to content

Commit

Permalink
fix. getUserInfo sql문 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziihong committed May 19, 2023
1 parent 30a037d commit 51aae1c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/controllers/users.ctrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ const getUserInfo = (req, res) => {
const { email } = req.body;

db.query(
`SELECT COUNT(m.cost) as totalCount, SUM(m.cost) as totalCost, i.*
`SELECT COUNT(m.cost) as totalCount, IFNULL(SUM(m.cost), 0) as totalCost, i.*
FROM member_rating AS m
JOIN member_info AS i ON m.user_id = i.id
WHERE i.id = ?;
RIGHT OUTER JOIN member_info AS i ON m.user_id = i.id
where i.id=?;
`,
[email],
(error, result) => {
Expand Down

0 comments on commit 51aae1c

Please sign in to comment.