@@ -860,6 +860,16 @@ func CentralKitchenForSchoolOrdList(c *gin.Context) { | |||||
"value": "4", | "value": "4", | ||||
}, | }, | ||||
}, | }, | ||||
"pay_way_list": []map[string]interface{}{ | |||||
{ | |||||
"name": "支付宝", | |||||
"value": 1, | |||||
}, | |||||
{ | |||||
"name": "微信", | |||||
"value": 2, | |||||
}, | |||||
}, | |||||
"state_list": []map[string]interface{}{ | "state_list": []map[string]interface{}{ | ||||
{ | { | ||||
"name": enum.CentralKitchenForSchoolPackageOrdState.String(enum.CentralKitchenForSchoolPackageOrdStateForWait), | "name": enum.CentralKitchenForSchoolPackageOrdState.String(enum.CentralKitchenForSchoolPackageOrdStateForWait), | ||||
@@ -22,6 +22,42 @@ import ( | |||||
// Demo 测试 | // Demo 测试 | ||||
func Demo(c *gin.Context) { | func Demo(c *gin.Context) { | ||||
var m []model.CentralKitchenForSchoolUserWithDay | |||||
eg := db.Db | |||||
if err1 := eg.Where("state = 3").Asc("id").Find(&m); err1 != nil { | |||||
e.OutErr(c, e.ERR, err1.Error()) | |||||
return | |||||
} | |||||
now := time.Now() | |||||
var records []int | |||||
for _, v := range m { | |||||
mm := new(model.CentralKitchenForSchoolUserRefundDay) | |||||
has, err := db.Db.Where("records_id =? and state = 1", v.Id).Get(mm) | |||||
if err != nil { | |||||
fmt.Println(err) | |||||
return | |||||
} | |||||
if has == false { | |||||
centralKitchenForSchoolUserRefundDayDb := db.CentralKitchenForSchoolUserRefundDayDb{} | |||||
centralKitchenForSchoolUserRefundDayDb.Set(0) | |||||
_, err = centralKitchenForSchoolUserRefundDayDb.CentralKitchenForSchoolUserRefundDayInsert(&model.CentralKitchenForSchoolUserRefundDay{ | |||||
OutTradeNo: v.OrdNo, | |||||
OutRequestNo: "", | |||||
Uid: v.Uid, | |||||
IdentityId: v.IdentityId, | |||||
RecordsId: v.Id, | |||||
State: enum.CentralKitchenForSchoolUserRefundDayStateForAuditing, | |||||
Amount: v.Amount, | |||||
Memo: "fill", | |||||
CreateAt: now.Format("2006-01-02 15:04:05"), | |||||
UpdateAt: now.Format("2006-01-02 15:04:05"), | |||||
}) | |||||
records = append(records, v.Id) | |||||
} | |||||
} | |||||
e.OutSuc(c, records, nil) | |||||
return | |||||
var req md.CentralKitchenForSchoolOrderRefundAuditReq | var req md.CentralKitchenForSchoolOrderRefundAuditReq | ||||
err := c.ShouldBindJSON(&req) | err := c.ShouldBindJSON(&req) | ||||
if err != nil { | if err != nil { | ||||
@@ -231,6 +231,7 @@ type CentralKitchenForSchoolOrdListResp struct { | |||||
TradeNo string `json:"trade_no"` | TradeNo string `json:"trade_no"` | ||||
State int `json:"state"` | State int `json:"state"` | ||||
OrdState int `json:"ord_state"` | OrdState int `json:"ord_state"` | ||||
PayWay int `json:"pay_way"` | |||||
CreateAt string `json:"create_at"` | CreateAt string `json:"create_at"` | ||||
Phone string `json:"phone" label:"家长联系电话"` | Phone string `json:"phone" label:"家长联系电话"` | ||||
Name string `json:"name" label:"姓名"` | Name string `json:"name" label:"姓名"` | ||||
@@ -251,6 +252,7 @@ type CentralKitchenForSchoolOrdListReq struct { | |||||
EnterPriseKind int `json:"enterprise_kind" label:"校企类型"` | EnterPriseKind int `json:"enterprise_kind" label:"校企类型"` | ||||
Sate int `json:"state" label:"支付状态"` | Sate int `json:"state" label:"支付状态"` | ||||
OrdSate int `json:"ord_state" label:"订单状态"` | OrdSate int `json:"ord_state" label:"订单状态"` | ||||
PayWay int `json:"pay_way" label:"支付方式(1:支付宝 2:微信)"` | |||||
GradeId int `json:"grade_id" label:"年级id"` | GradeId int `json:"grade_id" label:"年级id"` | ||||
ClassId int `json:"class_id" label:"班级id"` | ClassId int `json:"class_id" label:"班级id"` | ||||
Phone string `json:"phone" label:"家长联系电话"` | Phone string `json:"phone" label:"家长联系电话"` | ||||
@@ -656,6 +656,9 @@ func CentralKitchenForSchoolOrdList(req md.CentralKitchenForSchoolOrdListReq) (r | |||||
if req.OrdSate != -1 { | if req.OrdSate != -1 { | ||||
sess.And("central_kitchen_for_school_package_ord.ord_state = ?", req.OrdSate) | sess.And("central_kitchen_for_school_package_ord.ord_state = ?", req.OrdSate) | ||||
} | } | ||||
if req.PayWay != 0 { | |||||
sess.And("central_kitchen_for_school_package_ord.pay_way = ?", req.PayWay) | |||||
} | |||||
if req.OutTradeNo != "" { | if req.OutTradeNo != "" { | ||||
sess.And("central_kitchen_for_school_package_ord.out_trade_no like ?", "%"+req.OutTradeNo+"%") | sess.And("central_kitchen_for_school_package_ord.out_trade_no like ?", "%"+req.OutTradeNo+"%") | ||||
} | } | ||||
@@ -715,6 +718,7 @@ func CentralKitchenForSchoolOrdList(req md.CentralKitchenForSchoolOrdListReq) (r | |||||
TradeNo: v.CentralKitchenForSchoolPackageOrd.TradeNo, | TradeNo: v.CentralKitchenForSchoolPackageOrd.TradeNo, | ||||
State: v.CentralKitchenForSchoolPackageOrd.State, | State: v.CentralKitchenForSchoolPackageOrd.State, | ||||
OrdState: v.CentralKitchenForSchoolPackageOrd.OrdState, | OrdState: v.CentralKitchenForSchoolPackageOrd.OrdState, | ||||
PayWay: v.CentralKitchenForSchoolPackageOrd.PayWay, | |||||
CreateAt: v.CentralKitchenForSchoolPackageOrd.CreateAt, | CreateAt: v.CentralKitchenForSchoolPackageOrd.CreateAt, | ||||
Phone: v.User.Phone, | Phone: v.User.Phone, | ||||
Name: v.UserIdentity.Name, | Name: v.UserIdentity.Name, | ||||