ch prefix

This commit is contained in:
2026-08-18 00:59:32 +05:00
parent dbb6f7bda9
commit 25e5068c8b
2446 changed files with 393356 additions and 455 deletions

View File

@@ -30,7 +30,7 @@ var sortColumns = map[string]string{
func (r repository) GetAllData(ctx context.Context, params listing.Params) (static.DataStaticDTO, error) {
ns := []static.StaticDTO{}
ns := []static.StaticListItemDTO{}
var (
dt static.DataStaticDTO
err error
@@ -40,16 +40,16 @@ func (r repository) GetAllData(ctx context.Context, params listing.Params) (stat
where := ""
args := []interface{}{}
if params.Search != "" {
where = ` where title::text ILIKE $1 or content_tm ILIKE $1 or content_ru ILIKE $1 or content_en ILIKE $1 `
where = ` where title::text ILIKE $1 `
args = append(args, params.SearchPattern())
}
qC := `select count(*) from static` + where + `;`
r.client.QueryRow(ctx, qC, args...).Scan(&dt.Count)
// List: skip content_* (large HTML). Full body is loaded via GetData.
q := ` select
id, logo, title,
content_tm, content_ru, content_en,
created_at
from static` +
where +
@@ -68,10 +68,9 @@ func (r repository) GetAllData(ctx context.Context, params listing.Params) (stat
defer rows.Close()
for rows.Next() {
var n static.StaticDTO
var n static.StaticListItemDTO
errN := rows.Scan(
&n.Id, &n.Logo, &n.Title,
&n.ContentTm, &n.ContentRu, &n.ContentEn,
&n.CreatedAt,
)
if errN != nil {