This commit is contained in:
Jay
2018-05-25 17:26:29 +08:00
parent 59df5ce6a1
commit 70d8971e64
4 changed files with 32 additions and 5 deletions
+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
}