68b2ea1ea8e21: POST https://beta.jinchangxiao.com/vue/account/list-client at 2025-08-30 08:10:06 pm by 120.244.156.113

Performance Profiling

Total processing time: 104 ms; Peak memory: 4.899 MB. Show Profiling Timeline

总计8条数据
TimeDurationCategoryInfo
  
20:10:06.70442.3 msyii\db\Command::querySELECT COUNT(*) FROM (SELECT c.*, CASE WHEN p.client_id IS NULL THEN false ELSE true END AS cooperated, CASE WHEN c.sales_rep IS NULL THEN 0 ELSE 1 END AS is_public, sl.lost_contact_days, extract(epoch from (now() - max(arrive.end_at))) / 86400 AS last_arrive_days, sl.last_contact, max(arrive.end_at) as last_arrive, CASE WHEN c.client_class IS NOT NULL THEN ( (CASE WHEN cl.contact_base > 0 THEN floor(CASE WHEN c.contact_count > cl.contact_base THEN 1 * 15 ELSE c.contact_count * 15 / cl.contact_base END) ELSE 15 END) + floor(c.client_base_info_count * 15 / 9) + (CASE WHEN cl.visit_base > 0 THEN floor(CASE WHEN c.visit_count > ceil((CASE WHEN extract(year from now()) = extract(year from c.created_at::date) THEN (now()::date - c.created_at::date + 1)::float ELSE 242::float END) / cl.visit_base::float) THEN 1 * 20 ELSE c.visit_count * 20 / ceil((CASE WHEN extract(year from now()) = extract(year from c.created_at::date) THEN (now()::date - c.created_at::date + 1)::float ELSE 242::float END) / cl.visit_base::float) END) ELSE 20 END) + (CASE WHEN cl.cooperate_base > 0 THEN floor(CASE WHEN c.cooperate_count > cl.cooperate_base THEN 1 * 20 ELSE c.cooperate_count * 20 / cl.cooperate_base END) ELSE 20 END) + (CASE WHEN cl.case_pre_sales_base > 0 THEN floor(CASE WHEN c.case_pre_sales_count > cl.case_pre_sales_base THEN 1 * 15 ELSE c.case_pre_sales_count * 15 / cl.case_pre_sales_base END) ELSE 15 END) + (CASE WHEN cl.case_implement_base > 0 THEN floor(CASE WHEN c.case_implement_count > cl.case_implement_base THEN 1 * 15 ELSE c.case_implement_count * 15 / cl.case_implement_base END) ELSE 15 END) ) ELSE NULL END as score FROM "a57be577deb434"."tbl_clients" "c" LEFT JOIN "a57be577deb434"."tbl_sales_group_relationships" "sgr" ON sgr.sales_id = c.sales_rep LEFT JOIN "a57be577deb434"."tbl_client_classes" "cl" ON cl.id = c.client_class LEFT JOIN "a57be577deb434"."tbl_client_address_rels" "car" ON car.client_id = c.id LEFT JOIN "a57be577deb434"."tbl_addresses" "a" ON car.address_id = a.id LEFT JOIN (SELECT "client_id" FROM "a57be577deb434"."tbl_projects" WHERE "project_status"=3 GROUP BY "client_id") "p" ON p.client_id = c.id LEFT JOIN "a57be577deb434"."tbl_work_logs" "arrive" ON (arrive.client_id = c.id) AND ("arrive"."scenario_id"=1) AND ("arrive"."is_draft"=FALSE) AND ("arrive"."location_in_id" IS NOT NULL) AND ("arrive"."location_out_id" IS NOT NULL) AND ("arrive"."client_id" IS NOT NULL) LEFT JOIN (SELECT extract(epoch from (now() - max(end_at))) / 86400 AS lost_contact_days, max(end_at) as last_contact, client_id FROM "a57be577deb434"."tbl_work_logs" WHERE "is_draft"=FALSE GROUP BY "client_id") "sl" ON sl.client_id = c.id LEFT JOIN "a57be577deb434"."tbl_term_taxonomy_relationships" "ttr" ON ttr.object_id = c.id AND ttr.term_id = 14 LEFT JOIN (SELECT "client_id" FROM "a57be577deb434"."tbl_contacts" WHERE lower(name) LIKE '%金丰%' GROUP BY "client_id") "cc" ON cc.client_id = c.id LEFT JOIN (SELECT "client_id" FROM "a57be577deb434"."tbl_sales_order_items" WHERE (lower(pn) LIKE '%金丰%') OR (lower(sn) LIKE '%金丰%') OR (lower(description) LIKE '%金丰%') GROUP BY "client_id") "s" ON c.id = s.client_id LEFT JOIN (SELECT "client_id" FROM "a57be577deb434"."tbl_projects" WHERE ("pinyin_shortcut" ILIKE '%金丰%') OR ("project_title" ILIKE '%金丰%') OR ("description" ILIKE '%金丰%') OR ("comment" ILIKE '%金丰%') GROUP BY "client_id") "pp" ON c.id = pp.client_id WHERE (("cc"."client_id" IS NOT NULL) OR ("s"."client_id" IS NOT NULL) OR ("pp"."client_id" IS NOT NULL) OR (lower(c.name) LIKE '%金丰%') OR ("c"."pinyin_shortcut" LIKE '%金丰%') OR (lower(c.description) LIKE '%金丰%') OR (lower(c.it_budget) LIKE '%金丰%') OR (lower(c.main_business) LIKE '%金丰%') OR (lower(c.deployment_mode) LIKE '%金丰%') OR (lower(c.it_per_num) LIKE '%金丰%') OR (lower(c.public_relations_difficulty) LIKE '%金丰%') OR (lower(c.it_status) LIKE '%金丰%') OR (lower(c.decision_process) LIKE '%金丰%') OR (lower(c.coach) LIKE '%金丰%') OR (lower(c.competitor) LIKE '%金丰%') OR (lower(c.main_product) LIKE '%金丰%') OR (lower(c.headcount) LIKE '%金丰%') OR (lower(c.peers) LIKE '%金丰%') OR (lower(c.supplier) LIKE '%金丰%')) AND ("sgr"."group_id"='1') AND ("c"."sales_rep"='1001') AND ("c"."sales_rep"='1001') AND ("deleted"=FALSE) GROUP BY "c"."id", "cl"."id", "cooperated", "lost_contact_days", "last_contact" ORDER BY "is_public" DESC, lost_contact_days DESC NULLS LAST, "c"."created_at" DESC) "c"
20:10:06.74739.3 msyii\db\Command::querySELECT c.*, CASE WHEN p.client_id IS NULL THEN false ELSE true END AS cooperated, CASE WHEN c.sales_rep IS NULL THEN 0 ELSE 1 END AS is_public, sl.lost_contact_days, extract(epoch from (now() - max(arrive.end_at))) / 86400 AS last_arrive_days, sl.last_contact, max(arrive.end_at) as last_arrive, CASE WHEN c.client_class IS NOT NULL THEN ( (CASE WHEN cl.contact_base > 0 THEN floor(CASE WHEN c.contact_count > cl.contact_base THEN 1 * 15 ELSE c.contact_count * 15 / cl.contact_base END) ELSE 15 END) + floor(c.client_base_info_count * 15 / 9) + (CASE WHEN cl.visit_base > 0 THEN floor(CASE WHEN c.visit_count > ceil((CASE WHEN extract(year from now()) = extract(year from c.created_at::date) THEN (now()::date - c.created_at::date + 1)::float ELSE 242::float END) / cl.visit_base::float) THEN 1 * 20 ELSE c.visit_count * 20 / ceil((CASE WHEN extract(year from now()) = extract(year from c.created_at::date) THEN (now()::date - c.created_at::date + 1)::float ELSE 242::float END) / cl.visit_base::float) END) ELSE 20 END) + (CASE WHEN cl.cooperate_base > 0 THEN floor(CASE WHEN c.cooperate_count > cl.cooperate_base THEN 1 * 20 ELSE c.cooperate_count * 20 / cl.cooperate_base END) ELSE 20 END) + (CASE WHEN cl.case_pre_sales_base > 0 THEN floor(CASE WHEN c.case_pre_sales_count > cl.case_pre_sales_base THEN 1 * 15 ELSE c.case_pre_sales_count * 15 / cl.case_pre_sales_base END) ELSE 15 END) + (CASE WHEN cl.case_implement_base > 0 THEN floor(CASE WHEN c.case_implement_count > cl.case_implement_base THEN 1 * 15 ELSE c.case_implement_count * 15 / cl.case_implement_base END) ELSE 15 END) ) ELSE NULL END as score FROM "a57be577deb434"."tbl_clients" "c" LEFT JOIN "a57be577deb434"."tbl_sales_group_relationships" "sgr" ON sgr.sales_id = c.sales_rep LEFT JOIN "a57be577deb434"."tbl_client_classes" "cl" ON cl.id = c.client_class LEFT JOIN "a57be577deb434"."tbl_client_address_rels" "car" ON car.client_id = c.id LEFT JOIN "a57be577deb434"."tbl_addresses" "a" ON car.address_id = a.id LEFT JOIN (SELECT "client_id" FROM "a57be577deb434"."tbl_projects" WHERE "project_status"=3 GROUP BY "client_id") "p" ON p.client_id = c.id LEFT JOIN "a57be577deb434"."tbl_work_logs" "arrive" ON (arrive.client_id = c.id) AND ("arrive"."scenario_id"=1) AND ("arrive"."is_draft"=FALSE) AND ("arrive"."location_in_id" IS NOT NULL) AND ("arrive"."location_out_id" IS NOT NULL) AND ("arrive"."client_id" IS NOT NULL) LEFT JOIN (SELECT extract(epoch from (now() - max(end_at))) / 86400 AS lost_contact_days, max(end_at) as last_contact, client_id FROM "a57be577deb434"."tbl_work_logs" WHERE "is_draft"=FALSE GROUP BY "client_id") "sl" ON sl.client_id = c.id LEFT JOIN "a57be577deb434"."tbl_term_taxonomy_relationships" "ttr" ON ttr.object_id = c.id AND ttr.term_id = 14 LEFT JOIN (SELECT "client_id" FROM "a57be577deb434"."tbl_contacts" WHERE lower(name) LIKE '%金丰%' GROUP BY "client_id") "cc" ON cc.client_id = c.id LEFT JOIN (SELECT "client_id" FROM "a57be577deb434"."tbl_sales_order_items" WHERE (lower(pn) LIKE '%金丰%') OR (lower(sn) LIKE '%金丰%') OR (lower(description) LIKE '%金丰%') GROUP BY "client_id") "s" ON c.id = s.client_id LEFT JOIN (SELECT "client_id" FROM "a57be577deb434"."tbl_projects" WHERE ("pinyin_shortcut" ILIKE '%金丰%') OR ("project_title" ILIKE '%金丰%') OR ("description" ILIKE '%金丰%') OR ("comment" ILIKE '%金丰%') GROUP BY "client_id") "pp" ON c.id = pp.client_id WHERE (("cc"."client_id" IS NOT NULL) OR ("s"."client_id" IS NOT NULL) OR ("pp"."client_id" IS NOT NULL) OR (lower(c.name) LIKE '%金丰%') OR ("c"."pinyin_shortcut" LIKE '%金丰%') OR (lower(c.description) LIKE '%金丰%') OR (lower(c.it_budget) LIKE '%金丰%') OR (lower(c.main_business) LIKE '%金丰%') OR (lower(c.deployment_mode) LIKE '%金丰%') OR (lower(c.it_per_num) LIKE '%金丰%') OR (lower(c.public_relations_difficulty) LIKE '%金丰%') OR (lower(c.it_status) LIKE '%金丰%') OR (lower(c.decision_process) LIKE '%金丰%') OR (lower(c.coach) LIKE '%金丰%') OR (lower(c.competitor) LIKE '%金丰%') OR (lower(c.main_product) LIKE '%金丰%') OR (lower(c.headcount) LIKE '%金丰%') OR (lower(c.peers) LIKE '%金丰%') OR (lower(c.supplier) LIKE '%金丰%')) AND ("sgr"."group_id"='1') AND ("c"."sales_rep"='1001') AND ("c"."sales_rep"='1001') AND ("deleted"=FALSE) GROUP BY "c"."id", "cl"."id", "cooperated", "lost_contact_days", "last_contact" ORDER BY "is_public" DESC, lost_contact_days DESC NULLS LAST, "c"."created_at" DESC LIMIT 20
20:10:06.7873.6 msyii\db\Command::querySELECT * FROM "a57be577deb434"."tbl_visit_module_histories" WHERE ("user_id"=1001) AND ("object_type"=29) AND ("visit_date"='2025-08-30')
20:10:06.6962.3 msyii\db\Command::querySELECT * FROM "global"."vw_user_login" WHERE "id"=1001
20:10:06.6942.1 msyii\db\Connection::openOpening DB connection: pgsql:host=postgresql.server.local;port=5432;dbname=beta
20:10:06.6991.5 msyii\db\Command::querySELECT * FROM "a57be577deb434"."tbl_users" WHERE "id"=1001
20:10:06.7921.1 msyii\db\Command::queryINSERT INTO "global"."tbl_api_log" ("code", "schema", "user_id", "device_type", "url", "request", "response", "php_error", "time") VALUES (200, 'a57be577deb434', 1001, 5, 'vue/account/list-client', '{"ClientSearch":{"group":"1","sales_rep":"1001","target":"5446","keyword":"\u91d1\u4e30"},"Filter":{"name":"lost_contact_days","sort":"ASC"},"page":"1","web_access_token":"GwzcwQPxiTG2B3PUDaCrV_Wl4I70m3do"}', '{"code":2000,"result":{"list":[],"pagenation":{"totalcount":0,"thispage":1,"pagesize":20}},"status":1,"msg":[{"name":"success","success":"\u6210\u529f\u83b7\u53d6\u6570\u636e","error":""}],"mod":0}', FALSE, '2025-08-30 20:10:06') RETURNING "id"
20:10:06.7910.8 msyii\db\Command::executeUPDATE "a57be577deb434"."tbl_visit_module_histories" SET "num"=4, "last_visit_at"='now()' WHERE "id"=55415