MCPcopy Create free account
hub / github.com/cloudreve/cloudreve / CountByTimeRange

Method CountByTimeRange

inventory/user.go:139–144  ·  view source on GitHub ↗
(ctx context.Context, start, end *time.Time)

Source from the content-addressed store, hash-verified

137)
138
139func (c *userClient) CountByTimeRange(ctx context.Context, start, end *time.Time) (int, error) {
140 if start == nil || end == nil {
141 return c.client.User.Query().Count(ctx)
142 }
143 return c.client.User.Query().Where(user.CreatedAtGTE(*start), user.CreatedAtLT(*end)).Count(ctx)
144}
145
146func (c *userClient) UpdateNickname(ctx context.Context, u *ent.User, name string) (*ent.User, error) {
147 return c.client.User.UpdateOne(u).SetNick(name).Save(ctx)

Callers

nothing calls this directly

Calls 5

CreatedAtGTEFunction · 0.92
CreatedAtLTFunction · 0.92
CountMethod · 0.65
QueryMethod · 0.45
WhereMethod · 0.45

Tested by

no test coverage detected