新增字段

This commit is contained in:
yan.y 2024-11-17 23:54:05 +08:00
parent 25dafdf7e5
commit cc4957813b
2 changed files with 59 additions and 4 deletions

View File

@ -1067,11 +1067,63 @@ func (p DefParty) orderGoodsUpdate() web_iris.Party {
}} }}
} }
// 支付 type OrderMarkRecord struct {
func (p DefParty) orderPay() web_iris.Party { OrderId string
return web_iris.Party{Prefix: p.Prefix, PartyFunc: func(index iris.Party) { Lab1 int
index.Post(OrderBase+"/orderPay", func(ctx *context.Context) { Lab2 int
Lab3 int
Message string
}
// 评价
func (p DefParty) orderMarkRecord() web_iris.Party {
return web_iris.Party{Prefix: p.Prefix, PartyFunc: func(index iris.Party) {
index.Post(OrderBase+"/orderMarkRecord", func(ctx *context.Context) {
headerBaseInfo := GetHeaderBaseInfo(ctx)
body, _ := io.ReadAll(ctx.Request().Body)
var orderMarkRecordRequest OrderMarkRecord
json.Unmarshal(body, &orderMarkRecordRequest)
if len(orderMarkRecordRequest.OrderId) == 0 {
OrderExistError.Fail(ctx, orderMarkRecordRequest)
return
}
serviceUserMarkRecord1 := models.ServiceUserMarkRecord{
Uid: headerBaseInfo.Uid,
OrderId: orderMarkRecordRequest.OrderId,
ServiceStar: orderMarkRecordRequest.Lab1,
ServiceLabels: "1",
Status: 1,
}
database.Instance().Model(&models.ServiceUserMarkRecord{}).Create(&serviceUserMarkRecord1)
serviceUserMarkRecord2 := models.ServiceUserMarkRecord{
Uid: headerBaseInfo.Uid,
OrderId: orderMarkRecordRequest.OrderId,
ServiceStar: orderMarkRecordRequest.Lab2,
ServiceLabels: "2",
Status: 1,
}
database.Instance().Model(&models.ServiceUserMarkRecord{}).Create(&serviceUserMarkRecord2)
serviceUserMarkRecord3 := models.ServiceUserMarkRecord{
Uid: headerBaseInfo.Uid,
OrderId: orderMarkRecordRequest.OrderId,
ServiceStar: orderMarkRecordRequest.Lab2,
ServiceLabels: "3",
Status: 1,
}
database.Instance().Model(&models.ServiceUserMarkRecord{}).Create(&serviceUserMarkRecord3)
serviceUserMarkRecord4 := models.ServiceUserMarkRecord{
Uid: headerBaseInfo.Uid,
OrderId: orderMarkRecordRequest.OrderId,
ServiceStar: orderMarkRecordRequest.Lab2,
ServiceLabels: "4",
Status: 1,
}
database.Instance().Model(&models.ServiceUserMarkRecord{}).Create(&serviceUserMarkRecord4)
Success(ctx, orderMarkRecordRequest, nil)
}) })
}} }}
} }

View File

@ -144,6 +144,7 @@ type OrderMain struct {
PayType int `json:"payType"` //支付方式 1线下 2线上 3会员余额 PayType int `json:"payType"` //支付方式 1线下 2线上 3会员余额
Status int `json:"status1"` //信息状态 Status int `json:"status1"` //信息状态
PayOrderId string `json:"payOrderId"` //支付订单号 PayOrderId string `json:"payOrderId"` //支付订单号
MarkStatus int `gorm:"default:0" json:"markStatus"` //评价状态
} }
// OrderSub 子订单 // OrderSub 子订单
@ -253,11 +254,13 @@ type ServiceUserMark struct {
type ServiceUserMarkRecord struct { type ServiceUserMarkRecord struct {
Id int64 `gorm:"primaryKey;autoIncrement" json:"id"` //id Id int64 `gorm:"primaryKey;autoIncrement" json:"id"` //id
Uid int64 `gorm:"index;not null" json:"uid"` //评价用户 Uid int64 `gorm:"index;not null" json:"uid"` //评价用户
OrderId string `gorm:"not null" json:"orderId"` //订单ID
ServiceStar int `gorm:"default:5" json:"serviceStar"` //服务星级 ServiceStar int `gorm:"default:5" json:"serviceStar"` //服务星级
ServiceLabels string `json:"serviceLabels"` //服务标签 ServiceLabels string `json:"serviceLabels"` //服务标签
MarkContext string `json:"markContext"` //评价内容 MarkContext string `json:"markContext"` //评价内容
CreateTime time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP" json:"-"` //创建时间 CreateTime time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP" json:"-"` //创建时间
UpdateTime time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP" json:"-"` //更新时间 UpdateTime time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP" json:"-"` //更新时间
Status int `json:"status"` //信息状态
} }
// ReserveTimeFilter 服务过滤时间 // ReserveTimeFilter 服务过滤时间