- financial/GetStoreBills
This commit is contained in:
@@ -91,3 +91,16 @@ func SendFilesToStores(ctx *jxcontext.Context, files []*multipart.FileHeader, is
|
||||
}
|
||||
return task.ID, err
|
||||
}
|
||||
|
||||
func GetStoreBills(ctx *jxcontext.Context, storeID int) (bills []*legacymodel.StoreBill, err error) {
|
||||
db := dao.GetDB()
|
||||
if err = dao.GetRows(db, &bills, `
|
||||
SELECT *
|
||||
FROM store_bill
|
||||
WHERE store_id = ?
|
||||
ORDER BY date DESC
|
||||
`, storeID); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return bills, err
|
||||
}
|
||||
|
||||
@@ -3,11 +3,11 @@ package legacymodel
|
||||
import "time"
|
||||
|
||||
type StoreBill struct {
|
||||
Id int `orm:"column(id);auto"`
|
||||
Date time.Time `orm:"column(date);type(datetime)"`
|
||||
Url string `orm:"column(url);size(255)"`
|
||||
StoreId int `orm:"column(store_id)"`
|
||||
BillName string `orm:"column(bill_name);size(30)"`
|
||||
Id int `orm:"column(id);auto" json:"id"`
|
||||
Date time.Time `orm:"column(date);type(datetime)" json:"date"`
|
||||
Url string `orm:"column(url);size(255)" json:"url"`
|
||||
StoreId int `orm:"column(store_id)" json:"storeId"`
|
||||
BillName string `orm:"column(bill_name);size(30)" json:"billName"`
|
||||
}
|
||||
|
||||
func (t *StoreBill) TableName() string {
|
||||
|
||||
Reference in New Issue
Block a user