mirror of
https://github.com/wgh136/nysoure.git
synced 2025-12-16 07:51:14 +00:00
fix
This commit is contained in:
@@ -60,6 +60,7 @@ func init() {
|
|||||||
&model.Activity{},
|
&model.Activity{},
|
||||||
&model.Collection{},
|
&model.Collection{},
|
||||||
&model.CollectionResource{},
|
&model.CollectionResource{},
|
||||||
|
&model.Charactor{},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ func GetUnusedImages() ([]model.Image, error) {
|
|||||||
Where("NOT EXISTS (SELECT 1 FROM resource_images WHERE image_id = images.id)").
|
Where("NOT EXISTS (SELECT 1 FROM resource_images WHERE image_id = images.id)").
|
||||||
Where("NOT EXISTS (SELECT 1 FROM comment_images WHERE image_id = images.id)").
|
Where("NOT EXISTS (SELECT 1 FROM comment_images WHERE image_id = images.id)").
|
||||||
Where("NOT EXISTS (SELECT 1 FROM collection_images WHERE image_id = images.id)").
|
Where("NOT EXISTS (SELECT 1 FROM collection_images WHERE image_id = images.id)").
|
||||||
|
Where("NOT EXISTS (SELECT 1 FROM charactors WHERE image_id = images.id)").
|
||||||
Where("created_at < ?", oneDayAgo).
|
Where("created_at < ?", oneDayAgo).
|
||||||
Find(&images).Error; err != nil {
|
Find(&images).Error; err != nil {
|
||||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||||
|
|||||||
Reference in New Issue
Block a user