dengbiao vor 5 Monaten
Ursprung
Commit
91ec7c195b
2 geänderte Dateien mit 20 neuen und 22 gelöschten Zeilen
  1. +3
    -2
      app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go
  2. +17
    -20
      app/db/db_central_kitchen_wx_transfer_ord.go

+ 3
- 2
app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go Datei anzeigen

@@ -1663,7 +1663,7 @@ func CentralKitchenForSchoolWxTransferOrdList(c *gin.Context) {

centralKitchenWxTransferOrdDb := db.CentralKitchenWxTransferOrd{}
centralKitchenWxTransferOrdDb.Set("")
list, total, err := centralKitchenWxTransferOrdDb.FindCentralKitchenWxTransferOrd(req.Phone, req.Page, req.Limit)
list, total, err := centralKitchenWxTransferOrdDb.FindCentralKitchenWxTransferOrd(req.Page, req.Limit)
if err != nil {
e.OutErr(c, e.ERR, err.Error())
return
@@ -1771,7 +1771,8 @@ func CentralKitchenForSchoolWxTransfer(c *gin.Context) {
func CentralKitchenForSchoolWxTransferOrdFlow(c *gin.Context) {
outTradeNo := c.DefaultQuery("out_trade_no", "")

centralKitchenWxTransferOrdDb := db.CentralKitchenWxTransferOrd{OutTradeNo: outTradeNo}
centralKitchenWxTransferOrdDb := db.CentralKitchenWxTransferOrd{}
centralKitchenWxTransferOrdDb.Set(outTradeNo)
resp, err := centralKitchenWxTransferOrdDb.GetCentralKitchenWxTransferOrd()
if err != nil {
e.OutErr(c, e.ERR, err.Error())


+ 17
- 20
app/db/db_central_kitchen_wx_transfer_ord.go Datei anzeigen

@@ -17,9 +17,18 @@ func (centralKitchenWxTransferOrdDb *CentralKitchenWxTransferOrd) Set(outTradeNo
centralKitchenWxTransferOrdDb.OutTradeNo = outTradeNo
}

type FindCentralKitchenWxTransferOrd struct {
model.CentralKitchenWxTransferOrdList `xorm:"extends"`
model.User `xorm:"extends"`
}

func (FindCentralKitchenWxTransferOrd) TableName() string {
return "central_kitchen_wx_transfer_ord_list"
}

type GetCentralKitchenWxTransferOrdResp struct {
Ord *model.CentralKitchenWxTransferOrd `json:"ord"`
List *[]model.CentralKitchenWxTransferOrdList `json:"list"`
Ord *model.CentralKitchenWxTransferOrd `json:"ord"`
List []*FindCentralKitchenWxTransferOrd `json:"list"`
}

func (centralKitchenWxTransferOrdDb *CentralKitchenWxTransferOrd) GetCentralKitchenWxTransferOrd() (resp GetCentralKitchenWxTransferOrdResp, err error) {
@@ -35,8 +44,10 @@ func (centralKitchenWxTransferOrdDb *CentralKitchenWxTransferOrd) GetCentralKitc
resp.Ord = m

//1、查找 central_kitchen_wx_transfer_ord_list 记录
var list *[]model.CentralKitchenWxTransferOrdList
err = centralKitchenWxTransferOrdDb.Db.Where("out_trade_no =?", centralKitchenWxTransferOrdDb.OutTradeNo).Find(&list)
var list []*FindCentralKitchenWxTransferOrd
err = centralKitchenWxTransferOrdDb.Db.Where("out_trade_no =?", centralKitchenWxTransferOrdDb.OutTradeNo).
Join("LEFT", "user", "user.id = central_kitchen_wx_transfer_ord_list.uid").
Find(&list)
if err != nil {
return resp, err
}
@@ -44,13 +55,8 @@ func (centralKitchenWxTransferOrdDb *CentralKitchenWxTransferOrd) GetCentralKitc
return
}

func (centralKitchenWxTransferOrdDb *CentralKitchenWxTransferOrd) FindCentralKitchenWxTransferOrd(phone string, page, limit int) (list []*FindCentralKitchenWxTransferOrd, total int64, err error) {
sess := centralKitchenWxTransferOrdDb.Db.
Join("LEFT", "user", "user.id = central_kitchen_wx_transfer_ord.uid")
if phone != "" {
sess.And("user.phone like ?", "%"+phone+"%")
}
total, err = sess.Limit(limit, (page-1)*limit).FindAndCount(&list)
func (centralKitchenWxTransferOrdDb *CentralKitchenWxTransferOrd) FindCentralKitchenWxTransferOrd(page, limit int) (list []*model.CentralKitchenWxTransferOrd, total int64, err error) {
total, err = centralKitchenWxTransferOrdDb.Db.Limit(limit, (page-1)*limit).FindAndCount(&list)
if err != nil {
return nil, 0, err
}
@@ -88,12 +94,3 @@ func (centralKitchenWxTransferOrdDb *CentralKitchenWxTransferOrd) CentralKitchen
}
return affected, nil
}

type FindCentralKitchenWxTransferOrd struct {
model.CentralKitchenWxTransferOrd `xorm:"extends"`
model.User `xorm:"extends"`
}

func (FindCentralKitchenWxTransferOrd) TableName() string {
return "central_kitchen_wx_transfer_ord"
}

Laden…
Abbrechen
Speichern