Changes between Version 2 and Version 3 of AdvancedReports


Ignore:
Timestamp:
05/25/26 15:34:19 (9 hours ago)
Author:
181201
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AdvancedReports

    v2 v3  
    2929),
    3030
    31 sitter_financials AS (
     31sitter_reports AS (
    3232    SELECT
    3333        b.sitter_id,
     
    8383JOIN pet_sitters ps ON u.user_id = ps.user_id
    8484LEFT JOIN sitter_stats ss ON ss.sitter_id = ps.user_id
    85 LEFT JOIN sitter_financials sf ON sf.sitter_id = ps.user_id
     85LEFT JOIN sitter_reports sf ON sf.sitter_id = ps.user_id
    8686LEFT JOIN sitter_ratings sr ON sr.sitter_id = ps.user_id
    8787WHERE COALESCE(ss.total_bookings, 0) > 0
     
    106106)
    107107
    108 SitterFinancials <-
     108SitterReports <-
    109109γ
    110110  sitter_id := b.sitter_id;
     
    135135  (
    136136    (SitterBase ⟕ (u.user_id = ss.sitter_id) SitterStats ss)
    137     ⟕ (u.user_id = sf.sitter_id) SitterFinancials sf
     137    ⟕ (u.user_id = sf.sitter_id) SitterReports sf
    138138  )
    139139  ⟕ (u.user_id = sr.sitter_id) SitterRatings sr
     
    195195),
    196196
    197 owner_financials AS (
     197owner_reports AS (
    198198    SELECT
    199199        b.owner_id,
     
    263263FROM users u
    264264JOIN pet_owners po ON u.user_id = po.user_id
    265 LEFT JOIN owner_financials ofin ON po.user_id = ofin.owner_id
     265LEFT JOIN owner_reports ofin ON po.user_id = ofin.owner_id
    266266LEFT JOIN owner_activity oa ON po.user_id = oa.owner_id
    267267LEFT JOIN favorite_service fs ON po.user_id = fs.owner_id
     
    276276Params <- {(start_date, end_date)}
    277277
    278 OwnerFinancials <-
     278OwnerReports <-
    279279γ
    280280  owner_id := b.owner_id;
     
    338338  (
    339339    (
    340       (OwnerBase ⟕ (u.user_id = ofin.owner_id) OwnerFinancials ofin)
     340      (OwnerBase ⟕ (u.user_id = ofin.owner_id) OwnerReports ofin)
    341341      ⟕ (u.user_id = oa.owner_id) OwnerActivity oa
    342342    )