如何计算每个用户并在Codeigniter中返回数组

时间:2019-06-09 04:34:38

标签: php database codeigniter

Image Database here

我有这样的数据库,想要返回:

id_user : 5c348f8041dc5 have 2  
id_user : 5cfc8a7d33a12 have 1

该怎么做或我应该寻找的教程名称?

谢谢。

1 个答案:

答案 0 :(得分:1)

您正在寻找struct ContentView : View { var horizontalSpacing: CGFloat = 48 var verticalSpacing: CGFloat = 48 var body: some View { GeometryReader { geometry in Path { path in let numberOfHorizontalGridLines = Int(geometry.size.height / self.verticalSpacing) let numberOfVerticalGridLines = Int(geometry.size.width / self.horizontalSpacing) for index in 0...numberOfVerticalGridLines { let vOffset: CGFloat = CGFloat(index) * self.horizontalSpacing path.move(to: CGPoint(x: vOffset, y: 0)) path.addLine(to: CGPoint(x: vOffset, y: geometry.size.height)) } for index in 0...numberOfHorizontalGridLines { let hOffset: CGFloat = CGFloat(index) * self.verticalSpacing path.move(to: CGPoint(x: 0, y: hOffset)) path.addLine(to: CGPoint(x: geometry.size.width, y: hOffset)) } } .stroke() } } } COUNT语句。

https://www.codeigniter.com/user_guide/database/query_builder.html

group_by

结果:

enter image description here