예제 #1
0
 /**
  * 获取书籍列表
  * @method GET_indexAction
  * @author NewFuture
  */
 public function GET_indexAction()
 {
     Input::get('page', $page, 'int', 1);
     $Book = BookModel::order('count', 'DESC')->page($page);
     if (Input::get('key', $key, 'tag')) {
         $key = '%' . strtr($key, ' ', '%') . '%';
         $Book->where('name', 'LIKE', $key)->orWhere('detail', 'LIKE', $key);
     }
     $books = $Book->select('id,name,detail,pri_id');
     $this->response(1, $books);
 }