Post by arhatron » Thu Dec 29, 2016 11:01 am

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?

New member

Posts

Joined
Wed Sep 07, 2016 12:38 pm

Post by thekrotek » Thu Dec 29, 2016 8:38 pm

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()

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am

Who is online

Users browsing this forum: No registered users and 4 guests