Пример #1
0
func (p *Employee) SetupCriteria(cbx *cb.EmployeeCB, data map[string]interface{}) {
	if data == nil {
		return
	}
	criteria := data["criteria"]
	if criteria == nil {
		return
	}
	cr := criteria.([]interface{})
	for _, each := range cr {
		emap := each.(map[string]interface{})
		fn := emap["fieldName"].(string)
		if fn == "s1Data" {
			dfweb.SetCriteria(cbx.Query().QueryUserTable(), emap, "UserTable")
		} else {
			dfweb.SetCriteria(cbx.Query(), emap, "Employee")
		}
	}
}
Пример #2
0
func (p *SysTable) SetupCriteria(cbx *cb.SysTableCB, data map[string]interface{}) {
	if data == nil {
		return
	}
	criteria := data["criteria"]
	if criteria == nil {
		return
	}
	cr := criteria.([]interface{})
	for _, each := range cr {
		emap := each.(map[string]interface{})
		dfweb.SetCriteria(cbx.Query(), emap, "SysTable")
	}
}
Пример #3
0
func (p *TestTable) SetupCriteria(cbx *cb.TestTableCB, data map[string]interface{}) {
	if data == nil {
		return
	}
	maxRecord := data["maxRecord"]
	if maxRecord != nil {
		cbx.FetchFirst(int((dfweb.ConvFromWebDataInd(maxRecord, "int64")).(int64)))
	}
	criteria := data["criteria"]
	if criteria == nil {
		return
	}
	cr := criteria.([]interface{})
	for _, each := range cr {
		emap := each.(map[string]interface{})
		dfweb.SetCriteria(cbx.Query(), emap, "TestTable")
	}
}