fix customer invited count
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user