Database Queries

总计62条数据
TimeDurationTypeQuery
  
16:29:35.5752.8 msSELECTSELECT * FROM "global"."vw_user_login" WHERE "access_token"='gIBfXHaGAAjf2tBIfgqsDfRNPly9E9om'

16:29:35.5781.4 msSELECTSELECT * FROM "a57be577deb434"."tbl_users" WHERE "id"=1000

16:29:35.58815.8 msSELECTSELECT COUNT(*) FROM (SELECT c.*, abs(c.expire_date - current_date) AS b_date, CASE WHEN c.expire_date IS NULL THEN 1 ELSE 2 END AS passed FROM "a57be577deb434"."tbl_sales_contracts" "c" LEFT JOIN "a57be577deb434"."tbl_clients" "client" ON client.id = c.client_id LEFT JOIN "a57be577deb434"."tbl_projects" "p" ON p.id = c.from_project LEFT JOIN "a57be577deb434"."tbl_sales_group_relationships" "sgr" ON sgr.sales_id = client.sales_rep LEFT JOIN "a57be577deb434"."tbl_attachement_relationships" "cs" ON cs.object_id = c.id AND cs.object_type = 105 LEFT JOIN "a57be577deb434"."tbl_attachement_relationships" "rs" ON rs.object_id = c.id AND rs.object_type = 106 LEFT JOIN "a57be577deb434"."tbl_attachement_relationships" "vs" ON vs.object_id = c.id AND vs.object_type = 107 WHERE (true) AND (("client"."sales_rep" IN (5049, 5301, 5022, 5209, 5026, 5293, 5309, 5356, 5329, 5299, 5303, 5302, 5332, 5047, 1026, 5096, 5070, 5448, 5420, 1029, 1001, 5037, 5087, 1008, 5048, 5043, 5045, 5230, 5031, 5088, 5208, 1003, 5294, 5357, 5044, 1030, 5076, 5300, 5027, 5089, 5311, 5066, 5069, 5364, 1009, 5295, 1013, 5128, 5203, 1025, 5032, 5075, 1004, 5072, 5033, 5359, 5409, 5412, 5229, 1005, 5304, 5449, 5358, 1006, 5093)) OR ("client"."sales_rep" IS NULL) OR ("client"."id" IN (SELECT "client_id" FROM "a57be577deb434"."tbl_user_visit_clients" WHERE "user_id"=1000))) GROUP BY "c"."id" ORDER BY "c"."amount" DESC) "c"

16:29:35.60413.8 msSELECTSELECT c.*, abs(c.expire_date - current_date) AS b_date, CASE WHEN c.expire_date IS NULL THEN 1 ELSE 2 END AS passed FROM "a57be577deb434"."tbl_sales_contracts" "c" LEFT JOIN "a57be577deb434"."tbl_clients" "client" ON client.id = c.client_id LEFT JOIN "a57be577deb434"."tbl_projects" "p" ON p.id = c.from_project LEFT JOIN "a57be577deb434"."tbl_sales_group_relationships" "sgr" ON sgr.sales_id = client.sales_rep LEFT JOIN "a57be577deb434"."tbl_attachement_relationships" "cs" ON cs.object_id = c.id AND cs.object_type = 105 LEFT JOIN "a57be577deb434"."tbl_attachement_relationships" "rs" ON rs.object_id = c.id AND rs.object_type = 106 LEFT JOIN "a57be577deb434"."tbl_attachement_relationships" "vs" ON vs.object_id = c.id AND vs.object_type = 107 WHERE (true) AND (("client"."sales_rep" IN (5049, 5301, 5022, 5209, 5026, 5293, 5309, 5356, 5329, 5299, 5303, 5302, 5332, 5047, 1026, 5096, 5070, 5448, 5420, 1029, 1001, 5037, 5087, 1008, 5048, 5043, 5045, 5230, 5031, 5088, 5208, 1003, 5294, 5357, 5044, 1030, 5076, 5300, 5027, 5089, 5311, 5066, 5069, 5364, 1009, 5295, 1013, 5128, 5203, 1025, 5032, 5075, 1004, 5072, 5033, 5359, 5409, 5412, 5229, 1005, 5304, 5449, 5358, 1006, 5093)) OR ("client"."sales_rep" IS NULL) OR ("client"."id" IN (SELECT "client_id" FROM "a57be577deb434"."tbl_user_visit_clients" WHERE "user_id"=1000))) GROUP BY "c"."id" ORDER BY "c"."amount" DESC LIMIT 10

