bilifanxian
This commit is contained in:
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user