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