- handle store.Status.
This commit is contained in:
@@ -48,6 +48,8 @@ type DaoDB struct {
|
||||
// return err
|
||||
// }
|
||||
|
||||
// beego orm的对于传代表字段的字串,数据库字段名(完全匹配,区分大小写),结构体字段名(不区分大小写)都可以
|
||||
|
||||
func GetDB() *DaoDB {
|
||||
return &DaoDB{db: orm.NewOrm()}
|
||||
}
|
||||
|
||||
@@ -40,3 +40,21 @@ func TestGetPlaceByName(t *testing.T) {
|
||||
}
|
||||
t.Log(result)
|
||||
}
|
||||
|
||||
func TestUpdateKV(t *testing.T) {
|
||||
dummy := &model.Store{}
|
||||
kvs := map[string]interface{}{
|
||||
"status": 100,
|
||||
"Tel1": "tel1",
|
||||
"tEl2": "tel2",
|
||||
"deliverY_Range_type": 15,
|
||||
}
|
||||
cond := map[string]interface{}{
|
||||
"id": 100002,
|
||||
}
|
||||
num, err := UpdateEntityByKV(nil, dummy, kvs, cond)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log(num)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user