TODO: fetch mehtod for sort and filter.

This commit is contained in:
2020-08-24 01:14:36 +08:00
parent 3a987464e6
commit e91995fc65
2 changed files with 21 additions and 19 deletions

View File

@@ -112,13 +112,13 @@ func Query(cxt *gin.Context, platform string) {
ot := &ObjectQuery{}
var view, gratuity sql.NullInt64
var lstm, letm, utm sql.NullTime
var tags, livetitle sql.NullString
var username, tags, livetitle, liveurl sql.NullString
err = rows.Scan(
&ot.Uid,
&ot.Platform,
&ot.UserId,
&ot.UserName,
&ot.LiveUrl,
&username,
&liveurl,
&tags,
&ot.Followers,
&view,
@@ -160,6 +160,14 @@ func Query(cxt *gin.Context, platform string) {
ot.Gratuity = gratuity.Int64
}
if username.Valid {
ot.UserName = username.String
}
if liveurl.Valid {
ot.LiveUrl = liveurl.String
}
if err = json.Unmarshal([]byte(tags.String), &ot.Tags); err != nil {
// log.Println(tags)
}