Database Queries

总计4条数据
TimeDurationTypeQuery
  
09:49:44.0122.2 msSELECTSELECT * FROM "global"."vw_user_login" WHERE "id"=1001

09:49:44.0161.5 msSELECTSELECT * FROM "a57be577deb434"."tbl_users" WHERE "id"=1001

09:49:44.03817.3 msSELECTSELECT DISTINCT "s".*, sum(pc.total_amount) as total_amount, sum(pc.collected) as collected, sum(pc.total_amount) - sum(pc.collected) as un_collected, sum(pc.invoiced) as invoiced, sum(pc.total_amount) - sum(pc.invoiced) as un_invoiced FROM "a57be577deb434"."tbl_suppliers" "s" LEFT JOIN (SELECT pc.supplier_id, sum(pc.amount) as total_amount, sum(case when pcp.collected is not null then pcp.collected else 0 end) as collected, sum(case when pci.invoiced is not null then pci.invoiced else 0 end) as invoiced FROM "a57be577deb434"."tbl_purchase_contracts" "pc" LEFT JOIN (SELECT "contract_id", sum(amount) as collected FROM ((SELECT '1' || r.id::varchar as id, 1 as ticket_type, r.purchase_contract_id as contract_id, r.amount as amount, t.created_at::timestamp without time zone as collected_date, t.created_at, t.created_by, t.abstract as description FROM "a57be577deb434"."tbl_erp_payment_ticket_settles" "r" LEFT JOIN "a57be577deb434"."tbl_erp_payment_tickets" "t" ON r.erp_payment_ticket_id = t.id WHERE "t"."status" IN (2, 5, 1)) UNION ALL ( SELECT '2' || r.id::varchar as id, 2 as ticket_type, r.purchase_contract_id as contract_id, r.amount as amount, t.created_at::timestamp without time zone as collected_date, t.created_at, t.created_by, t.abstract as description FROM "a57be577deb434"."tbl_erp_other_income_ticket_purchase_contract_settles" "r" LEFT JOIN "a57be577deb434"."tbl_erp_other_income_tickets" "t" ON r.erp_other_income_ticket_id = t.id WHERE "t"."status" IN (2, 5, 1) ) UNION ALL ( SELECT '3' || r.id::varchar as id, 3 as ticket_type, r.purchase_contract_id as contract_id, r.amount as amount, t.created_at::timestamp without time zone as collected_date, t.created_at, t.created_by, t.abstract as description FROM "a57be577deb434"."tbl_erp_cash_cost_ticket_purchase_contract_settles" "r" LEFT JOIN "a57be577deb434"."tbl_erp_cash_cost_tickets" "t" ON r.erp_cash_cost_ticket_id = t.id WHERE "t"."status" IN (2, 5, 1) ) UNION ALL ( SELECT '4' || r.id::varchar as id, 4 as ticket_type, r.purchase_contract_id as contract_id, 0 - r.amount as amount, t.created_at::timestamp without time zone as collected_date, t.created_at, t.created_by, t.abstract as description FROM "a57be577deb434"."tbl_erp_collect_ticket_settles" "r" LEFT JOIN "a57be577deb434"."tbl_erp_collect_tickets" "t" ON r.erp_collect_ticket_id = t.id WHERE "t"."status" IN (2, 5, 1) )) "sub" GROUP BY "contract_id") "pcp" ON pcp.contract_id = pc.id LEFT JOIN (SELECT "contract_id", sum(amount) as invoiced FROM "a57be577deb434"."tbl_purchase_contract_invoices" GROUP BY "contract_id") "pci" ON pci.contract_id = pc.id WHERE ("is_chargeback"=FALSE) AND (pc.is_draft = false) AND (pc.is_refuse = false) GROUP BY "pc"."supplier_id") "pc" ON pc.supplier_id = s.id WHERE "s"."id" IS NULL GROUP BY "s"."id"

09:49:44.0571.3 msINSERTINSERT INTO "global"."tbl_api_log" ("code", "schema", "user_id", "device_type", "url", "request", "response", "php_error", "time") VALUES (200, 'a57be577deb434', 1001, 5, 'vue/supplier/get-edit', '[]', '{"code":500,"result":{},"status":0,"msg":[{"name":"error","success":"","error":"\u60a8\u8bbf\u95ee\u7684\u4f9b\u5e94\u5546\u5df2\u4e0d\u5b58\u5728"}],"mod":0}', FALSE, '2025-08-10 09:49:44') RETURNING "id"