|
@@ -429,7 +429,7 @@ func GetAllUserAttachments(userID int64) ([]*AttachmentUsername, error) { |
|
|
func getModelArtsUserAttachments(e Engine, userID int64) ([]*AttachmentUsername, error) { |
|
|
func getModelArtsUserAttachments(e Engine, userID int64) ([]*AttachmentUsername, error) { |
|
|
attachments := make([]*AttachmentUsername, 0, 10) |
|
|
attachments := make([]*AttachmentUsername, 0, 10) |
|
|
if err := e.Table("attachment").Join("LEFT", "`user`", "attachment.uploader_id "+ |
|
|
if err := e.Table("attachment").Join("LEFT", "`user`", "attachment.uploader_id "+ |
|
|
"= `user`.id").Where("attachment.type = ? and (uploader_id= ? or is_private = ?)", TypeCloudBrainTwo, userID, false).Find(&attachments); err != nil { |
|
|
|
|
|
|
|
|
"= `user`.id").Where("attachment.type = ? and (uploader_id= ? or is_private = ?) and attachment.decompress_state = ?", TypeCloudBrainTwo, userID, false, DecompressStateDone).Find(&attachments); err != nil { |
|
|
return nil, err |
|
|
return nil, err |
|
|
} |
|
|
} |
|
|
return attachments, nil |
|
|
return attachments, nil |
|
|