bilifanxian

This commit is contained in:
苏尹岚
2020-12-10 14:02:46 +08:00
parent caf63a3869
commit d69c31b773
7 changed files with 100 additions and 48 deletions

View File

@@ -53,6 +53,22 @@ func GetBillExpend(db *DaoDB, userID string, billType int, fromTime, toTime time
return billExpends, err
}
func GetBillIncome(db *DaoDB, jobID int) (billIncomes []*model.BillIncome, err error) {
sql := `
SELECT b.*
FROM user_bill a
LEFT JOIN bill_income b ON b.bill_id = a.bill_id
WHERE a.deleted_at = ?
`
sqlParams := []interface{}{utils.DefaultTimeValue}
if jobID != 0 {
sql += ` AND b.job_id = ?`
sqlParams = append(sqlParams, jobID)
}
err = GetRows(db, &billIncomes, sql, sqlParams)
return billIncomes, err
}
type UserBillDetail struct {
CreatedAt time.Time `json:"created_at"`
LastOperator string `json:"lastOperator"`