azhurb / stalker_portal

A project that can provide quick and effectively organized access to the video services based on IP networks.
http://www.infomir.eu/eng/products/free-middleware-stalker/
175 stars 151 forks source link

epg crontab problem #255

Open blinkinglight opened 8 years ago

blinkinglight commented 8 years ago

hi, i have problem with epg. when i press in admin "force update for epg" epg is ok. but then i run command line task update_epg.php in force mode, epg shows strange dates.

azhurb commented 8 years ago

Can you show this strange dates?

blinkinglight commented 8 years ago

its only in mag254, mange epg looks good incorrect (update_epg.php task) https://cl.ly/0u1N1E1E390P correct (web force update for epg) https://cl.ly/3q19363B2n3J epg id 303 http://dev-cfg.rubibox.lt/tmp.xml date: 2016-06-26 in db epg table time mismatch titles

blinkinglight commented 8 years ago

i view what query returns: ` public function getCurProgramAndFewNext($ch_id, $num_programs){

    $cur_program = $this->getCurProgram($ch_id);

    if (empty($cur_program['id'])){
        return array();
    }

    $epg = $this->db->from('epg')
        /// Mysql time format, see https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_date-format
        ->select('epg.*, UNIX_TIMESTAMP(epg.time) as start_timestamp, UNIX_TIMESTAMP(epg.time_to) as stop_timestamp, TIME_FORMAT(epg.time,"'._('%H:%i').'") as t_time, TIME_FORMAT(epg.time_to,"%H:%i") as t_time_to')
        ->where(
            array(
                'epg.ch_id' => $ch_id,
                'epg.time>='  => $cur_program['time']
            ))
        ->orderby('epg.time')
        ->limit($num_programs)
        ->get()
        ->all();

error_log(json_encode($epg)); `

and i got "{"id":"2888349","ch_id":"86","time":"2016-10-22 14:00:00","time_to":"2016-10-22 14:30:00","duration":"1800","name":"Transformeriai. Praimas",....."

but if i run query in mysql i got this mysql> select name,TIME_FORMAT(epg.time_to,"%H:%i") as t_time_to from epg where time >= '2016-10-22 14:00:00' and ch_id = 86 order by time asc limit 1; +---------+-----------+ | name | t_time_to | +---------+-----------+ | Dvyniai | 16:45 | +---------+-----------+ 1 row in set (0.00 sec)

whats wrong with getCurProgramAndFewNext generated query?