Created
June 1, 2022 18:18
-
-
Save developerinusa/697644d5097974e8f9c09501f10d9efa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE users | |
INNER JOIN ( | |
SELECT sk.username, sk.name, sk.surname, sk.last_access, TO_DAYS(CURDATE()) - TO_DAYS(LEFT(last_access,10)) AS passive_days | |
FROM users AS sk | |
WHERE ( TO_DAYS(CURDATE()) - TO_DAYS(LEFT(last_access,10)) >= 8 OR (last_access='0000-00-00 00:00:00' AND TO_DAYS(CURDATE()) - TO_DAYS(LEFT(created_at,10)) >= 8) ) | |
AND sk.id > 0 | |
AND status NOT IN (0,-1) | |
) AS SQL1 ON SQL1.username = users.username | |
SET sys_kullanici.status = -30 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment