You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
889 B
43 lines
889 B
package gys
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"recook/internal/back"
|
|
"recook/internal/dbc"
|
|
"recook/internal/model/order"
|
|
"recook/tools"
|
|
)
|
|
|
|
type Order struct {
|
|
base
|
|
}
|
|
|
|
type argsReport struct {
|
|
ReportMsg string `json:"reportMsg" form:"reportMsg"`
|
|
OrderId uint `json:"orderId" form:"orderId"`
|
|
}
|
|
|
|
// @Style 订单报备
|
|
func (o *Order) Report(c *gin.Context) {
|
|
userId, err := o.GetGysId(c)
|
|
if err != nil {
|
|
back.Fail(c, err.Error())
|
|
return
|
|
}
|
|
|
|
args := argsReport{}
|
|
if err = tools.Params(&args, c); err != nil {
|
|
back.Fail(c, "参数错误:"+err.Error())
|
|
return
|
|
}
|
|
if args.OrderId <= 0 || args.ReportMsg == "" {
|
|
back.Fail(c, "参数错误")
|
|
return
|
|
}
|
|
dbc.DB.Model(&order.GoodsDetail{}).Where("order_id = ? and vendor_id = ?", args.OrderId, userId).Updates(&order.GoodsDetail{
|
|
ReportMsg: args.ReportMsg,
|
|
Report: 1,
|
|
})
|
|
back.Suc(c, "操作成功", nil)
|
|
}
|