数据库操作
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

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