2022-08-22 01:36:13 +00:00
|
|
|
package main
|
|
|
|
|
2022-08-27 13:21:05 +00:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"github/fthvgb1/wp-go/db"
|
|
|
|
"github/fthvgb1/wp-go/models"
|
|
|
|
"github/fthvgb1/wp-go/vars"
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
2022-08-28 14:08:16 +00:00
|
|
|
err := vars.InitConfig()
|
2022-08-27 13:21:05 +00:00
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
err = db.InitDb()
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
}
|
2022-08-22 01:36:13 +00:00
|
|
|
|
|
|
|
func main() {
|
2022-08-29 04:10:10 +00:00
|
|
|
T, t, err := models.WpPostsM.SimplePagination(nil, "wp_posts.ID,b.meta_id post_author", 4, 2, nil, models.SqlBuilder{{
|
|
|
|
"left join", "wp_postmeta b", "b.post_id=wp_posts.ID",
|
|
|
|
}})
|
2022-08-27 13:21:05 +00:00
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
2022-08-29 04:10:10 +00:00
|
|
|
fmt.Println(T, t)
|
2022-08-22 01:36:13 +00:00
|
|
|
}
|