19:36:46.074 | trace | yii\base\Application::bootstrap | Bootstrap with yii\log\Dispatcher |
19:36:46.074 | trace | yii\base\Module::getModule | Loading module: debug |
19:36:46.075 | trace | yii\base\Application::bootstrap | Bootstrap with yii\debug\Module::bootstrap() |
19:36:46.075 | trace | yii\redis\Connection::open | Opening redis DB connection: redis.server.local:6379, database=1 |
19:36:46.075 | trace | yii\redis\Connection::executeCommand | Executing Redis Command: SELECT |
19:36:46.075 | trace | yii\redis\Connection::executeCommand | Executing Redis Command: GET |
19:36:46.075 | trace | yii\base\Module::getModule | Loading module: gii |
19:36:46.075 | trace | yii\base\Application::bootstrap | Bootstrap with yii\gii\Module::bootstrap() |
19:36:46.075 | trace | yii\web\UrlManager::parseRequest | No matching URL rules. Using default URL parsing logic. |
19:36:46.075 | trace | yii\web\Application::handleRequest | Route requested: 'vue/client/save-transfer' |
19:36:46.075 | trace | yii\base\Module::getModule | Loading module: vue |
19:36:46.076 | info | yii\web\Session::open | Session started |
19:36:46.076 | info | yii\db\Command::query | SELECT * FROM "global"."vw_user_login" WHERE "id"=1001 |
19:36:46.076 | info | yii\db\Connection::open | Opening DB connection: pgsql:host=postgresql.server.local;port=5432;dbname=beta |
19:36:46.081 | trace | yii\redis\Connection::executeCommand | Executing Redis Command: GET |
19:36:46.082 | trace | yii\redis\Connection::executeCommand | Executing Redis Command: MGET |
19:36:46.082 | trace | yii\redis\Connection::executeCommand | Executing Redis Command: GET |
19:36:46.082 | trace | yii\redis\Connection::executeCommand | Executing Redis Command: MGET |
19:36:46.082 | info | yii\db\Command::query | SELECT * FROM "a57be577deb434"."tbl_users" WHERE "id"=1001 |
19:36:46.084 | trace | yii\base\Controller::runAction | Route to run: vue/client/save-transfer |
19:36:46.084 | trace | yii\redis\Connection::executeCommand | Executing Redis Command: GET |
19:36:46.085 | trace | uranus\rbac\DbManager::checkAccessFromCache | Checking role: Admin |
19:36:46.085 | trace | yii\base\InlineAction::runWithParams | Running action: app\modules\vue\controllers\ClientController::actionSaveTransfer() |
19:36:46.085 | trace | yii\redis\Connection::executeCommand | Executing Redis Command: GET |
19:36:46.085 | trace | yii\redis\Connection::executeCommand | Executing Redis Command: MGET |
19:36:46.086 | trace | yii\redis\Connection::executeCommand | Executing Redis Command: GET |
19:36:46.086 | trace | yii\redis\Connection::executeCommand | Executing Redis Command: GET |
19:36:46.088 | info | yii\db\Command::query | 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 221::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 221::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 WHERE (("c"."sales_rep" IN (1001, 5049, 5301, 5022, 5209, 5026, 5293, 5309, 5356, 5329, 5299, 5303, 5302, 5332, 5047, 1026, 5096, 5070, 5448, 5420, 1029, 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, 5412, 5409, 5229, 1005, 5304, 5449, 5358, 1006, 5093)) OR ("c"."sales_rep" IS NULL) OR ("c"."id" IN (SELECT "client_id" FROM "a57be577deb434"."tbl_user_visit_clients" WHERE "user_id"=1001))) AND ("deleted"=FALSE) AND (1=0) GROUP BY "c"."id", "cl"."id", "cooperated", "lost_contact_days", "last_contact" ORDER BY "is_public" DESC |
19:36:46.095 | info | yii\db\Command::query | SELECT * FROM "a57be577deb434"."tbl_users" WHERE "id" IS NULL |
19:36:46.096 | info | yii\db\Command::query | SELECT "id" FROM "a57be577deb434"."tbl_sales_contracts" WHERE 0=1 |
19:36:46.096 | info | yii\db\Command::execute | |
19:36:46.096 | info | yii\db\Command::execute | UPDATE "a57be577deb434"."tbl_clients" SET "sales_rep"=NULL, "pick_at"='now()', "updated_at"='now()', "is_overdue_remind"=FALSE WHERE 0=1 |
19:36:46.097 | trace | yii\redis\Connection::executeCommand | Executing Redis Command: GET |
19:36:46.097 | trace | yii\redis\Connection::executeCommand | Executing Redis Command: MGET |
19:36:46.097 | info | yii\db\Command::execute | UPDATE "a57be577deb434"."tbl_client_sales_rep_rels" SET "end_at"='now()' WHERE (0=1) AND ("end_at" IS NULL) |
19:36:46.097 | trace | yii\redis\Connection::executeCommand | Executing Redis Command: GET |
19:36:46.098 | trace | yii\redis\Connection::executeCommand | Executing Redis Command: MGET |
19:36:46.098 | info | yii\db\Command::execute | UPDATE "a57be577deb434"."tbl_schedules" SET "end_at"='now()', "is_complete"=TRUE, "is_closed"=TRUE WHERE (0=1) AND ("is_complete"=FALSE) |
19:36:46.098 | trace | yii\redis\Connection::executeCommand | Executing Redis Command: GET |
19:36:46.098 | trace | yii\redis\Connection::executeCommand | Executing Redis Command: MGET |
19:36:46.098 | info | yii\db\Command::execute | UPDATE "a57be577deb434"."tbl_projects" SET "created_by"=NULL, "updated_at"='now()' WHERE 0=1 |
19:36:46.099 | info | yii\db\Command::execute | |
19:36:46.099 | info | yii\db\Command::execute | |
19:36:46.099 | trace | yii\redis\Connection::executeCommand | Executing Redis Command: INCR |
19:36:46.099 | trace | yii\redis\Connection::executeCommand | Executing Redis Command: HSET |
19:36:46.099 | trace | yii\redis\Connection::executeCommand | Executing Redis Command: LPUSH |
19:36:46.099 | trace | yii\redis\Connection::executeCommand | Executing Redis Command: GET |
19:36:46.099 | trace | yii\redis\Connection::executeCommand | Executing Redis Command: MGET |
19:36:46.099 | info | yii\db\Command::query | INSERT INTO "global"."tbl_api_log" ("code", "schema", "user_id", "device_type", "url", "request", "response", "php_error", "time") VALUES (200, 'a57be577deb434', 1001, 5, 'vue/client/save-transfer', '[]', '{"code":2000,"result":{"status":1},"status":1,"msg":[{"name":"success","success":"\u5ba2\u6237\u5df2\u7ecf\u6210\u529f\u8f6c\u79fb","error":""}],"mod":0}', FALSE, '2025-08-09 19:36:46') RETURNING "id" |
19:36:46.101 | trace | yii\redis\Connection::executeCommand | Executing Redis Command: GET |
19:36:46.101 | trace | yii\redis\Connection::executeCommand | Executing Redis Command: SET |