|
|
|
@ -221,15 +221,14 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// QueryDefault 查询列表 |
|
|
|
// List 查询列表 |
|
|
|
func (obj *${tableNameLower}Q) List(ctx context.Context, value interface{}) (int64, error) { |
|
|
|
var cnt int64 |
|
|
|
obj.Query(ctx).Offset(-1).Find(value).Count(&cnt) |
|
|
|
err := obj.Query(ctx).Order("update_time desc").Find(value).Error |
|
|
|
err := obj.Query(ctx).Order("update_time desc").Find(value).Offset(-1).Count(&cnt).Error |
|
|
|
return cnt, err |
|
|
|
} |
|
|
|
|
|
|
|
//QueryDefault 查询单个 |
|
|
|
//One 查询单个 |
|
|
|
func (obj *${tableNameLower}Q) One(ctx context.Context, value interface{}) error { |
|
|
|
Q := obj.Query(ctx) |
|
|
|
cache_key := "" |
|
|
|
|