This commit is contained in:
苏尹岚
2020-11-17 09:18:52 +08:00
parent cd48c4b81c
commit cbf15f6c49

View File

@@ -29,7 +29,7 @@ func GetBillExpend(db *DaoDB, userID string, billType int, fromTime, toTime time
sql := ` sql := `
SELECT b.* SELECT b.*
FROM user_bill a FROM user_bill a
JOIN bill_expend b ON b.bill_id = a.bill_id LEFT JOIN bill_expend b ON b.bill_id = a.bill_id
WHERE a.deleted_at = ? WHERE a.deleted_at = ?
` `
sqlParams := []interface{}{utils.DefaultTimeValue} sqlParams := []interface{}{utils.DefaultTimeValue}
@@ -49,7 +49,7 @@ func GetBillExpend(db *DaoDB, userID string, billType int, fromTime, toTime time
sql += ` AND b.created_at <= ?` sql += ` AND b.created_at <= ?`
sqlParams = append(sqlParams, toTime) sqlParams = append(sqlParams, toTime)
} }
err = GetRow(db, &billExpends, sql, sqlParams) err = GetRows(db, &billExpends, sql, sqlParams)
return billExpends, err return billExpends, err
} }