Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [2019-05-24 07:54:57] local.DEBUG: array (
- 0 =>
- array (
- 'query' => 'WITH reservations AS (select "id", "payment_method", "created_by", "store_id", cancel_fee AS total_points, false AS is_confirmed, 0 AS delay_option_total_points, 0 AS web_cash_service_fee, CEIL(cancel_fee * point_service_fee / 100) AS point_service_fee from "reservations" where "payment_method" = ? and "cancel_fee" > ? and "cancelled_at" >= ? and "cancelled_at" < ? union all select "id", "payment_method", "created_by", "store_id", (total_points - delay_option_total_points) AS total_point, true AS is_confirmed, 0 AS delay_option_total_points, web_service_fee AS web_cash_service_fee, resv_point_fee AS point_service_fee from "reservations" where "confirm_start_at" >= ? and "confirm_start_at" < ? and "deleted_at" is null and "reservations"."deleted_at" is null union all select "reservations"."id", "reservations"."payment_method", "reservations"."created_by", "reservations"."store_id", 0 AS total_points, false AS is_confirmed, SUM(reservation_delay_options.total_price) AS delay_option_total_points, 0 AS web_cash_service_fee, SUM(reservation_delay_options.total_point_fee) AS point_service_fee from "reservations" left join "reservation_delay_options" on "reservations"."id" = "reservation_delay_options"."reservation_id" where "reservation_delay_options"."status" = ? and "reservation_delay_options"."payment_method" = ? and "reservation_delay_options"."approved_at" >= ? and "reservation_delay_options"."approved_at" < ? and "reservation_delay_options"."deleted_at" is null and "reservations"."deleted_at" is null group by "reservations"."id" union all select "id", \'point\' as payment_method, \'store\' as created_by, store_id as store_id, (CASE WHEN status = ? THEN ? ELSE amount END) as total_points, false as is_confirmed, 0 as delay_option_total_points, 0 AS web_cash_service_fee, (CASE WHEN status = ? THEN 0 ELSE service_amount END) as point_service_fee from "payment_codes" where "payment_codes"."created_by" = ? and "payment_codes"."status" in (?, ?, ?) and "created_at" >= ? and "created_at" < ?) select "stores"."id", "stores"."bank_code", "stores"."bank_name", "stores"."bank_branch_code", "stores"."bank_branch_name", "stores"."bank_account_code", "stores"."bank_account_name", (CASE
- WHEN stores.bank_account_type = ? THEN 1
- WHEN stores.bank_account_type = ? THEN 2
- WHEN stores.bank_account_type = ? THEN 4
- WHEN stores.bank_account_type = ? THEN 9
- END) AS bank_account_type,
- SUM(reservations.web_cash_service_fee)
- FILTER (WHERE reservations.payment_method = ?
- AND reservations.created_by IN (?, ?)
- AND reservations.is_confirmed
- ) AS total_web_cash_service_fee, SUM(reservations.total_points) AS total_points, SUM(reservations.delay_option_total_points) AS delay_option_total_points, SUM(reservations.point_service_fee) AS total_point_service_fee from "stores" left join "reservations" on "stores"."id" = "reservations"."store_id" where "stores"."bank_account_code" is not null and "stores"."deleted_at" is null group by "stores"."id"',
- 'bindings' =>
- array (
- 0 => 'point',
- 1 => 0,
- 2 => 1556654400,
- 3 => 1558382400,
- 4 => 1556654400,
- 5 => 1558382400,
- 6 => 'approved',
- 7 => 'point',
- 8 => 1556654400,
- 9 => 1558382400,
- 10 => 'approved_refund',
- 11 => -200,
- 12 => 'approved_refund',
- 13 => 'normal',
- 14 => 'complete',
- 15 => 'request_refund',
- 16 => 'approved_refund',
- 17 => 1556654400,
- 18 => 1558382400,
- 19 => 'normal',
- 20 => 'deposit',
- 21 => 'savings',
- 22 => 'other',
- 23 => 'cash',
- 24 => 'user',
- 25 => 'admin',
- ),
- 'time' => 80.24,
- ),
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement