Skip to content

Commit

Permalink
Merge pull request #86 from kookmin-sw/feat/del-record
Browse files Browse the repository at this point in the history
fix. getUserInfo sql문 수정
  • Loading branch information
Ziihong authored May 19, 2023
2 parents afa79c3 + 51aae1c commit 6976aa5
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 6976aa5

Please sign in to comment.