Browse Source

not useable

zjxpcyc 6 years ago
parent
commit
75bbb2c2c8
1 changed files with 12 additions and 3 deletions
  1. 12
    3
      service/goods/orders.go

+ 12
- 3
service/goods/orders.go View File

16
 	"github.com/yl10/kit/guid"
16
 	"github.com/yl10/kit/guid"
17
 )
17
 )
18
 
18
 
19
-// Orders 下单
20
-func (s *GoodsServ) Orders(
19
+// PreOrders 下单
20
+func (s *GoodsServ) PreOrders(
21
 	info *model.TaGoodsOrders,
21
 	info *model.TaGoodsOrders,
22
 	details []model.TaGoodsOrdersDetail,
22
 	details []model.TaGoodsOrdersDetail,
23
 	customercouponid,
23
 	customercouponid,
104
 				GoodsId: "",
104
 				GoodsId: "",
105
 			}
105
 			}
106
 			for _, detail := range details {
106
 			for _, detail := range details {
107
-				if coupon.IsAll == 1 {
107
+				if coupon.IsAll == models.BOOL_TRUE {
108
 					dyprice, _ := strconv.ParseFloat(dyGoods.Price, 64)
108
 					dyprice, _ := strconv.ParseFloat(dyGoods.Price, 64)
109
 					detailprice, _ := strconv.ParseFloat(detail.Price, 64)
109
 					detailprice, _ := strconv.ParseFloat(detail.Price, 64)
110
 					if dyprice < detailprice {
110
 					if dyprice < detailprice {
188
 		return err
188
 		return err
189
 	}
189
 	}
190
 
190
 
191
+}
192
+
193
+// ConfirmOrder 订单确认
194
+// 1、订单状态修改为有效
195
+// 2、订单修改为支付状态
196
+// 3、卡券核销
197
+// 4、账户或者 VIP 卡扣钱
198
+func (s *GoodsServ) ConfirmOrder(ordersID string) error {
199
+
191
 	// 通知后端有新订单 - websocket
200
 	// 通知后端有新订单 - websocket
192
 	// orderList, err := s.GetOnLineOrders(info.CaseId, false)
201
 	// orderList, err := s.GetOnLineOrders(info.CaseId, false)
193
 	// if err != nil {
202
 	// if err != nil {