beego循环遍历的问题 求解答

wangge · · 801 次点击
```golang o := orm.NewOrm() // 查询全部记录 var students = make([]*models.IpayUserPay, 0, 1<<5) type IpayUserPayWithExtra struct{ *models.IpayUserPay Cardno2 interface{} } _, qs := o.QueryTable("ipay_user_pay").Filter("Userid",intid).All(&students) var studentsExtra = make([]*IpayUserPayWithExtra, 0, len(students)) for k := range students { studentsExtra = append(studentsExtra, &IpayUserPayWithExtra{ IpayUserPay: students[k], Cardno2: students[k].Cardno[:4], }) } ```
#1
更多评论
万分感谢,虽然有些还看不懂但是可先用上,以后慢慢理解
#2