@@ -22,6 +22,7 @@ type MediumListData struct { | |||||
LegalRepresentative string `json:"legal_representative" example:"法定代表人"` | LegalRepresentative string `json:"legal_representative" example:"法定代表人"` | ||||
Account string `json:"account" example:"媒体账号"` | Account string `json:"account" example:"媒体账号"` | ||||
BusinessLicenseAddress string `json:"business_license_address" example:"营业执照地址"` | BusinessLicenseAddress string `json:"business_license_address" example:"营业执照地址"` | ||||
BusinessLicenseImg string `json:"business_license_img" example:"营业执照图片"` | |||||
} | } | ||||
type MediumListSaveReq struct { | type MediumListSaveReq struct { | ||||
Username string `json:"username"` | Username string `json:"username"` | ||||
@@ -107,7 +107,7 @@ func GetAgentAmount(session *xorm.Session, masterId string, agentId int, isForce | |||||
if err != nil && err.Error() != "redigo: nil returned" { | if err != nil && err.Error() != "redigo: nil returned" { | ||||
return | return | ||||
} | } | ||||
agentListDb := implement.NewAgentListDb(db.DBs[masterId]) | |||||
agentListDb := implement.NewAgentListDb(db.Db) | |||||
agent, err1 := agentListDb.GetAgentListBySession(session, agentId) | agent, err1 := agentListDb.GetAgentListBySession(session, agentId) | ||||
if err1 != nil { | if err1 != nil { | ||||
return amount, err1 | return amount, err1 | ||||
@@ -107,7 +107,7 @@ func GetMediumAmount(session *xorm.Session, masterId string, mediumId int, isFor | |||||
if err != nil && err.Error() != "redigo: nil returned" { | if err != nil && err.Error() != "redigo: nil returned" { | ||||
return | return | ||||
} | } | ||||
mediumListDb := implement.NewMediumListDb(db.DBs[masterId]) | |||||
mediumListDb := implement.NewMediumListDb(db.Db) | |||||
medium, err1 := mediumListDb.GetMediumListBySession(session, mediumId) | medium, err1 := mediumListDb.GetMediumListBySession(session, mediumId) | ||||
if err1 != nil { | if err1 != nil { | ||||
return amount, err1 | return amount, err1 | ||||
@@ -85,7 +85,7 @@ func MediumBindAgentList(c *gin.Context) { | |||||
if data != nil { | if data != nil { | ||||
for _, v := range data { | for _, v := range data { | ||||
tmp := md.MediumListData{ | |||||
tmp1 := md.MediumListData{ | |||||
Id: utils.IntToStr(v.AgentWithMedium.Id), | Id: utils.IntToStr(v.AgentWithMedium.Id), | ||||
MediumId: utils.IntToStr(v.AgentWithMedium.AgentId), | MediumId: utils.IntToStr(v.AgentWithMedium.AgentId), | ||||
CompanyName: v.AgentList.CompanyName, | CompanyName: v.AgentList.CompanyName, | ||||
@@ -94,12 +94,13 @@ func MediumBindAgentList(c *gin.Context) { | |||||
Memo: v.AgentList.Memo, | Memo: v.AgentList.Memo, | ||||
LegalRepresentative: v.AgentList.LegalRepresentative, | LegalRepresentative: v.AgentList.LegalRepresentative, | ||||
BusinessLicenseAddress: v.AgentList.BusinessLicenseAddress, | BusinessLicenseAddress: v.AgentList.BusinessLicenseAddress, | ||||
BusinessLicenseImg: v.AgentList.BusinessLicenseImgUrl, | |||||
} | } | ||||
agent := NewAgentDb.GetSuperAdmin(v.AgentWithMedium.AgentId) | agent := NewAgentDb.GetSuperAdmin(v.AgentWithMedium.AgentId) | ||||
if agent != nil { | if agent != nil { | ||||
tmp.Account = agent.Username | |||||
tmp1.Account = agent.Username | |||||
} | } | ||||
list = append(list, tmp) | |||||
list = append(list, tmp1) | |||||
} | } | ||||
} | } | ||||
res := md.MediumListRes{ | res := md.MediumListRes{ | ||||
@@ -281,7 +282,7 @@ func GetAgentInfo(c *gin.Context, mediumId int) map[string]string { | |||||
"name": "", | "name": "", | ||||
} | } | ||||
NewAgentDb := implement2.NewAgentDb(MasterDb(c)) | NewAgentDb := implement2.NewAgentDb(MasterDb(c)) | ||||
NewAgentListDb := implement.NewAgentListDb(MasterDb(c)) | |||||
NewAgentListDb := implement.NewAgentListDb(db.Db) | |||||
medium := NewAgentDb.GetSuperAdmin(mediumId) | medium := NewAgentDb.GetSuperAdmin(mediumId) | ||||
if medium != nil { | if medium != nil { | ||||
res["account"] = medium.Username | res["account"] = medium.Username | ||||