|
@@ -34,7 +34,7 @@ func (gs *GatewayService) CreateIfNotExist(isn string) (*app.Gateway, error) {
|
|
|
}
|
|
|
|
|
|
// List 该用户下所有设备数据
|
|
|
-func (gs *GatewayService) List(req request.GatewayRequest) (list []response.Gateways, err error) {
|
|
|
+func (gs *GatewayService) List(req request.GatewayRequest) (list []response.Gateways, total int64, err error) {
|
|
|
//SELECT g.id,g.name AS gateway_name,g.osn,
|
|
|
// c.`name` AS camera_name, RIGHT(c.sn,9) AS sn,stream_id,stream_url,
|
|
|
// l.device_id AS ls_id,l.`status` AS ls_status
|
|
@@ -65,6 +65,7 @@ func (gs *GatewayService) List(req request.GatewayRequest) (list []response.Gate
|
|
|
db.Offset(req.PageSize * (req.Page - 1)).Limit(req.PageSize)
|
|
|
}
|
|
|
err = db.Debug().Find(&list).Error
|
|
|
+ db.Where("is_deleted = 0").Count(&total)
|
|
|
return
|
|
|
}
|
|
|
|