作者 yangfu

分红列表修改

@@ -176,7 +176,7 @@ func (OrderPaymentService *OrderPaymentService) ListDividendOrders(listOrderPaym @@ -176,7 +176,7 @@ func (OrderPaymentService *OrderPaymentService) ListDividendOrders(listOrderPaym
176 OrderId string `json:"id"` //订单编号 176 OrderId string `json:"id"` //订单编号
177 OrderNumber string `json:"orderNumber"` //订单号 177 OrderNumber string `json:"orderNumber"` //订单号
178 OrderState int `json:"orderState"` //订单状态 178 OrderState int `json:"orderState"` //订单状态
179 - StateOfPayment string `json:"stateOfPayment"` //支付状态 179 + StateOfPayment int `json:"stateOfPayment"` //支付状态
180 CreateTime string `json:"createTime"` //订单创建时间 180 CreateTime string `json:"createTime"` //订单创建时间
181 PartnerName string `json:"partnerName"` //合伙人姓名 181 PartnerName string `json:"partnerName"` //合伙人姓名
182 DividendProportion float64 `json:"dividendProportion"` //分红比例 182 DividendProportion float64 `json:"dividendProportion"` //分红比例
@@ -192,7 +192,7 @@ func (OrderPaymentService *OrderPaymentService) ListDividendOrders(listOrderPaym @@ -192,7 +192,7 @@ func (OrderPaymentService *OrderPaymentService) ListDividendOrders(listOrderPaym
192 OrderId: fmt.Sprintf("%v", order.Id), 192 OrderId: fmt.Sprintf("%v", order.Id),
193 OrderNumber: order.OrderCode, 193 OrderNumber: order.OrderCode,
194 OrderState: order.OrderStatus, 194 OrderState: order.OrderStatus,
195 - StateOfPayment: "", 195 + StateOfPayment: order.BonusStatus,
196 CreateTime: order.CreateAt.Local().Format("2006-01-02 15:04:05"), 196 CreateTime: order.CreateAt.Local().Format("2006-01-02 15:04:05"),
197 PartnerName: order.PartnerInfo.PartnerName, 197 PartnerName: order.PartnerInfo.PartnerName,
198 DividendProportion: order.PartnerBonusPercent, 198 DividendProportion: order.PartnerBonusPercent,
@@ -201,11 +201,11 @@ func (OrderPaymentService *OrderPaymentService) ListDividendOrders(listOrderPaym @@ -201,11 +201,11 @@ func (OrderPaymentService *OrderPaymentService) ListDividendOrders(listOrderPaym
201 ReceiveDividends: utils.Decimal(order.OrderPaymentAmount * (order.PartnerBonusPercent / 100.0)), 201 ReceiveDividends: utils.Decimal(order.OrderPaymentAmount * (order.PartnerBonusPercent / 100.0)),
202 CommissionProportion: order.SalesmanBonusPercent, 202 CommissionProportion: order.SalesmanBonusPercent,
203 } 203 }
204 - if order.BonusStatus == domain.BonusPaid {  
205 - item.StateOfPayment = "已支付分红"  
206 - } else {  
207 - item.StateOfPayment = "等待支付分红"  
208 - } 204 + //if order.BonusStatus == domain.BonusPaid {
  205 + // item.StateOfPayment = "已支付分红"
  206 + //} else {
  207 + // item.StateOfPayment = "等待支付分红"
  208 + //}
209 if order.OrderActualAmount < order.OrderAmount { 209 if order.OrderActualAmount < order.OrderAmount {
210 item.DividendSpending = utils.Decimal((order.OrderAmount - order.OrderActualAmount) * (order.PartnerBonusPercent / 100.0)) 210 item.DividendSpending = utils.Decimal((order.OrderAmount - order.OrderActualAmount) * (order.PartnerBonusPercent / 100.0))
211 } 211 }
@@ -76,7 +76,7 @@ func (repository *OrderPaymentRepository) Find(queryOptions domain.OrderPaymentQ @@ -76,7 +76,7 @@ func (repository *OrderPaymentRepository) Find(queryOptions domain.OrderPaymentQ
76 tx := repository.transactionContext.PgTx 76 tx := repository.transactionContext.PgTx
77 var OrderPaymentModels []*models.OrderPayment 77 var OrderPaymentModels []*models.OrderPayment
78 query := tx.Model(&OrderPaymentModels) 78 query := tx.Model(&OrderPaymentModels)
79 - query.Where("order_payment.order_id = ?", queryOptions.OrderId) 79 + query.Where("order_id=?", queryOptions.OrderId)
80 query.Order("id ASC") 80 query.Order("id ASC")
81 var ( 81 var (
82 err error 82 err error
@@ -171,7 +171,7 @@ func (c *DividendsController) Detail() { @@ -171,7 +171,7 @@ func (c *DividendsController) Detail() {
171 PaymentForGoods: item.PaymentAmount, 171 PaymentForGoods: item.PaymentAmount,
172 UpdateTime: item.UpdateAt.Local().Format("2006-01-02 15:04:05"), 172 UpdateTime: item.UpdateAt.Local().Format("2006-01-02 15:04:05"),
173 StateOfPayment: item.BonusStatus, 173 StateOfPayment: item.BonusStatus,
174 - Dividend: item.BonusAmount, 174 + Dividend: utils.Decimal(item.PaymentAmount * (order.PartnerBonusPercent / 100.0)),
175 DividendProportion: order.PartnerBonusPercent, 175 DividendProportion: order.PartnerBonusPercent,
176 Id: item.Id, 176 Id: item.Id,
177 } 177 }