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 Answer 1

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 and acknowledge that you have read and understand our privacy policy and code of conduct.

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