16:29:35.6190.4 msSELECTSELECT "id", "id" AS "key", "name", "logo", "sales_rep" FROM "a57be577deb434"."tbl_clients" WHERE "id" IN (2130, 5, 918, 149, 3296, 57, 876)

16:29:35.6190.2 msSELECTSELECT "id", "id" AS "key", "name" FROM "a57be577deb434"."tbl_users" WHERE "id" IN (1005, 1004, 1001, 5311, 5087)

16:29:35.6200.4 msSELECTSELECT "id", "user_id", "meta_value" AS "name" FROM "a57be577deb434"."tbl_user_meta" WHERE ("meta_key"='avatar') AND ("user_id" IN (1001, 5311, 1005, 5087, 1004))

16:29:35.6204.5 msSELECTSELECT "id", "id" AS "key", "name", "orig_name", "extension", "path" FROM "a57be577deb434"."tbl_attachments" WHERE "id" IN (2988, 4470, 6870, 5005, 1725, 665)

16:29:35.6251.4 msSELECTSELECT "id", "id" AS "key", "name", "orig_name", "extension", "path" FROM "a57be577deb434"."tbl_attachments" WHERE "id" IN (3108, 4724, 7985, 5619, 1858, 676)

16:29:35.6270.2 msSELECTSELECT "id", "id" AS "key", "name", "sex", "department_id" FROM "a57be577deb434"."tbl_users" WHERE "id" IN (1001, 5015, 1004, 1005)

16:29:35.6270.2 msSELECTSELECT "id", "user_id", "meta_value" AS "name" FROM "a57be577deb434"."tbl_user_meta" WHERE ("meta_key"='avatar') AND ("user_id" IN (1001, 5015, 1005, 1004))

16:29:35.6270.4 msSELECTSELECT "id", "id" AS "key", "name" FROM "a57be577deb434"."tbl_departments" WHERE "id" IN (4, 9, 1)

16:29:35.62820.7 msSELECTSELECT "object_id", count(*) AS comment FROM "a57be577deb434"."tbl_comments" WHERE ("object_type"=7) AND ("object_id" IN (4132, 1044, 1414, 2286, 2447, 1866, 3493, 1541, 765, 229)) GROUP BY "object_id"

16:29:35.6490.4 msSELECTSELECT "id", "id" AS "key", "project_title" AS "name" FROM "a57be577deb434"."tbl_projects" WHERE "id" IN (3957, 1077, 1010, 2761, 2331, 1806, 3633, 1430, 931, 2)

16:29:35.6501.1 msSELECTSELECT * FROM "a57be577deb434"."tbl_erp_sales_orders" WHERE ("status" IN (2, 5)) AND ("project_id" IN (3957, 2761, 2331, 1806, 1430, 1077, 2, 931, 3633, 1010))

16:29:35.6510.3 msSELECTSELECT * FROM "a57be577deb434"."tbl_erp_sales_order_verify_rels" WHERE "erp_sales_order_id" IN (83, 295, 395, 537, 579, 683, 858, 923, 1329, 1577) ORDER BY "id"

16:29:35.6510.3 msSELECTSELECT * FROM "a57be577deb434"."tbl_erp_sales_order_stop_verify_rels" WHERE "erp_sales_order_id" IN (83, 295, 395, 537, 579, 683, 858, 923, 1329, 1577) ORDER BY "id"

16:29:35.6520.4 msSELECTSELECT "id", "id" AS "key", "project_title" AS "name", "description", "total_contact_point", "paid_contact_point", "is_sales_order_ready", "project_product_version_id", "bargain_date", "collected", "profit_pct", "budget" FROM "a57be577deb434"."tbl_projects" WHERE "id" IN (3957, 1077, 1010, 2761, 2331, 1806, 3633, 1430, 931, 2)

