39 lines
761 B
Go
39 lines
761 B
Go
package database
|
|
|
|
import (
|
|
_ "embed"
|
|
"fmt"
|
|
"os"
|
|
"pet-house.com/core/server/database/scope"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
type otheraccounts struct {
|
|
Id int64
|
|
Accid string
|
|
Apptypeid string
|
|
Unionid string
|
|
Openid string
|
|
Usertype string
|
|
}
|
|
|
|
func TestMain(m *testing.M) {
|
|
|
|
CONFIG.DbName = "pikauser"
|
|
CONFIG.Path = "172.31.65.221:3306"
|
|
CONFIG.Password = "qC#5Lp%9AF=6BmR5Ny!6aaabbb"
|
|
CONFIG.Username = "pikauser_dev"
|
|
|
|
code := m.Run()
|
|
|
|
for i := 1; i <= 10; i++ {
|
|
var account otheraccounts
|
|
Instance().Table("otheraccounts").Model(&otheraccounts{}).Scopes(scope.PaginateScope(i, 1, "desc", "createtime")).Where(" apptypeid = ?", "100001").Find(&account)
|
|
fmt.Println(account.Openid, account.Id)
|
|
time.Sleep(time.Second)
|
|
}
|
|
|
|
os.Exit(code)
|
|
}
|