- add ShopName and BillTitle in StoreBill

This commit is contained in:
gazebo
2019-02-14 12:03:31 +08:00
parent 446dc061fa
commit 46fc0aac5f
2 changed files with 14 additions and 9 deletions

View File

@@ -71,10 +71,12 @@ func SendFilesToStores(ctx *jxcontext.Context, files []*multipart.FileHeader, ti
if err == nil {
db := dao.GetDB()
billRec := &legacymodel.StoreBill{
Date: time.Now(),
Url: jxutils.ComposeQiniuResURL(ret.Key),
StoreId: storeID,
BillName: fileHeader.Filename,
Date: time.Now(),
Url: jxutils.ComposeQiniuResURL(ret.Key),
StoreId: storeID,
BillName: fileHeader.Filename,
ShopName: shopName,
BillTitle: title,
}
if err = dao.CreateEntity(db, billRec); err == nil {
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
WHERE store_id = ?
ORDER BY date DESC
LIMIT 10
`, storeID); err != nil {
return nil, err
}