将Magento PHP查询限制为持续30分钟

将Magento PHP查询限制为持续30分钟,php,magento,zend-db,Php,Magento,Zend Db,我已经尝试了很多方法来过滤这些信息,我被困在这里,非常感谢您的帮助。 更新的_at发布为: 2014-08-29 16:59:43 当前正在获取错误: DATEADD在/chroot/home/campdev/dev8.campsaver.com/html/lib/Zend/Db/Statement/Pdo.php:228中不存在 $res = Mage::getSingleton('core/resource'); $ordersTable = $res->getTableNam

我已经尝试了很多方法来过滤这些信息,我被困在这里,非常感谢您的帮助。 更新的_at发布为: 2014-08-29 16:59:43

当前正在获取错误: DATEADD在/chroot/home/campdev/dev8.campsaver.com/html/lib/Zend/Db/Statement/Pdo.php:228中不存在

    $res = Mage::getSingleton('core/resource'); $ordersTable = $res->getTableName('sales/order');
    $db = $res->getConnection('sales_read'); 
    $lastEntityId = 0; $sql = new Varien_Db_Select($db);
    if ($lastOrder) { $lastEntityId = self::getOrderEntityId($db, $sql, $lastDate, $lastOrder); }
    $sql = $db->select()
              ->from($ordersTable, 'entity_id')
              ->where('store_id=?', self::$_storeId, Zend_Db::INT_TYPE)
              ->where('updated_at < DATEADD(minute, -, GETDATE())')
              ->where("entity_id > $lastEntityId")
              ->limit($batchsize, $startnum);
    if (self::$_debug) { echo "Executing SQL: $sql\r\n"; }
    $ordRows = $db->fetchAll($sql);
$res=Mage::getSingleton('core/resource')$ordersTable=$res->getTableName('sales/order');
$db=$res->getConnection('sales_read');
$lastEntityId=0$sql=新变量数据库选择($Db);
如果($lastOrder){$lastEntityId=self::getOrderEntityId($db,$sql,$lastDate,$lastOrder);}
$sql=$db->select()
->from($ordersTable,'entity_id'))
->其中('store\u id=?',self::$\u storeId,Zend\u Db::INT\u TYPE)
->其中('updated_at其中(“实体id>$lastEntityId”)
->限制($batchsize,$startnum);
if(self::$_debug){echo“正在执行SQL:$SQL\r\n”;}
$ordRows=$db->fetchAll($sql);

RTFM?这是
DATE\u ADD
touch。我已经使用mssql好几个星期了,这让我很扫兴。