作者 唐旭辉

bug 修复

... ... @@ -45,7 +45,7 @@ func (PartnerInfoService *PartnerInfoService) CreatePartnerInfo(cmd *command.Cre
}); err != nil {
return nil, lib.ThrowError(lib.TRANSACTION_ERROR, err.Error())
}
ok, err := partnerinfoDao.PartnerAccountExist(cmd.Account)
ok, err := partnerinfoDao.PartnerAccountExist(cmd.Account, cmd.CompanyId)
if err != nil {
return nil, lib.ThrowError(lib.TRANSACTION_ERROR, err.Error())
}
... ...
... ... @@ -93,6 +93,7 @@ func (pay BusinessBonusNullPay) NullPayPartnerBonus(bonus *BusinessBonus) error
func (pay BusinessBonusNullPay) WartPayPartnerBonus(bonus *BusinessBonus) error {
bonus.BonusNot = bonus.Bonus
bonus.BonusStatus = BUSINESS_BONUS_WAIT_PAY
bonus.BonusHas = 0
return nil
}
... ... @@ -115,6 +116,7 @@ func (pay BusinessBonusWaitPay) NullPayPartnerBonus(bonus *BusinessBonus) error
func (pay BusinessBonusWaitPay) WartPayPartnerBonus(bonus *BusinessBonus) error {
bonus.BonusNot = bonus.Bonus
bonus.BonusStatus = BUSINESS_BONUS_WAIT_PAY
bonus.BonusHas = 0
return nil
}
... ... @@ -137,6 +139,7 @@ func (pay BusinessBonusHasPay) NullPayPartnerBonus(bonus *BusinessBonus) error {
func (pay BusinessBonusHasPay) WartPayPartnerBonus(bonus *BusinessBonus) error {
bonus.BonusNot = bonus.Bonus
bonus.BonusStatus = BUSINESS_BONUS_WAIT_PAY
bonus.BonusHas = 0
return nil
}
... ...
... ... @@ -21,11 +21,12 @@ func NewPartnerInfoDao(transactionContext *transaction.TransactionContext) (*Par
}
}
func (dao PartnerInfoDao) PartnerAccountExist(account string) (bool, error) {
func (dao PartnerInfoDao) PartnerAccountExist(account string, companyId int64) (bool, error) {
tx := dao.transactionContext.PgDd
m := &models.PartnerInfo{}
ok, err := tx.Model(m).
Where("account=?", account).
Where("company_id=?", companyId).
Exists()
return ok, err
... ...