修复申请代理空指针

This commit is contained in:
2025-06-25 21:36:18 +08:00
parent f39cb4ac2e
commit a71eca725e
3 changed files with 19 additions and 6 deletions

View File

@@ -88,7 +88,7 @@ func (l *ApplyForAgentLogic) ApplyForAgent(req *types.AgentApplyReq) (resp *type
}
// 使用SelectBuilder构建查询查找符合user_id的记录并按创建时间降序排序获取最新一条
builder := l.svcCtx.AgentAuditModel.SelectBuilder().Where("user_id = ?", user.Id).OrderBy("create_time DESC").Limit(1)
builder := l.svcCtx.AgentAuditModel.SelectBuilder().Where("user_id = ?", userID).OrderBy("create_time DESC").Limit(1)
agentAuditList, findAgentAuditErr := l.svcCtx.AgentAuditModel.FindAll(transCtx, builder, "")
if findAgentAuditErr != nil {
return errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "代理申请, 查找审核列表失败%+v", findAgentAuditErr)
@@ -104,7 +104,7 @@ func (l *ApplyForAgentLogic) ApplyForAgent(req *types.AgentApplyReq) (resp *type
}
var agentAudit model.AgentAudit
agentAudit.UserId = user.Id
agentAudit.UserId = userID
agentAudit.Mobile = encryptedMobile
agentAudit.Region = req.Region
agentAudit.Status = 1