0

I have below query

SELECT * FROM newsletter_subscriber WHERE change_status_at >=  (NOW() - INTERVAL 10 DAY);

How do I make it works with below?

        public function  getSubscriberStatus()
    {
        

        $subscriberCollectionData =$this->subscriberCollection->create();

/***********************query where cause **************************/
        


        foreach($subscriberCollectionData as $subscriber)
{
    print_r($subscriber->getData());
}

        return $subscriberCollectionData;
    }

Thanks!

1

by answer my own question

    public function  getSubscriberStatus()
{
    

    $subscriberCollectionData =$this->subscriberCollection->create();
    $subscriberCollectionData->getSelect()
                ->where(
            'change_status_at >= ?',
            $subscriberCollectionData->getConnection()->getDateSubSql(
                new Zend_Db_Expr('NOW()'),
                '30',
                AdapterInterface::INTERVAL_MINUTE
            )
        );

    return $subscriberCollectionData;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.