Database Queries

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

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

16:29:33.59911.7 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") "c"

16:29:33.61113.6 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" LIMIT 10

16:29:33.6250.3 msSELECTSELECT "id", "id" AS "key", "name", "logo", "sales_rep" FROM "a57be577deb434"."tbl_clients" WHERE "id" IN (1312, 12, 57)

16:29:33.6260.2 msSELECTSELECT "id", "id" AS "key", "name" FROM "a57be577deb434"."tbl_users" WHERE "id" IN (5300, 1005)

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

16:29:33.6272.8 msSELECTSELECT "id", "id" AS "key", "name", "orig_name", "extension", "path" FROM "a57be577deb434"."tbl_attachments" WHERE "id" IN (3095, 1532, 4159, 833)

16:29:33.6300.2 msSELECTSELECT "id", "id" AS "key", "name", "orig_name", "extension", "path" FROM "a57be577deb434"."tbl_attachments" WHERE "id" IN (3096, 1533, 4160)

16:29:33.6300.2 msSELECTSELECT "id", "id" AS "key", "name", "sex", "department_id" FROM "a57be577deb434"."tbl_users" WHERE "id" IN (5015, 5300)

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

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

16:29:33.63120.5 msSELECTSELECT "object_id", count(*) AS comment FROM "a57be577deb434"."tbl_comments" WHERE ("object_type"=7) AND ("object_id" IN (1076, 658, 1313, 192, 3553, 4043, 3710, 3711, 4022, 4083)) GROUP BY "object_id"

16:29:33.6521.1 msSELECTSELECT "id", "id" AS "key", "project_title" AS "name" FROM "a57be577deb434"."tbl_projects" WHERE "id" IN (1205, 888, 1613, 271, 3669, 3920, 3741, 3742, 3913, 3941)

16:29:33.6531.0 msSELECTSELECT * FROM "a57be577deb434"."tbl_erp_sales_orders" WHERE ("status" IN (2, 5)) AND ("project_id" IN (1613, 3669, 3741, 3742, 888, 271, 1205, 3913, 3920, 3941))

16:29:33.6550.4 msSELECTSELECT * FROM "a57be577deb434"."tbl_erp_sales_order_verify_rels" WHERE "erp_sales_order_id" IN (1562, 1537, 1545, 72, 253, 414, 522, 1356, 1409, 1410) ORDER BY "id"

16:29:33.6550.3 msSELECTSELECT * FROM "a57be577deb434"."tbl_erp_sales_order_stop_verify_rels" WHERE "erp_sales_order_id" IN (1562, 1537, 1545, 72, 253, 414, 522, 1356, 1409, 1410) ORDER BY "id"

16:29:33.6560.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 (1205, 888, 1613, 271, 3669, 3920, 3741, 3742, 3913, 3941)

16:29:33.6560.6 msSELECTSELECT * FROM "a57be577deb434"."tbl_erp_sales_orders" WHERE ("status" IN (2, 5)) AND ("project_id" IN (1613, 3669, 3741, 3742, 888, 271, 1205, 3913, 3920, 3941))

16:29:33.6570.7 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 (1613, 3669, 3741, 3742, 888, 271, 1205, 3913, 3920, 3941)

16:29:33.6580.6 msSELECTSELECT * FROM "a57be577deb434"."tbl_project_product_rels" WHERE "project_id" IN (1613, 3669, 3741, 3742, 888, 271, 1205, 3913, 3920, 3941)

16:29:33.6590.4 msSELECTSELECT "id", "id" AS "key", "name" FROM "a57be577deb434"."tbl_suppliers" WHERE "id" IN (608, 626)

16:29:33.6591.1 msSELECTSELECT * FROM "a57be577deb434"."tbl_products" WHERE "id" IN (1690, 1691, 1677)

16:29:33.6610.3 msSELECTSELECT "id", "id" AS "key", "name" FROM "a57be577deb434"."tbl_product_types" WHERE "id" IN (4, 11)

16:29:33.6610.3 msSELECTSELECT "id", "id" AS "key", "name" FROM "a57be577deb434"."tbl_product_components" WHERE "id" IN (43, 179)

16:29:33.6620.3 msSELECTSELECT "id", "id" AS "key", "name" FROM "a57be577deb434"."tbl_product_brands" WHERE "id" IN (20, 10, 43)

