소스 검색

update

master
dengbiao 5 달 전
부모
커밋
91ec7c195b
2개의 변경된 파일20개의 추가작업 그리고 22개의 파일을 삭제
  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 파일 보기

@@ -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 파일 보기

@@ -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"
}

불러오는 중...
취소
저장