1 回答

TA貢獻(xiàn)1860條經(jīng)驗(yàn) 獲得超8個(gè)贊
當(dāng)您通過(guò) cron 作業(yè)運(yùn)行查詢時(shí),您應(yīng)該包括 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 關(guān)注
- 125 瀏覽
添加回答
舉報(bào)