16:29:33.6620.3 msSELECTSELECT "id", "id" AS "key", "name" FROM "a57be577deb434"."tbl_product_series" WHERE "id" IN (1425, 1438, 1439)

16:29:33.6620.2 msSELECTSELECT "id", "id" AS "key", "name" FROM "a57be577deb434"."tbl_product_units" WHERE "id" IN (3, 6)

16:29:33.6631.6 msSELECTSELECT * FROM "a57be577deb434"."tbl_erp_sales_order_products" WHERE "id" IN (1791, 1756, 1439, 1440, 1829, 1247)

16:29:33.6640.3 msSELECTSELECT * FROM "a57be577deb434"."tbl_project_contact_points" WHERE "project_id" IN (1613, 3669, 3741, 3742, 888, 271, 1205, 3913, 3920, 3941)

16:29:33.6652.0 msSELECTSELECT "id", "project_id" FROM "a57be577deb434"."tbl_sales_order_items" WHERE ("is_system"=TRUE) AND ("project_id" IN (1613, 3669, 3741, 3742, 888, 271, 1205, 3913, 3920, 3941))

16:29:33.6671.6 msSELECTSELECT "project_id", sum(amount) AS sum FROM "a57be577deb434"."tbl_reimbursements" WHERE ("status" IN (2, 3)) AND ("project_id" IN (1613, 3669, 3741, 3742, 888, 271, 1205, 3913, 3920, 3941)) GROUP BY "project_id"

16:29:33.6690.5 msSELECTSELECT * FROM "a57be577deb434"."tbl_sales_supplier_rels" WHERE "contract_id" IN (1076, 658, 1313, 192, 3553, 4043, 3710, 3711, 4022, 4083)

16:29:33.6690.2 msSELECTSELECT "id", "id" AS "key", "name" FROM "a57be577deb434"."tbl_suppliers" WHERE "id" IN (608, 626)

16:29:33.6702.0 msSELECTSELECT "id", "id" AS "key", "serial_no" FROM "a57be577deb434"."tbl_purchase_contracts" WHERE "id" IN (4084, 3569, 3712, 4023, 4045)

16:29:33.6720.3 msSELECTSELECT "id", "id" AS "key", "type" AS "name" FROM "a57be577deb434"."tbl_contract_types" WHERE "id" IN (1, 2)

16:29:33.6720.2 msSELECTSELECT "id", "id" AS "key", "name", "sex", "department_id" FROM "a57be577deb434"."tbl_users" WHERE "id" IN (5089, 1003, 1006, 5300)

16:29:33.6730.2 msSELECTSELECT "id", "user_id", "meta_value" AS "name" FROM "a57be577deb434"."tbl_user_meta" WHERE ("meta_key"='avatar') AND ("user_id" IN (5089, 1006, 5300, 1003))

16:29:33.6730.4 msSELECTSELECT "id", "id" AS "key", "contract_id", "remind_date" FROM "a57be577deb434"."tbl_service_contract_remind_dates" WHERE ("reminded"=FALSE) AND ("contract_id" IN (1076, 658, 1313, 192, 3553, 4043, 3710, 3711, 4022, 4083)) ORDER BY "remind_date"

16:29:33.6740.2 msSELECTSELECT "id", "id" AS "key", "contract_id", "remind_date" AS "name" FROM "a57be577deb434"."tbl_service_contract_remind_dates" WHERE "contract_id" IN (1076, 658, 1313, 192, 3553, 4043, 3710, 3711, 4022, 4083)

16:29:33.6740.5 msSELECTSELECT "id", "user_id", "user_id" AS "key", "contract_id" FROM "a57be577deb434"."tbl_sales_contract_remind_receivers" WHERE "contract_id" IN (1076, 658, 1313, 192, 3553, 4043, 3710, 3711, 4022, 4083)

16:29:33.6750.2 msSELECTSELECT "id", "id" AS "key", "name", "sex" FROM "a57be577deb434"."tbl_users" WHERE "id" IN (1011, 1001, 1013, 5300)

16:29:33.6750.2 msSELECTSELECT "id", "user_id", "meta_value" AS "name" FROM "a57be577deb434"."tbl_user_meta" WHERE ("meta_key"='avatar') AND ("user_id" IN (1011, 1001, 1013, 5300))

