|
|
@ -284,7 +284,7 @@ func GetData(dbName, table string, title string, where map[string]string, limit |
|
|
|
* @param dbName 数据表名 |
|
|
|
* @param title 查询字段名 |
|
|
|
*/ |
|
|
|
func GetRow(dbName, table_name, alias string, titles string, join [][]string, where, where_or []string, valueList []interface{}, orderby string, debug bool) (int, map[string]string, error) { |
|
|
|
func GetRow(dbName, table_name, alias string, titles string, join [][]string, where, where_or []string, valueList []interface{}, orderby, gruopby string, debug bool) (int, map[string]string, error) { |
|
|
|
var count int = 0 |
|
|
|
info := make(map[string]string) |
|
|
|
|
|
|
@ -334,7 +334,9 @@ func GetRow(dbName, table_name, alias string, titles string, join [][]string, wh |
|
|
|
sql_str = helper.StringJoin(sql_str, strings.Join(where_or, " or ")) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if gruopby != "" { |
|
|
|
sql_str = helper.StringJoin(sql_str, " gruop by ", gruopby) |
|
|
|
} |
|
|
|
if orderby != "" { |
|
|
|
sql_str = helper.StringJoin(sql_str, " order by ", orderby) |
|
|
|
} |
|
|
@ -422,7 +424,7 @@ func GetRow(dbName, table_name, alias string, titles string, join [][]string, wh |
|
|
|
* @param dbName 数据表名 |
|
|
|
* @param title 查询字段名 |
|
|
|
*/ |
|
|
|
func FetchRows(dbName, table_name, alias string, titles string, join [][]string, where, where_or []string, valueList []interface{}, orderby string, page int, page_size int, debug bool) (int, []map[string]string, error) { |
|
|
|
func FetchRows(dbName, table_name, alias string, titles string, join [][]string, where, where_or []string, valueList []interface{}, orderby, gruopby string, page int, page_size int, debug bool) (int, []map[string]string, error) { |
|
|
|
var count int = 0 |
|
|
|
list := make([]map[string]string, 0) |
|
|
|
|
|
|
@ -473,7 +475,9 @@ func FetchRows(dbName, table_name, alias string, titles string, join [][]string, |
|
|
|
sql_str = helper.StringJoin(sql_str, strings.Join(where_or, " or ")) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if gruopby != "" { |
|
|
|
sql_str = helper.StringJoin(sql_str, " gruop by ", gruopby) |
|
|
|
} |
|
|
|
if orderby != "" { |
|
|
|
sql_str = helper.StringJoin(sql_str, " order by ", orderby) |
|
|
|
} |
|
|
|