beego框架mysql按条件筛选
query := oquery.NewQueryStructOfTable()
cond := orm.NewCondition()
cond1 := cond.And(“Name”+""+oquery.OP_I_CONTAINS,
roleName).Or(“Alias”+""+oquery.OP_I_CONTAINS,
roleName).Or(“Comments”+"__"+oquery.OP_I_CONTAINS,
roleName)
query.AddCustomCondition(cond1)
// order
query.AddOrders(oquery.Order{Name: “ID”, IsASC: true})
dataCnt, _ = roleCreate.GetCountByQuery(query)
go语言申明或定义一个数组
var newStr []string <===> newStr := make([]string,0)
https://studygolang.com/articles/4559
golang 将A字母变为B字母的操作
A := "A"
x := []rune(A)
for index := range x {
x[index] = x[index] + 1
}
olog.Info("===========kkk============")
olog.Info([]rune(A))
olog.Info(string(x))
olog.Info("===========kkk============")
https://blog.csdn.net/qq_33296108/article/details/85852919
Go语言中byte和rune实质上就是uint8和int32类型。byte用来强调数据是raw data(原始数据),而不是数字;而rune用来表示Unicode(统一字符编码ASC编码)的code point。
func GetExcelCol(colIndex int)(colPos string){
x := []rune("A")
for index := range x {
x[index] = x[index] + rune(colIndex)
}
colPos = string(x)
return
}
https://blog.csdn.net/qlql489/article/details/82780716
https://www.cnblogs.com/sunsky303/p/9764910.html
不同类型的数据不同的处理存入interface{}中
for rowIndex, item := range chartsData {
var dataSlice []interface{
}
getValue := reflect.ValueOf(&item).Elem()
for _, v := range