16:29:33.6750.3 msSELECTSELECT * FROM "a57be577deb434"."tbl_service_contract_remind_receivers" WHERE "contract_id" IN (1076, 658, 1313, 192, 3553, 4043, 3710, 3711, 4022, 4083)

16:29:33.6760.4 msSELECTSELECT "id", "user_id", "user_id" AS "key", "contract_id" FROM "a57be577deb434"."tbl_sales_contract_payment_collection_remind_receivers" WHERE "contract_id" IN (1076, 658, 1313, 192, 3553, 4043, 3710, 3711, 4022, 4083)

16:29:33.6760.2 msSELECTSELECT "id", "id" AS "key", "name", "sex" FROM "a57be577deb434"."tbl_users" WHERE "id" IN (1001, 5089, 5300, 1003, 5388)

16:29:33.6770.2 msSELECTSELECT "id", "user_id", "meta_value" AS "name" FROM "a57be577deb434"."tbl_user_meta" WHERE ("meta_key"='avatar') AND ("user_id" IN (1001, 5089, 5388, 5300, 1003))

16:29:33.6770.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 (1076, 658, 1313, 192, 3553, 4043, 3710, 3711, 4022, 4083) ORDER BY "remind_date"

16:29:33.6783.3 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 (1076, 658, 1313, 192, 3553, 4043, 3710, 3711, 4022, 4083) ORDER BY "id" DESC

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

16:29:33.6820.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 (1076, 658, 1313, 192, 3553, 4043, 3710, 3711, 4022, 4083) ORDER BY "id"

16:29:33.6820.2 msSELECTSELECT "id", "id" AS "key", "name", "extension", "path" FROM "a57be577deb434"."tbl_attachments" WHERE "id"=5241

16:29:33.6831.8 msSELECTSELECT * FROM "a57be577deb434"."tbl_attachement_relationships" WHERE ("object_type"=20) AND ("object_id" IN (485, 546, 559, 819, 1817, 1937, 1938, 2098, 2116, 2120))

16:29:33.6851.8 msSELECTSELECT * FROM "a57be577deb434"."tbl_attachement_relationships" WHERE ("object_type"=102) AND ("object_id" IN (485, 546, 559, 819, 1817, 1937, 1938, 2098, 2116, 2120))

16:29:33.6870.9 msSELECTSELECT "id", "id" AS "key", "name", "extension", "path", "orig_name" FROM "a57be577deb434"."tbl_attachments" WHERE "id" IN (5241, 21744, 23734, 23733, 26962, 27217, 27596)

16:29:33.6881.8 msSELECTSELECT * FROM "a57be577deb434"."tbl_attachement_relationships" WHERE ("object_type"=105) AND ("object_id" IN (1076, 658, 1313, 192, 3553, 4043, 3710, 3711, 4022, 4083))

16:29:33.6900.8 msSELECTSELECT "id", "id" AS "key", "name", "extension", "path", "orig_name" FROM "a57be577deb434"."tbl_attachments" WHERE "id" IN (833, 1532, 3095, 4159, 21668, 23239, 23240, 26768, 26882, 27312)

16:29:33.6911.8 msSELECTSELECT * FROM "a57be577deb434"."tbl_attachement_relationships" WHERE ("object_type"=106) AND ("object_id" IN (1076, 658, 1313, 192, 3553, 4043, 3710, 3711, 4022, 4083))

16:29:33.6930.3 msSELECTSELECT "id", "id" AS "key", "name", "extension", "path", "orig_name" FROM "a57be577deb434"."tbl_attachments" WHERE "id" IN (1533, 3096, 4160, 22857, 23339, 23340, 26856, 27044, 27417)

16:29:33.6931.7 msSELECTSELECT * FROM "a57be577deb434"."tbl_attachement_relationships" WHERE ("object_type"=107) AND ("object_id" IN (1076, 658, 1313, 192, 3553, 4043, 3710, 3711, 4022, 4083))

16:29:33.69522.6 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 (1076, 658, 1313, 192, 3553, 4043, 3710, 3711, 4022, 4083)) GROUP BY "object_id"

16:29:33.7181.3 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":"ASC"},"page":"1","posttime":"1757492973","access_token":"gIBfXHaGAAjf2tBIfgqsDfRNPly9E9om","device_type":"6","version_code":"170","token":"125af6e522752ba7e6ee37f20a570c52"}', '{"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:33') RETURNING "id"