fix customer invited count

This commit is contained in:
Timi
2026-08-25 17:57:54 +08:00
parent 2b11bdf65e
commit 0239697a2b
4 changed files with 22 additions and 7 deletions
@@ -0,0 +1,9 @@
UPDATE `gao_customer` AS `customer`
SET `invited_count` = (
SELECT COUNT(1)
FROM `gao_customer` AS `invitee`
WHERE
`invitee`.`introducer_customer_id` = `customer`.`id`
AND `invitee`.`deleted_at` IS NULL
)
WHERE `customer`.`deleted_at` IS NULL;