16:29:35.6530.6 msSELECTSELECT * FROM "a57be577deb434"."tbl_erp_sales_orders" WHERE ("status" IN (2, 5)) AND ("project_id" IN (3957, 2761, 2331, 1806, 1430, 1077, 2, 931, 3633, 1010))

16:29:35.6540.8 msSELECTSELECT "id", "product_type_id", "product_type_id" AS "key", "name", "budget", "pct", "project_id", "profit" FROM "a57be577deb434"."tbl_project_product_types" WHERE "project_id" IN (3957, 2761, 2331, 1806, 1430, 1077, 2, 931, 3633, 1010)

16:29:35.6540.6 msSELECTSELECT * FROM "a57be577deb434"."tbl_project_product_rels" WHERE "project_id" IN (3957, 2761, 2331, 1806, 1430, 1077, 2, 931, 3633, 1010)

16:29:35.6550.4 msSELECTSELECT "id", "id" AS "key", "name" FROM "a57be577deb434"."tbl_suppliers" WHERE "id"=90

16:29:35.6560.4 msSELECTSELECT * FROM "a57be577deb434"."tbl_products" WHERE "id" IN (1757, 1758)

16:29:35.6570.3 msSELECTSELECT "id", "id" AS "key", "name" FROM "a57be577deb434"."tbl_product_types" WHERE "id"=7

16:29:35.6570.2 msSELECTSELECT "id", "id" AS "key", "name" FROM "a57be577deb434"."tbl_product_components" WHERE "id"=64

16:29:35.6570.3 msSELECTSELECT "id", "id" AS "key", "name" FROM "a57be577deb434"."tbl_product_brands" WHERE "id"=230

16:29:35.6580.9 msSELECTSELECT "id", "id" AS "key", "name" FROM "a57be577deb434"."tbl_product_series" WHERE "id" IN (1486, 1487)

16:29:35.6590.2 msSELECTSELECT "id", "id" AS "key", "name" FROM "a57be577deb434"."tbl_product_units" WHERE "id"=2

16:29:35.6591.0 msSELECTSELECT * FROM "a57be577deb434"."tbl_erp_sales_order_products" WHERE "id" IN (1173, 1174)

16:29:35.6600.3 msSELECTSELECT * FROM "a57be577deb434"."tbl_project_contact_points" WHERE "project_id" IN (3957, 2761, 2331, 1806, 1430, 1077, 2, 931, 3633, 1010)

16:29:35.6612.1 msSELECTSELECT "id", "project_id" FROM "a57be577deb434"."tbl_sales_order_items" WHERE ("is_system"=TRUE) AND ("project_id" IN (3957, 2761, 2331, 1806, 1430, 1077, 2, 931, 3633, 1010))

16:29:35.6631.6 msSELECTSELECT "project_id", sum(amount) AS sum FROM "a57be577deb434"."tbl_reimbursements" WHERE ("status" IN (2, 3)) AND ("project_id" IN (3957, 2761, 2331, 1806, 1430, 1077, 2, 931, 3633, 1010)) GROUP BY "project_id"

16:29:35.6650.5 msSELECTSELECT * FROM "a57be577deb434"."tbl_sales_supplier_rels" WHERE "contract_id" IN (4132, 1044, 1414, 2286, 2447, 1866, 3493, 1541, 765, 229)

16:29:35.6661.0 msSELECTSELECT "id", "id" AS "key", "name" FROM "a57be577deb434"."tbl_suppliers" WHERE "id" IN (298, 46, 355, 116, 354, 486, 147, 387, 659, 146, 123, 360, 68, 241, 137, 57, 197, 188, 361, 447, 320, 163, 372, 98, 425, 106, 359, 480, 138, 302, 293, 297, 371, 262, 95, 90)

