| | |
| | | if params.BaseOperationType != 0 { |
| | | detailsSearch.Orm = detailsSearch.Orm.Where("base_operation_type = ?", params.BaseOperationType) |
| | | } |
| | | var t int64 |
| | | err = detailsSearch.Orm.Count(&t).Error |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, fmt.Errorf("查询总条数失败: %v", err)) |
| | | return |
| | | } |
| | | total = uint64(t) |
| | | if params.Page*params.PageSize > 0 { |
| | | detailsSearch.Orm = detailsSearch.Orm.Offset((params.Page - 1) * params.PageSize).Limit(params.PageSize) |
| | | } |
| | | err = detailsSearch.Orm.Find(&result).Error |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, fmt.Errorf("查询操作明细失败: %v", err)) |