app/Http/Controllers/Api/News/NewsController.php
/**
     * get new list
     * limit 15
     * @return string
     */
get new list
limit 15
@return string
get new list limit 15 @return string
public function lists(){
        $list = $this->newDao->where('status',1)->paginate(15)->toArray();
        $data = $list['data'];
        foreach ($data as $key => $value){
            $data[$key]['add_time'] = formatTime($value['add_time']);
            unset($data[$key]['content'],$data[$key]['pv'],$data[$key]['status']);
        }
        return $this->respondWithData(200,$data);
    }
public function lists ( ) { $ list = $ this -> newDao -> where ( 'status' , 1 ) -> paginate ( 15 ) -> toArray ( ) ; $ data = $ list [ 'data' ] ; foreach ( $ data as $ key => $ value ) { $ data [ $ key ] [ 'add_time' ] = formatTime ( $ value [ 'add_time' ] ) ; unset ( $ data [ $ key ] [ 'content' ] , $ data [ $ key ] [ 'pv' ] , $ data [ $ key ] [ 'status' ] ) ; } return $ this -> respondWithData ( 200 , $ data ) ; }
get new list
 limit 15
 @return string
get new list limit 15 @return string