|
|
@@ -50,7 +50,7 @@ func (p *businessContactService) GetList(req *projModel.BusinessContactSearchReq
|
|
|
"case when bus.contact_type ='10' then cust.cuct_name when bus.contact_type ='20' then dist.name end as cuct_name," +
|
|
|
"case when bus.contact_type ='10' then cust.postion when bus.contact_type ='20' then dist.post end as postion," +
|
|
|
"case when bus.contact_type ='10' then cust.telephone when bus.contact_type ='20' then dist.phone end as telephone," +
|
|
|
- "case when bus.contact_type ='10' then cust.wechat when bus.contact_type ='20' then dist.name end as wechat," +
|
|
|
+ "case when bus.contact_type ='10' then cust.wechat when bus.contact_type ='20' then dist.wechat end as wechat," +
|
|
|
"case when bus.contact_type ='10' then cust.email when bus.contact_type ='20' then dist.mail end as email," +
|
|
|
"case when bus.contact_type ='10' then cust.office_location when bus.contact_type ='20' then dist.territory end as office_location"
|
|
|
err = db.Fields(fields).Page(req.GetPage()).Order("bus.id desc").Scan(&contactList)
|
|
|
@@ -94,7 +94,7 @@ func (p *businessContactService) Create(req *projModel.BusinessContactReq) (err
|
|
|
updateBusData[projDao.ProjBusiness.C.ContactId] = info.Id
|
|
|
updateBusData[projDao.ProjBusiness.C.ContactName] = info.CuctName
|
|
|
updateBusData[projDao.ProjBusiness.C.ContactPostion] = info.Postion
|
|
|
- updateBusData[projDao.ProjBusiness.C.ContactTelephone] = info.Telephone + "/" + info.Wechat
|
|
|
+ updateBusData[projDao.ProjBusiness.C.ContactTelephone] = info.Telephone + " / " + info.Wechat
|
|
|
}
|
|
|
if busInfo.DealerSalesId == 0 && req.ContactType == "20" {
|
|
|
distSrv, _ := base.NewBaseDistributorContactService(p.Ctx)
|
|
|
@@ -104,7 +104,7 @@ func (p *businessContactService) Create(req *projModel.BusinessContactReq) (err
|
|
|
}
|
|
|
updateBusData[projDao.ProjBusiness.C.DealerSalesId] = info.Id
|
|
|
updateBusData[projDao.ProjBusiness.C.DealerSalesName] = info.Name
|
|
|
- updateBusData[projDao.ProjBusiness.C.DealerSalesContact] = info.Phone + "/" + info.Wechat
|
|
|
+ updateBusData[projDao.ProjBusiness.C.DealerSalesContact] = info.Phone + " / " + info.Wechat
|
|
|
}
|
|
|
|
|
|
err = p.Dao.Transaction(context.TODO(), func(ctx context.Context, tx *gdb.TX) error {
|
|
|
@@ -159,7 +159,7 @@ func (p *businessContactService) DeleteByIds(req *projModel.DeleteBusinessContac
|
|
|
for _, item := range list {
|
|
|
if item.ContactType == "10" {
|
|
|
if item.ContactId == busInfo.ContactId && delIds.Contains(item.Id) {
|
|
|
- updateBusData[projDao.ProjBusiness.C.ContactId] = ""
|
|
|
+ updateBusData[projDao.ProjBusiness.C.ContactId] = 0
|
|
|
updateBusData[projDao.ProjBusiness.C.ContactName] = ""
|
|
|
updateBusData[projDao.ProjBusiness.C.ContactPostion] = ""
|
|
|
updateBusData[projDao.ProjBusiness.C.ContactTelephone] = ""
|
|
|
@@ -169,7 +169,7 @@ func (p *businessContactService) DeleteByIds(req *projModel.DeleteBusinessContac
|
|
|
}
|
|
|
if item.ContactType == "20" {
|
|
|
if item.ContactId == busInfo.DealerSalesId && delIds.Contains(item.Id) {
|
|
|
- updateBusData[projDao.ProjBusiness.C.DealerSalesId] = ""
|
|
|
+ updateBusData[projDao.ProjBusiness.C.DealerSalesId] = 0
|
|
|
updateBusData[projDao.ProjBusiness.C.DealerSalesName] = ""
|
|
|
updateBusData[projDao.ProjBusiness.C.DealerSalesContact] = ""
|
|
|
} else {
|