From a7cb7cf8cfade7bdf0dd290f142ad31104047b97 Mon Sep 17 00:00:00 2001 From: Jay Date: Wed, 22 May 2019 23:25:25 +0800 Subject: [PATCH] fix query --- model/instagram.go | 8 ++++---- router/private/private.go | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/model/instagram.go b/model/instagram.go index 8af8164..6b02489 100644 --- a/model/instagram.go +++ b/model/instagram.go @@ -61,14 +61,14 @@ func (p *Instagram) UpdatePost(postID string) (err error) { // GetGroups - func (p *Instagram) GetGroups() (err error) { - query := `select g.*, rt.tmpl as tmpl from "public"."facebook_page" p - left join "public"."line_fb_rt" rt - on rt."facebook" = p.id + query := `select g.*, rt.tmpl as tmpl from "public"."instagram" p + left join "public"."line_ig_rt" rt + on rt."ig" = p.id left join "public"."line_group" g on g.id = rt."line" where p.id = $1 - and rt.facebook is not null` + and rt.ig is not null` err = x.Select(&p.Groups, query, p.ID) return } diff --git a/router/private/private.go b/router/private/private.go index ec8ff3b..c5b1209 100644 --- a/router/private/private.go +++ b/router/private/private.go @@ -163,6 +163,7 @@ func UpdateInstagramPost(c *context.Context) { err = ig.GetGroups() if err != nil { + fmt.Println("get group err :: ", err) continue }