16:29:35.66711.5 msSELECTSELECT "id", "id" AS "key", "serial_no" FROM "a57be577deb434"."tbl_purchase_contracts" WHERE "id" IN (2652, 2721, 1705, 285, 1619, 1523, 2465, 393, 1887, 224, 1590, 1928, 2455, 1495, 303, 2490, 795, 1630, 2545, 2356, 1953, 1471, 2473, 1496, 2467, 1410, 1515, 1642, 1580, 2491, 1122, 1416, 1617, 1063, 1835, 1701, 1490, 288, 1479, 2449, 2458, 1412, 1621, 1182, 2607, 2707, 755, 1865, 1124, 1491, 1095, 1699, 1534, 2974, 295, 3494)

16:29:35.6790.3 msSELECTSELECT "id", "id" AS "key", "type" AS "name" FROM "a57be577deb434"."tbl_contract_types" WHERE "id"=1

16:29:35.6790.2 msSELECTSELECT "id", "id" AS "key", "name", "sex", "department_id" FROM "a57be577deb434"."tbl_users" WHERE "id" IN (5087, 1004, 1005, 1001, 1006)

16:29:35.6790.2 msSELECTSELECT "id", "user_id", "meta_value" AS "name" FROM "a57be577deb434"."tbl_user_meta" WHERE ("meta_key"='avatar') AND ("user_id" IN (1001, 1006, 1005, 5087, 1004))

16:29:35.6800.5 msSELECTSELECT "id", "id" AS "key", "contract_id", "remind_date" FROM "a57be577deb434"."tbl_service_contract_remind_dates" WHERE ("reminded"=FALSE) AND ("contract_id" IN (4132, 1044, 1414, 2286, 2447, 1866, 3493, 1541, 765, 229)) ORDER BY "remind_date"

16:29:35.6800.2 msSELECTSELECT "id", "id" AS "key", "contract_id", "remind_date" AS "name" FROM "a57be577deb434"."tbl_service_contract_remind_dates" WHERE "contract_id" IN (4132, 1044, 1414, 2286, 2447, 1866, 3493, 1541, 765, 229)

16:29:35.6810.5 msSELECTSELECT "id", "user_id", "user_id" AS "key", "contract_id" FROM "a57be577deb434"."tbl_sales_contract_remind_receivers" WHERE "contract_id" IN (4132, 1044, 1414, 2286, 2447, 1866, 3493, 1541, 765, 229)

16:29:35.6810.2 msSELECTSELECT "id", "id" AS "key", "name", "sex" FROM "a57be577deb434"."tbl_users" WHERE "id" IN (1005, 1011, 1004, 1013, 1023, 1001, 5311)

16:29:35.6820.2 msSELECTSELECT "id", "user_id", "meta_value" AS "name" FROM "a57be577deb434"."tbl_user_meta" WHERE ("meta_key"='avatar') AND ("user_id" IN (1011, 1001, 1023, 5311, 1005, 1004, 1013))

16:29:35.6820.3 msSELECTSELECT * FROM "a57be577deb434"."tbl_service_contract_remind_receivers" WHERE "contract_id" IN (4132, 1044, 1414, 2286, 2447, 1866, 3493, 1541, 765, 229)

16:29:35.6820.4 msSELECTSELECT "id", "user_id", "user_id" AS "key", "contract_id" FROM "a57be577deb434"."tbl_sales_contract_payment_collection_remind_receivers" WHERE "contract_id" IN (4132, 1044, 1414, 2286, 2447, 1866, 3493, 1541, 765, 229)

16:29:35.6830.2 msSELECTSELECT "id", "id" AS "key", "name", "sex" FROM "a57be577deb434"."tbl_users" WHERE "id" IN (5388, 1001, 1004, 1005, 5087)

16:29:35.6830.2 msSELECTSELECT "id", "user_id", "meta_value" AS "name" FROM "a57be577deb434"."tbl_user_meta" WHERE ("meta_key"='avatar') AND ("user_id" IN (1001, 1005, 5388, 5087, 1004))

