This commit is contained in:
root committed 2018-05-25 17:26:29 +08:00
1 parent 59df5ce6a1
commit 70d8971e64
4 files changed
+32 -5

No files matched your search

+2 -2
View File
@@ -32,8 +32,8 @@ func GetPhotos(album string) (photo []Photo, err error) {
}
// GetPhoto -
func GetPhoto(id string) (photo *Photo, err error) {
rows, err := x.Query(`select "id", "album", "name", "thumbnail", "ctime", "mtime" from "storage"."photo" where "id" = $1`, id)
func GetPhoto(album, id string) (photo *Photo, err error) {
rows, err := x.Query(`select "id", "album", "name", "thumbnail", "ctime", "mtime" from "storage"."photo" where "album" = $1 and "id" = $2`, album, id)
if err != nil {
return nil, err
}