作者 yangfu

分红统计修改

@@ -35,8 +35,8 @@ func Login(header *protocol.RequestHeader, request *protocol.LoginRequest) (rsp @@ -35,8 +35,8 @@ func Login(header *protocol.RequestHeader, request *protocol.LoginRequest) (rsp
35 //子账号 35 //子账号
36 err = protocol.NewErrWithMessage(502, err) //账号不存在 36 err = protocol.NewErrWithMessage(502, err) //账号不存在
37 return 37 return
38 -  
39 } 38 }
  39 + partnerInfo.Password = partnerSubAccount.Password
40 } else { 40 } else {
41 if partnerInfo, err = PartnerInfoService.FindOne(map[string]interface{}{"account": request.Phone}); err != nil { 41 if partnerInfo, err = PartnerInfoService.FindOne(map[string]interface{}{"account": request.Phone}); err != nil {
42 //子账号 42 //子账号
@@ -51,13 +51,8 @@ func AllBonusStatics(orders []*domain.Order, action int) (bonus protocol.Bonus) @@ -51,13 +51,8 @@ func AllBonusStatics(orders []*domain.Order, action int) (bonus protocol.Bonus)
51 bonus = protocol.Bonus{} 51 bonus = protocol.Bonus{}
52 for i := range orders { 52 for i := range orders {
53 o := orders[i] 53 o := orders[i]
54 - //if action == protocol.BonusTotal {  
55 - bonus.Received += o.OrderBonusReceive()  
56 - bonus.Outstanding += o.OrderBonusWait()  
57 - //}  
58 - //if action == protocol.BonusOutstanding {  
59 - // bonus.Outstanding += o.OrderBonusOutstanding()  
60 - //} 54 + bonus.Received = utils.Decimal(bonus.Received + o.OrderBonusReceive())
  55 + bonus.Outstanding = utils.Decimal(bonus.Outstanding + o.OrderBonusWait())
61 } 56 }
62 return 57 return
63 } 58 }
@@ -67,17 +62,10 @@ func QuartersBonusStatics(orders []*domain.Order, action int) (bonus []protocol. @@ -67,17 +62,10 @@ func QuartersBonusStatics(orders []*domain.Order, action int) (bonus []protocol.
67 bonus = make([]protocol.Bonus, 4) 62 bonus = make([]protocol.Bonus, 4)
68 for i := range orders { 63 for i := range orders {
69 o := orders[i] 64 o := orders[i]
70 - quarter := o.CreateAt.Month() / 3  
71 - bonus[quarter].Received += o.OrderBonusReceive()  
72 - bonus[quarter].Outstanding += o.OrderBonusWait()  
73 - bonus[quarter].Expend += o.OrderBonusOutstanding()  
74 - //if action == protocol.BonusTotal {  
75 - //bonus[quarter].Received += o.OrderBonusReceive()  
76 - //bonus[quarter].Outstanding += o.OrderBonusWait()  
77 - //}  
78 - //if action == protocol.BonusOutstanding {  
79 - //bonus[quarter].Expend += o.OrderBonusOutstanding()  
80 - //} 65 + quarter := (o.CreateAt.Month() - 1) / 3
  66 + bonus[quarter].Received = utils.Decimal(bonus[quarter].Received + o.OrderBonusReceive())
  67 + bonus[quarter].Outstanding = utils.Decimal(bonus[quarter].Outstanding + o.OrderBonusWait())
  68 + bonus[quarter].Expend = utils.Decimal(bonus[quarter].Expend + o.OrderBonusOutstanding())
81 } 69 }
82 return 70 return
83 } 71 }