16:29:35.6840.5 msSELECTSELECT "id", "id" AS "key", "contract_id", "remind_date" AS "name", "amount" AS "value", "overdue_days", "status" FROM "a57be577deb434"."tbl_sales_contract_payment_collection_remind_dates" WHERE "contract_id" IN (4132, 1044, 1414, 2286, 2447, 1866, 3493, 1541, 765, 229) ORDER BY "remind_date"

16:29:35.6843.4 msSELECTSELECT "id", "id" AS "key", "contract_id", "amount" AS "value", "created_by", "created_at", "description", "collected_date", "amount" FROM (SELECT * FROM ((SELECT '1' || r.id::varchar as id, 1 as ticket_type, r.sales_contract_id as contract_id, r.amount as amount, t.created_at 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 (r.sales_contract_id is not null) AND ("t"."status" IN (2, 5, 1))) UNION ALL ( SELECT '2' || r.id::varchar as id, 2 as ticket_type, r.sales_contract_id as contract_id, r.amount as amount, t.created_at as collected_date, t.created_at, t.created_by, t.abstract as description FROM "a57be577deb434"."tbl_erp_cash_cost_ticket_sales_contract_settles" "r" LEFT JOIN "a57be577deb434"."tbl_erp_cash_cost_tickets" "t" ON r.erp_cash_cost_ticket_id = t.id WHERE (r.sales_contract_id is not null) AND ("t"."status" IN (2, 5, 1)) ) UNION ALL ( SELECT '3' || r.id::varchar as id, 3 as ticket_type, r.sales_contract_id as contract_id, 0 - r.amount as amount, t.created_at 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 (r.sales_contract_id is not null) AND ("t"."status" IN (2, 5, 1)) )) "sub") "r" WHERE "contract_id" IN (4132, 1044, 1414, 2286, 2447, 1866, 3493, 1541, 765, 229) ORDER BY "id" DESC

16:29:35.6880.2 msSELECTSELECT "id", "id" AS "key", "name", "sex", "department_id" FROM "a57be577deb434"."tbl_users" WHERE "id" IN (1014, 1013)

16:29:35.6880.6 msSELECTSELECT "id", "id" AS "key", "contract_id", "amount" AS "value", "attachment_id", "from_date" FROM "a57be577deb434"."tbl_sales_contract_invoices" WHERE "contract_id" IN (4132, 1044, 1414, 2286, 2447, 1866, 3493, 1541, 765, 229) ORDER BY "id"

16:29:35.6890.8 msSELECTSELECT "id", "id" AS "key", "name", "extension", "path" FROM "a57be577deb434"."tbl_attachments" WHERE "id" IN (5264, 5618, 5869, 6314, 6324, 6333, 7991)

16:29:35.6901.8 msSELECTSELECT * FROM "a57be577deb434"."tbl_attachement_relationships" WHERE ("object_type"=20) AND ("object_id" IN (142, 269, 274, 307, 401, 423, 499, 541, 620, 752, 799, 869, 907, 940, 941, 945, 1092, 1324, 1527, 1844))

16:29:35.6921.9 msSELECTSELECT * FROM "a57be577deb434"."tbl_attachement_relationships" WHERE ("object_type"=102) AND ("object_id" IN (142, 269, 274, 307, 401, 423, 499, 541, 620, 752, 799, 869, 907, 940, 941, 945, 1092, 1324, 1527, 1844))

16:29:35.6941.4 msSELECTSELECT "id", "id" AS "key", "name", "extension", "path", "orig_name" FROM "a57be577deb434"."tbl_attachments" WHERE "id" IN (7991, 5869, 5618, 5264, 6314, 6324, 6333, 11649, 15970, 22241)

16:29:35.6961.8 msSELECTSELECT * FROM "a57be577deb434"."tbl_attachement_relationships" WHERE ("object_type"=105) AND ("object_id" IN (4132, 1044, 1414, 2286, 2447, 1866, 3493, 1541, 765, 229))

16:29:35.6981.1 msSELECTSELECT "id", "id" AS "key", "name", "extension", "path", "orig_name" FROM "a57be577deb434"."tbl_attachments" WHERE "id" IN (1725, 4470, 5005, 2988, 665, 6870, 11339, 11392, 11280, 11499, 21132)

