0

how to fusion this instructions:

$collection->addFieldToFilter('updated_at', ['from' => $from])
           ->addFieldToFilter('updated_at', ['to' => $to])
or
$collection->addFieldToFilter('created_at', ['from' => $from])
           ->addFieldToFilter('created_at', ['to' => $to]);

1 Answer 1

0
$collection->addFieldToFilter(
    ['created_at', 'updated_at'], // the field names
    [ // the conditions
        [ // the conditions for 'created_at' (first field)
            ['from' => $from],
            ['to' => $to]
        ],
        [ // the conditions for 'updated_at' (second field)
            ['from' => $from],
            ['to' => $to]
        ],
    ]
);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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