@@ -666,6 +666,7 @@ SELECT
|
||||
END AS REAL), 2) AS percentage,
|
||||
CAST(CASE
|
||||
WHEN dus.total_time_seconds IS NULL THEN 0.0
|
||||
WHEN dus.read_percentage IS NULL OR dus.read_percentage <= 0 THEN 0.0
|
||||
ELSE
|
||||
CAST(dus.total_time_seconds AS REAL)
|
||||
/ (dus.read_percentage * 100.0)
|
||||
@@ -679,10 +680,10 @@ WHERE
|
||||
(docs.id = ?2 OR ?2 IS NULL)
|
||||
AND (docs.deleted = ?3 OR ?3 IS NULL)
|
||||
AND (
|
||||
(
|
||||
?4 IS NULL OR (
|
||||
docs.title LIKE ?4 OR
|
||||
docs.author LIKE ?4
|
||||
) OR ?4 IS NULL
|
||||
)
|
||||
)
|
||||
ORDER BY dus.last_read DESC, docs.created_at DESC
|
||||
LIMIT ?6
|
||||
@@ -690,12 +691,12 @@ OFFSET ?5
|
||||
`
|
||||
|
||||
type GetDocumentsWithStatsParams struct {
|
||||
UserID string `json:"user_id"`
|
||||
ID *string `json:"id"`
|
||||
Deleted *bool `json:"-"`
|
||||
Query *string `json:"query"`
|
||||
Offset int64 `json:"offset"`
|
||||
Limit int64 `json:"limit"`
|
||||
UserID string `json:"user_id"`
|
||||
ID *string `json:"id"`
|
||||
Deleted *bool `json:"-"`
|
||||
Query interface{} `json:"query"`
|
||||
Offset int64 `json:"offset"`
|
||||
Limit int64 `json:"limit"`
|
||||
}
|
||||
|
||||
type GetDocumentsWithStatsRow struct {
|
||||
|
||||
Reference in New Issue
Block a user