我已经创建了这些查询(并在 PhpMyAdmin 中测试了它们),现在需要在我的 Joomla! 上运行它们。数据库使用调用 .php 文件的 CRON 作业。
DELETE FROM j25_virtuemart_vmuser_shoppergroups WHERE id IN(
SELECT * FROM (
SELECT SG.id FROM j25_virtuemart_vmuser_shoppergroups SG
JOIN j25_acym_user AU on AU.cms_id = SG.virtuemart_user_id
JOIN j25_acym_user_has_list AUL ON AUL.user_id = AU.id
where SG.virtuemart_shoppergroup_id = 10 AND (AUL.list_id = 13 AND AUL.status=0)
) as P
);
INSERT INTO j25_virtuemart_vmuser_shoppergroups (virtuemart_user_id, virtuemart_shoppergroup_id)
SELECT * FROM( SELECT cms_id, '10'
FROM j25_acym_user_has_list AUL
left JOIN j25_acym_user AU ON AUL.user_id = AU.id
left JOIN j25_virtuemart_vmuser_shoppergroups SG on AU.cms_id = SG.virtuemart_user_id
where SG.virtuemart_shoppergroup_id IS NULL AND (AUL.list_id = 13 AND AUL.status=1)) as foo
ON duplicate KEY update
virtuemart_shoppergroup_id=virtuemart_shoppergroup_id;
我如何将它变成一个(或 2 个)我可以使用 WGET 调用的工作 PHP 文件?
桃花长相依