- add ShopName and BillTitle in StoreBill
This commit is contained in:
@@ -71,10 +71,12 @@ func SendFilesToStores(ctx *jxcontext.Context, files []*multipart.FileHeader, ti
|
|||||||
if err == nil {
|
if err == nil {
|
||||||
db := dao.GetDB()
|
db := dao.GetDB()
|
||||||
billRec := &legacymodel.StoreBill{
|
billRec := &legacymodel.StoreBill{
|
||||||
Date: time.Now(),
|
Date: time.Now(),
|
||||||
Url: jxutils.ComposeQiniuResURL(ret.Key),
|
Url: jxutils.ComposeQiniuResURL(ret.Key),
|
||||||
StoreId: storeID,
|
StoreId: storeID,
|
||||||
BillName: fileHeader.Filename,
|
BillName: fileHeader.Filename,
|
||||||
|
ShopName: shopName,
|
||||||
|
BillTitle: title,
|
||||||
}
|
}
|
||||||
if err = dao.CreateEntity(db, billRec); err == nil {
|
if err = dao.CreateEntity(db, billRec); err == nil {
|
||||||
err = weixinmsg.NotifySaleBill(storeID, title, shopName, "http://www.jxc4.com/billshow/?path="+billRec.Url)
|
err = weixinmsg.NotifySaleBill(storeID, title, shopName, "http://www.jxc4.com/billshow/?path="+billRec.Url)
|
||||||
@@ -109,6 +111,7 @@ func GetStoreBills(ctx *jxcontext.Context, storeID int) (bills []*legacymodel.St
|
|||||||
FROM store_bill
|
FROM store_bill
|
||||||
WHERE store_id = ?
|
WHERE store_id = ?
|
||||||
ORDER BY date DESC
|
ORDER BY date DESC
|
||||||
|
LIMIT 10
|
||||||
`, storeID); err != nil {
|
`, storeID); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,11 +3,13 @@ package legacymodel
|
|||||||
import "time"
|
import "time"
|
||||||
|
|
||||||
type StoreBill struct {
|
type StoreBill struct {
|
||||||
Id int `orm:"column(id);auto" json:"id"`
|
Id int `orm:"column(id);auto" json:"id"`
|
||||||
Date time.Time `orm:"column(date);type(datetime)" json:"date"`
|
Date time.Time `orm:"column(date);type(datetime)" json:"date"`
|
||||||
Url string `orm:"column(url);size(255)" json:"url"`
|
Url string `orm:"column(url);size(255)" json:"url"`
|
||||||
StoreId int `orm:"column(store_id)" json:"storeId"`
|
StoreId int `orm:"column(store_id)" json:"storeId"`
|
||||||
BillName string `orm:"column(bill_name);size(30)" json:"billName"`
|
BillName string `orm:"column(bill_name);size(30)" json:"billName"`
|
||||||
|
ShopName string `orm:"size(30)" json:"shopName"`
|
||||||
|
BillTitle string `orm:"size(255)" json:"billTitle"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *StoreBill) TableName() string {
|
func (t *StoreBill) TableName() string {
|
||||||
|
|||||||
Reference in New Issue
Block a user