|
@@ -43,7 +43,7 @@ func (l *UpdateAgentLogic) UpdateAgent(req *types.AgentInfo) (*types.BaseMsgResp
|
|
|
}
|
|
|
|
|
|
// 如果是下架AI角色,则需要判断是否有账号在关联该AI角色,如果有不让修改
|
|
|
- if item.Status == 1 && *req.Status == 2 {
|
|
|
+ if item.Status == 1 && req.Status != nil && *req.Status == 2 {
|
|
|
count, _ := l.svcCtx.DB.Wx.Query().Where(wx.AgentID(*req.Id)).Count(l.ctx)
|
|
|
if count > 0 {
|
|
|
return nil, errors.New("有账号在使用该AI角色,请取消关联后再尝试禁用")
|