1 回答
TA贡献1860条经验 获得超8个赞
当您通过 cron 作业运行查询时,您应该包括 joomla 文件 framework.php 和 defines.php 尝试以下代码
define('_JEXEC', 1);
define('DS', DIRECTORY_SEPARATOR);
define('JPATH_BASE', $_SERVER['DOCUMENT_ROOT'] . DS . '');
require_once (JPATH_BASE . DS . 'includes' . DS . 'defines.php');
require_once (JPATH_BASE . DS . 'includes' . DS . 'framework.php');
$db = JFactory::getDbo();
$query = '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
)';
$db->setQuery($query);
$db->query();
- 1 回答
- 0 关注
- 100 浏览
添加回答
举报