数据库操作
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

17 lines
428 B

package dbquery
import (
"testing"
)
func Test_Chain(t *testing.T) {
Connect("127.0.0.1", "root", "123456", "shop", "3306")
ret, err := new(Query).Db("shop").Table("ttl_order_product").Alias("op").
Join([]string{"ttl_product as p", "op.product_id=p.id"}).
Title("op.id,op.order_price,p.thumb").WhereOr("op.id =?").WhereOr("op.id = ?").Value(63).Value(64).Debug(true).List()
t.Log(len(ret))
t.Log(ret)
t.Log(err)
}