@@ -273,9 +273,9 @@ func (d *defaultService) PaymentOrderObs(order *proto.SPaymentOrder) bool {
273
273
274
274
// 测试是否为子订单,并返回编号
275
275
func (d * defaultService ) testSubId (o * proto.SSingleOrder ) (string , bool ) {
276
- if o .ParentOrderId <= 0 {
277
- return o .OrderNo , true
278
- }
276
+ // if o.ParentOrderId <= 0 {
277
+ // return o.OrderNo, true
278
+ // }
279
279
return o .OrderNo , false
280
280
}
281
281
@@ -291,20 +291,20 @@ func (d *defaultService) batchDelKeys(conn redis.Conn, key string) {
291
291
292
292
// 设置订单过期时间
293
293
func (d * defaultService ) updateOrderExpires (conn redis.Conn , o * proto.SSingleOrder ) {
294
- //订单刚创建时,设置过期时间
295
- if o .Status == order .StatAwaitingPayment {
296
- trans , cli , _ := service .FoundationServiceClient ()
297
- defer trans .Close ()
298
- ss , _ := cli .GetGlobMchSaleConf_ (context .TODO (), & proto.Empty {})
299
- unix := o .UpdateTime + int64 (ss .OrderTimeOutMinute )* 60
300
- t := time .Unix (unix , 0 )
301
- tk := getTick (t )
302
- orderNo , sub := d .testSubId (o )
303
- prefix := types .StringCond (sub , "sub!" , "" )
304
- key := fmt .Sprintf ("%s:%s%s:%s" , variable .KvOrderExpiresTime , prefix , orderNo , tk )
305
- //log.Println(" [Daemon][Exprire][ Key]:", key)
306
- conn .Do ("SET" , key , unix )
307
- }
294
+ // // 订单刚创建时,设置过期时间
295
+ // if o.Status == order.StatAwaitingPayment {
296
+ // trans, cli, _ := service.FoundationServiceClient()
297
+ // defer trans.Close()
298
+ // ss, _ := cli.GetGlobMchSaleConf_(context.TODO(), &proto.Empty{})
299
+ // unix := o.UpdateTime + int64(ss.OrderTimeOutMinute)*60
300
+ // t := time.Unix(unix, 0)
301
+ // tk := getTick(t)
302
+ // orderNo, sub := d.testSubId(o)
303
+ // prefix := types.StringCond(sub, "sub!", "")
304
+ // key := fmt.Sprintf("%s:%s%s:%s", variable.KvOrderExpiresTime, prefix, orderNo, tk)
305
+ // //log.Println(" [Daemon][Exprire][ Key]:", key)
306
+ // conn.Do("SET", key, unix)
307
+ // }
308
308
}
309
309
310
310
// 取消订单过期时间
@@ -332,19 +332,19 @@ func (d *defaultService) orderAutoConfirm(conn redis.Conn, o *proto.SSingleOrder
332
332
333
333
// 订单自动收货
334
334
func (d * defaultService ) orderAutoReceive (conn redis.Conn , o * proto.SSingleOrder ) {
335
- if o .Status == order .StatShipped {
336
- trans , cli , _ := service .FoundationServiceClient ()
337
- defer trans .Close ()
338
- ss , _ := cli .GetGlobMchSaleConf_ (context .TODO (), & proto.Empty {})
339
- unix := o .UpdateTime + int64 (ss .OrderTimeOutReceiveHour )* 60 * 60
340
- t := time .Unix (unix , 0 )
341
- tk := getTick (t )
342
- orderNo , sub := d .testSubId (o )
343
- prefix := types .StringCond (sub , "sub!" , "" )
344
- key := fmt .Sprintf ("%s:%s%s:%s" , variable .KvOrderAutoReceive , prefix , orderNo , tk )
345
- //log.Println(" [Daemon][AutoReceive][ Key]:", key)
346
- conn .Do ("SET" , key , unix )
347
- }
335
+ // if o.Status == order.StatShipped {
336
+ // trans, cli, _ := service.FoundationServiceClient()
337
+ // defer trans.Close()
338
+ // ss, _ := cli.GetGlobMchSaleConf_(context.TODO(), &proto.Empty{})
339
+ // unix := o.UpdateTime + int64(ss.OrderTimeOutReceiveHour)*60*60
340
+ // t := time.Unix(unix, 0)
341
+ // tk := getTick(t)
342
+ // orderNo, sub := d.testSubId(o)
343
+ // prefix := types.StringCond(sub, "sub!", "")
344
+ // key := fmt.Sprintf("%s:%s%s:%s", variable.KvOrderAutoReceive, prefix, orderNo, tk)
345
+ // //log.Println(" [Daemon][AutoReceive][ Key]:", key)
346
+ // conn.Do("SET", key, unix)
347
+ // }
348
348
}
349
349
350
350
// 完成订单自动收货
0 commit comments