作者 唐旭辉

更新

@@ -736,7 +736,7 @@ func (service OrderInfoService) PageListOrderBonus(listOrderQuery query.ListOrde @@ -736,7 +736,7 @@ func (service OrderInfoService) PageListOrderBonus(listOrderQuery query.ListOrde
736 }); err != nil { 736 }); err != nil {
737 return nil, cnt, lib.ThrowError(lib.TRANSACTION_ERROR, err.Error()) 737 return nil, cnt, lib.ThrowError(lib.TRANSACTION_ERROR, err.Error())
738 } 738 }
739 - ordersM, cnt, err = orderBaseDao.OrderListByCondition( 739 + ordersM, cnt, err = orderBaseDao.OrderBonusListByCondition(
740 listOrderQuery.CompanyId, 740 listOrderQuery.CompanyId,
741 listOrderQuery.OrderType, 741 listOrderQuery.OrderType,
742 listOrderQuery.PartnerOrCode, 742 listOrderQuery.PartnerOrCode,
@@ -5,6 +5,7 @@ import ( @@ -5,6 +5,7 @@ import (
5 5
6 "github.com/go-pg/pg/v10/orm" 6 "github.com/go-pg/pg/v10/orm"
7 7
  8 + "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/domain"
8 "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/pg/models" 9 "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/pg/models"
9 "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/pg/transaction" 10 "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/pg/transaction"
10 ) 11 )
@@ -45,15 +46,17 @@ func (dao OrderBaseDao) DeliveryCodeExist(code string, companyId int64, notId .. @@ -45,15 +46,17 @@ func (dao OrderBaseDao) DeliveryCodeExist(code string, companyId int64, notId ..
45 return ok, err 46 return ok, err
46 } 47 }
47 48
48 -//OrderListByCondition 根据条件获取订单列表 49 +//OrderListByCondition 根据条件获取订单分红列表
49 //orderType 订单类型 50 //orderType 订单类型
50 //partnerOrCode 合伙人姓名或订单号或发货单号 51 //partnerOrCode 合伙人姓名或订单号或发货单号
51 -func (dao OrderBaseDao) OrderListByCondition(companyId int64, orderType int, partnerOrCode string, limit, offset int) ([]models.OrderBase, int, error) { 52 +func (dao OrderBaseDao) OrderBonusListByCondition(companyId int64, orderType int, partnerOrCode string, limit, offset int) ([]models.OrderBase, int, error) {
52 tx := dao.transactionContext.GetDB() 53 tx := dao.transactionContext.GetDB()
53 var orders []models.OrderBase 54 var orders []models.OrderBase
54 query := tx.Model(&orders).Where("order_base.company_id=?", companyId) 55 query := tx.Model(&orders).Where("order_base.company_id=?", companyId)
55 if orderType > 0 { 56 if orderType > 0 {
56 query = query.Where("order_base.order_type=?", orderType) 57 query = query.Where("order_base.order_type=?", orderType)
  58 + } else {
  59 + query = query.Where("order_base.order_type<>?", domain.OrderIntention)
57 } 60 }
58 if len(partnerOrCode) > 0 { 61 if len(partnerOrCode) > 0 {
59 query = query.Join("LEFT JOIN partner_info as p ON order_base.partner_id=p.id"). 62 query = query.Join("LEFT JOIN partner_info as p ON order_base.partner_id=p.id").