- basic cms structure.
This commit is contained in:
36
business/model/dao/dao_test.go
Normal file
36
business/model/dao/dao_test.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
"git.rosy.net.cn/jx-callback/globals/beegodb"
|
||||
"git.rosy.net.cn/jx-callback/globals/gormdb"
|
||||
"github.com/astaxie/beego"
|
||||
)
|
||||
|
||||
func init() {
|
||||
beego.InitBeegoBeforeTest("/Users/xujianhua/go/src/git.rosy.net.cn/jx-callback/conf/app.conf")
|
||||
// beego.BConfig.RunMode = "dev" // InitBeegoBeforeTest会将runmode设置为test
|
||||
|
||||
globals.Init()
|
||||
beegodb.Init()
|
||||
gormdb.Init()
|
||||
api.Init()
|
||||
}
|
||||
|
||||
func TestSelectEntities(t *testing.T) {
|
||||
places := []*model.Place{}
|
||||
GetRows(nil, &places, `
|
||||
SELECT DISTINCT t3.*
|
||||
FROM sku_name_place_bind t1
|
||||
JOIN place t2 ON t1.place_code = t2.code
|
||||
JOIN place t3 ON (t2.level = 2 AND t2.code = t3.code) OR (t2.level = 1 AND t2.code = t3.parent_code)
|
||||
WHERE t1.sku_name_id = ?
|
||||
`, 40)
|
||||
|
||||
globals.SugarLogger.Debug(utils.Format4Output(places, false))
|
||||
}
|
||||
Reference in New Issue
Block a user