Page 1 of 1

special price on date_end

Posted: Thu Dec 29, 2016 11:01 am
by arhatron
The sql statement on every related model files of this part is:

Code: Select all

ps.date_end > NOW()
but this is wrong.

For example, if I have a special price from 2016-12-20 to 2016-12-29, and today is the end day, no records will be found. Is this right? I think this is not right.

And this is because date_end 2016-12-29 doesn't bigger than NOW() 2016-12-29 10:50:30
I have to use :

Code: Select all

ps.date_end >= NOW() - INTERVAL 1 DAY
// or
ps.date_end >= CURRENT_DATE()
// or 
ps.date_end >= CURDATE()
I'm curios, in version 2.2.0.0, it is so, and in 2.3.0.2, still the same. No one report this bug?
Or some thing with my understanding?

Re: special price on date_end

Posted: Thu Dec 29, 2016 8:38 pm
by thekrotek
arhatron wrote:I'm curios, in version 2.2.0.0, it is so, and in 2.3.0.2, still the same. No one report this bug?
Or some thing with my understanding?
Nope, there's nothing bad with your understanding. The right code is:

Code: Select all

ps.date_end >= CURDATE()