16:29:35.6991.8 msSELECTSELECT * FROM "a57be577deb434"."tbl_attachement_relationships" WHERE ("object_type"=106) AND ("object_id" IN (4132, 1044, 1414, 2286, 2447, 1866, 3493, 1541, 765, 229))

16:29:35.7010.8 msSELECTSELECT "id", "id" AS "key", "name", "extension", "path", "orig_name" FROM "a57be577deb434"."tbl_attachments" WHERE "id" IN (7985, 4724, 5619, 3108, 676, 1858, 11253, 11524, 15732, 22188)

16:29:35.7021.8 msSELECTSELECT * FROM "a57be577deb434"."tbl_attachement_relationships" WHERE ("object_type"=107) AND ("object_id" IN (4132, 1044, 1414, 2286, 2447, 1866, 3493, 1541, 765, 229))

16:29:35.70423.1 msSELECTSELECT "object_id", count(*) AS unread FROM "a57be577deb434"."tbl_unread_comments" WHERE ("object_type"=7) AND (remind_user_id = 1000 AND is_read = false) AND ("object_id" IN (4132, 1044, 1414, 2286, 2447, 1866, 3493, 1541, 765, 229)) GROUP BY "object_id"

16:29:35.7281.4 msINSERTINSERT INTO "global"."tbl_api_log" ("code", "schema", "user_id", "device_type", "version_code", "url", "request", "response", "php_error", "time") VALUES (NULL, 'a57be577deb434', 1000, 6, 170, 'v2/sales-contract/list', '{"SalesContractSearch":{"keyword":"","contract_type":"","handler":"","contract_scan":"","receipt_scan":""},"Filter":{"name":"amount","sort":"DESC"},"page":"1","posttime":"1757492974","access_token":"gIBfXHaGAAjf2tBIfgqsDfRNPly9E9om","device_type":"6","version_code":"170","token":"03ce3091d67877f64cf52d9f4079a9f1"}', '{"code":"","data":null,"status":0,"msg":[{"name":"error","success":"","error":"Undefined index: orig_name","trace":{"name":"PHP Notice","message":"Undefined index: orig_name","code":8,"type":"yii\\base\\ErrorException","file":"\/var\/www\/beta\/vendor\/uranus\/Misc.php","line":2630,"stack-trace":["#0 \/var\/www\/beta\/vendor\/uranus\/Misc.php(2630): yii\\base\\ErrorHandler->handleError(8, ''Undefined index...'', ''\/var\/www\/beta\/v...'', 2630, Array)","#1 \/var\/www\/beta\/models\/SalesContracts.php(1028): uranus\\Misc::makeAttachmentView(Array, ''preview'')","#2 \/var\/www\/beta\/modules\/v2\/controllers\/SalesContractController.php(159): app\\models\\SalesContracts::makeModel(Array)","#3 [internal function]: app\\modules\\v2\\controllers\\SalesContractController->actionList()","#4 \/var\/www\/beta\/vendor\/yiisoft\/yii2\/base\/InlineAction.php(57): call_user_func_array(Array, Array)","#5 \/var\/www\/beta\/vendor\/yiisoft\/yii2\/base\/Controller.php(156): yii\\base\\InlineAction->runWithParams(Array)","#6 \/var\/www\/beta\/vendor\/yiisoft\/yii2\/base\/Module.php(522): yii\\base\\Controller->runAction(''list'', Array)","#7 \/var\/www\/beta\/vendor\/yiisoft\/yii2\/web\/Application.php(102): yii\\base\\Module->runAction(''v2\/sales-contra...'', Array)","#8 \/var\/www\/beta\/vendor\/yiisoft\/yii2\/base\/Application.php(379): yii\\web\\Application->handleRequest(Object(yii\\web\\Request))","#9 \/var\/www\/beta\/web\/index.php(24): yii\\base\\Application->run()","#10 {main}"]}}]}', TRUE, '2025-09-10 16:29:35') RETURNING "id"