public function getUserOpts($op=null) { $ret=User::model() ->active() ->with(array('userTypeVal.userType' => array('alias' => 'ut'))); if(empty($op)) { return $ret->findAll('ut.name="company-official"'); } else { return $ret->find('ut.name="company-official" and t.id=:uid',array(':uid'=>$op)); } }
Monthly Archives: October 2015
How to set timezone to Europe/Istanbul on Linux servers
On deabian systems, we can use the following command to do this:
dpkg-reconfigure tzdata
You should select “Europe” from first menu and “Istanbul” from second menu. Example output:
Current default time zone: 'Europe/Istanbul' Local time is now: Sun Oct 18 14:14:34 EEST 2015.
How to calculate one day ago date time using MySQL
We should use the following statement to calculate one day ago date time using MySQL:
SELECT NOW() - INTERVAL 1 DAY;