|
@@ -22,6 +22,10 @@ func (s OrderService) CreateOrder(in *jyOrder.Request) (int64, string, int64) {
|
|
}
|
|
}
|
|
order := map[string]interface{}{}
|
|
order := map[string]interface{}{}
|
|
order["pay_money"] = in.PayMoney
|
|
order["pay_money"] = in.PayMoney
|
|
|
|
+ //默认为个人主体
|
|
|
|
+ if in.BuySubject == 0 {
|
|
|
|
+ in.BuySubject = 1
|
|
|
|
+ }
|
|
order["buy_subject"] = in.BuySubject
|
|
order["buy_subject"] = in.BuySubject
|
|
order["ent_id"] = in.EntId
|
|
order["ent_id"] = in.EntId
|
|
order["buy_count"] = in.BuyCount
|
|
order["buy_count"] = in.BuyCount
|
|
@@ -123,9 +127,15 @@ func (s OrderService) UpdateOrder(in *jyOrder.Request) (int64, string) {
|
|
}
|
|
}
|
|
order := map[string]interface{}{}
|
|
order := map[string]interface{}{}
|
|
order["pay_money"] = in.PayMoney
|
|
order["pay_money"] = in.PayMoney
|
|
- order["buy_subject"] = in.BuySubject
|
|
|
|
- order["ent_id"] = in.EntId
|
|
|
|
- order["buy_count"] = in.BuyCount
|
|
|
|
|
|
+ //无企业id时不更新企业id字段 避免老数据调用更新覆盖
|
|
|
|
+ if in.EntId != 0 {
|
|
|
|
+ order["ent_id"] = in.EntId
|
|
|
|
+ }
|
|
|
|
+ //老数据或没传参不更新新增的主体字段
|
|
|
|
+ if in.BuySubject == 1 || in.BuySubject == 2 {
|
|
|
|
+ order["buy_subject"] = in.BuySubject
|
|
|
|
+ order["buy_count"] = in.BuyCount
|
|
|
|
+ }
|
|
order["order_money"] = in.OrderMoney
|
|
order["order_money"] = in.OrderMoney
|
|
order["user_nickname"] = in.UserNickname
|
|
order["user_nickname"] = in.UserNickname
|
|
order["order_status"] = in.OrderStatus
|
|
order["order_status"] = in.OrderStatus
|