I have a typical function in model which is receiving time from table Orders :
public function get_time() {
$result = array();
$result = DB::select( id , time , description )->from( orders )->execute();
return $result;
}
问题是,时间领域以格式储存在MySQL中:
But I don t need seconds, so I can do: date( H:i , strtotime($time));
Doing this in a View isn t good idea. I need to do this conversion in Model or Controller.
Of course:
$result[ time ] = date( H:i , strtotime(result[ time ]));
a. 获得工作;