Skip to content

Commit

Permalink
Merge pull request #20 from MengChiehLiu/develop
Browse files Browse the repository at this point in the history
1.0.11
  • Loading branch information
MengChiehLiu authored Aug 23, 2023
2 parents d22dab5 + 11a21b4 commit 1b5c270
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
echo "${{ secrets.EC2_PRIVATE_KEY }}" > private_key && chmod 600 private_key
ssh -o StrictHostKeyChecking=no -i private_key ${{ secrets.EC2_USERNAME }}@${{ secrets.EC2_HOST }} '
cd /home/ubuntu/BalanceCat &&
git pull origin develop &&
git pull origin main &&
echo "${{ secrets.FRONTEND_ENV_FILE }}" > frontend/.env &&
echo "${{ secrets.BACKEND_ENV_FILE }}" > backend/.env &&
echo "${{ secrets.COMBINED_CRT }}" > private/combined.crt &&
Expand Down
9 changes: 3 additions & 6 deletions backend/server/models/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ async function getFS(user_id, date){

try{
let [fs] = await client
.select('balances')
.where({'user_id=?': user_id, 'month=?':date, 'subject_id<?':4000})
.as('b')

.select('b', 's.id, s.name, s.is_debit, s.parent_id, b.amount')
.join('subjects as s', 's.id=b.subject_id')
.select('subjects as s', 's.id, s.name, s.is_debit, s.parent_id, COALESCE(b.amount, 0) AS amount')
.join('balances as b', 's.id=b.subject_id')
.where({'s.id<?':4000, 'b.user_id=?': user_id, 'b.month=?':date})
.query()

return buildHierarchyFS(fs, null)
Expand Down

0 comments on commit 1b5c270

Please sign in to comment.