作者 yangfu

修改:订单详情 / iM配置

... ... @@ -29,7 +29,7 @@ func Detail(header *protocol.RequestHeader, request *protocol.OrderDetailRequest
log.Error(err)
return
}
rsp.Order = protocol.OrderDetailVO{
rsp.Order = protocol.OrderDetail{
Id: order.Id,
OrderNo: order.OrderCode,
DeliveryNo: order.DeliveryCode,
... ... @@ -38,7 +38,7 @@ func Detail(header *protocol.RequestHeader, request *protocol.OrderDetailRequest
UpdateTime: order.UpdateTime.Unix() * 1000,
OrderDistrict: map[string]interface{}{"id": order.RegionInfo.RegionId, "name": order.RegionInfo.RegionName},
Customer: protocol.Customer{Uname: order.Buyer.BuyerName, Phone: order.Buyer.ContactInfo},
Product: orderProducts(order),
Products: orderProducts(order),
Total: orderTotalStatic(order),
}
if header.UserId == order.PartnerId && order.UpdateTime.After(order.LastViewTime) {
... ...
... ... @@ -4,8 +4,8 @@ import "os"
var (
IM_SERVICE_ADDRESS = "https://api.netease.im/nimserver"
IM_APP_KEY = "ebf3ae278ee1b346773b99be5080f6a9"
IM_APP_SECRET = "67ea92e1ea45"
IM_APP_KEY = "be7c0639c10e6a69f86ce3b4fa8dc8ec" //"ebf3ae278ee1b346773b99be5080f6a9"
IM_APP_SECRET = "9c5b60346613" //"67ea92e1ea45"
)
func init() {
... ...
... ... @@ -55,6 +55,7 @@ func (repository *OrderBaseRepository) FindOne(queryOptions map[string]interface
query.ColumnExpr("order_base.*")
query.Relation("OrderGood", func(q *orm.Query) (*orm.Query, error) {
q.ColumnExpr("order_good.*")
q.Order("id")
return q, nil
})
query.SetWhere(`"order_base".id = ?`, "id")
... ...
... ... @@ -7,23 +7,24 @@ type OrderDetailRequest struct {
type OrderDetailResponse struct {
Order interface{} `json:"order"`
}
//type OrderDetail struct {
// Id int64 `json:"id"`
// OrderNo string `json:"orderNo"`
// OrderName string `json:"orderName"`
// OrderStatus int `json:"orderStatus"`
// CreateTime int64 `json:"createTime"`
// UpdateTime int64 `json:"updateTime"`
// OrderQuantity int `json:"orderQuantity"`
// OrderAmount float64 `json:"orderAmount"`
// OrderAmountCancel float64 `json:"orderAmountCancel"`
// OrderUpdateReason string `json:"orderUpdateReason"`
// OrderDistrict interface{} `json:"orderDistrict"`
// Customer Customer `json:"customer"`
// MyDividend float64 `json:"myDividend"`
// MyDividendPercent float64 `json:"myDividendPercent"`
//}
type OrderDetail struct {
Id int64 `json:"id"`
OrderNo string `json:"orderNo"`
OrderName string `json:"orderName"`
OrderStatus int `json:"orderStatus"`
CreateTime int64 `json:"createTime"`
UpdateTime int64 `json:"updateTime"`
OrderQuantity int `json:"orderQuantity"`
OrderAmount float64 `json:"orderAmount"`
OrderAmountCancel float64 `json:"orderAmountCancel"`
OrderUpdateReason string `json:"orderUpdateReason"`
OrderDistrict interface{} `json:"orderDistrict"`
Customer Customer `json:"customer"`
MyDividend float64 `json:"myDividend"`
MyDividendPercent float64 `json:"myDividendPercent"`
}
type OrderDetailVO struct {
Id int64 `json:"id"`
OrderNo string `json:"orderNo"` //订单号
DeliveryNo string `json:"deliveryNo"` //发货单号
... ... @@ -32,7 +33,7 @@ type OrderDetailVO struct {
UpdateTime int64 `json:"updateTime"`
OrderDistrict interface{} `json:"orderDistrict"`
Customer Customer `json:"customer"`
Product interface{} `json:"product"`
Products interface{} `json:"products"`
Total interface{} `json:"total"`
}
type Customer struct {
... ...