Ejemplo n.º 1
0
 /**
  * 学校列表
  * @method GET_indexAction
  * @author NewFuture
  */
 public function GET_indexAction()
 {
     $fileds = 'id,name,abbr,verify,verifyurl';
     if (Input::get('key', $key)) {
         $key = '%' . strtr($key, ' ', '%') . '%';
         $schools = SchoolModel::where('name', 'LIKE', $key)->select($fileds);
         $this->response(1, $schools);
     } elseif ($schools = SchoolModel::all($fileds)) {
         $this->response(1, $schools);
     } else {
         $this->response(0, '无法查看学校信息');
     }
 }