当前位置: 首页>>代码示例>>PHP>>正文


PHP Usuario::find方法代码示例

本文整理汇总了PHP中app\models\Usuario::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Usuario::find方法的具体用法?PHP Usuario::find怎么用?PHP Usuario::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\models\Usuario的用法示例。


在下文中一共展示了Usuario::find方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: destroy

 public function destroy($id)
 {
     $usuarios = Usuario::find($id);
     $usuarios->delete();
     Session::flash('message', 'El usuario ' . $usuarios->nombres . '  de rut ' . $usuarios->rut . ' fue eliminado');
     return redirect()->route('Administrador.usuarios.index');
 }
开发者ID:jaime1992,项目名称:Proyecto-Sala-Utem,代码行数:7,代码来源:UsuariosController.php

示例2: usuario_existe

 public function usuario_existe($attribute, $params)
 {
     $table = Usuario::find()->where("nombre_usuario=:nom", [":nom" => $this->nombre_usuario]);
     if ($table->count() != 0) {
         $this->addError($attribute, "El nobre de usuario seleccionado existe");
     }
 }
开发者ID:lucho314,项目名称:cae,代码行数:7,代码来源:ValidarProfesor.php

示例3: findByUsername

 /**
  * Finds user by username
  *
  * @param  string      $username
  * @return static|null
  */
 public static function findByUsername($username)
 {
     $dbUser = DbUser::find()->where(["username" => $username])->one();
     if (!count($dbUser)) {
         return null;
     }
     return new static($dbUser);
 }
开发者ID:sdram58,项目名称:proyectofinal,代码行数:14,代码来源:User.php

示例4: __construct

 public function __construct(Factory $factory)
 {
     //Custom Validator Rut
     $factory->extend('old_password', function ($attribute, $value, $parameters) {
         $id = $this->id;
         $usuario = Usuario::find($id);
         return Hash::check($value, $usuario->password);
     }, 'La Constraseña actual no corresponde');
     $factory->extend('rut_valid', function ($attribute, $value, $parameters) {
         return Rut::check($value);
     }, 'El campo Rut no tiene un formato válido');
 }
开发者ID:ProyectoSanClemente,项目名称:proyectoapi5.1,代码行数:12,代码来源:UpdateUsuarioRequest.php

示例5: showconversations

 /**
  * Display all conversations
  *
  * @return data array json
  */
 public function showconversations()
 {
     //$results = DB::select('select * from conversations where user1_id = ?', dataay($input['user1_id']));
     $conversations = Conversation::where('user1_id', Input::get('user1_id'))->orderBy('updated_at', 'DESC')->get();
     foreach ($conversations as $conversation) {
         //Se rellenan las imagenes de usuario en la lista de conversaciones
         $id = $conversation->user2_id;
         //ID del usuario a buscar
         $imagen = Usuario::find($id)->imagen;
         $conversation['imagen'] = $imagen;
     }
     return json_encode($conversations);
 }
开发者ID:ProyectoSanClemente,项目名称:proyectoapi5.1,代码行数:18,代码来源:ConversationController.php

示例6: search

 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Usuario::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['idUsuario' => $this->idUsuario, 'nome' => $this->nome, 'email' => $this->email, 'telefone' => $this->telefone, 'data_criacao' => $this->data_criacao]);
     return $dataProvider;
 }
开发者ID:danilomeneghel,项目名称:yii2,代码行数:20,代码来源:UsuarioBusca.php

示例7: search

 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Usuario::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'id_persona' => $this->id_persona]);
     $query->andFilterWhere(['like', 'usuario', $this->usuario])->andFilterWhere(['like', 'contrasenha', $this->contrasenha]);
     return $dataProvider;
 }
开发者ID:rolion,项目名称:taller1,代码行数:21,代码来源:UsuarioSearch.php

示例8: search

 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Usuario::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['usua_codigo' => $this->usua_codigo, 'usua_habilitado' => $this->usua_habilitado, 'usua_data_criacao' => $this->usua_data_criacao, 'usua_data_alteracao' => $this->usua_data_alteracao]);
     $query->andFilterWhere(['like', 'usua_nome', $this->usua_nome])->andFilterWhere(['like', 'usua_email', $this->usua_email])->andFilterWhere(['like', 'usua_senha', $this->usua_senha])->andFilterWhere(['like', 'usua_auth_key', $this->usua_auth_key]);
     return $dataProvider;
 }
开发者ID:6758144,项目名称:divus-php,代码行数:21,代码来源:UsuarioSearch.php

示例9: search

 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Usuario::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'activate' => $this->activate]);
     $query->andFilterWhere(['like', 'username', $this->username])->andFilterWhere(['like', 'email', $this->email])->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'lastname', $this->lastname])->andFilterWhere(['like', 'role', $this->role])->andFilterWhere(['like', 'password', $this->password])->andFilterWhere(['like', 'authKey', $this->authKey])->andFilterWhere(['like', 'accessToken', $this->accessToken]);
     return $dataProvider;
 }
开发者ID:erpachecomo,项目名称:TuPortalPersonal,代码行数:21,代码来源:UsuarioSearch.php

示例10: search

 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Usuario::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['Id_Grupo' => $this->Id_Grupo, 'Id' => $this->Id, 'Id_Empleado' => $this->Id_Empleado, 'Eliminado' => $this->Eliminado]);
     $query->andFilterWhere(['like', 'Cuenta', $this->Cuenta])->andFilterWhere(['like', 'Contrasena', $this->Contrasena]);
     return $dataProvider;
 }
开发者ID:rolion,项目名称:ventacompra,代码行数:21,代码来源:UsuarioSearch.php

示例11: search

 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Usuario::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id]);
     $query->andFilterWhere(['like', 'login', $this->login])->andFilterWhere(['like', 'senha', $this->senha])->andFilterWhere(['like', 'nome', $this->nome])->andFilterWhere(['like', 'email', $this->email])->andFilterWhere(['like', 'pagina', $this->pagina]);
     return $dataProvider;
 }
开发者ID:kalleycorrea,项目名称:progweb,代码行数:21,代码来源:UsuarioSearch.php

示例12: search

 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Usuario::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['idusuario' => $this->idusuario]);
     $query->andFilterWhere(['like', 'nombre', $this->nombre])->andFilterWhere(['like', 'edad', $this->edad])->andFilterWhere(['like', 'sexo', $this->sexo])->andFilterWhere(['like', 'apellido_pat', $this->apellido_pat])->andFilterWhere(['like', 'apellido_mat', $this->apellido_mat]);
     return $dataProvider;
 }
开发者ID:cesartejeda,项目名称:ProyectoFinal,代码行数:21,代码来源:UsuarioSearch.php

示例13: login

 public function login()
 {
     $input = Input::all();
     $lembreMe = empty($input['lembre_me']) ? false : true;
     if (Auth::attempt(['usuario' => $input['usuario'], 'password' => $input['senha']], $lembreMe)) {
         $pessoa = Usuario::find(Auth::user()->id)->first();
         session()->put('user_nome', $pessoa->nome);
         session()->put('user_email', $pessoa->email);
         session()->put('user_usuario', $pessoa->usuario);
         session()->put('user_id', $pessoa->id);
         return redirect('admin/home');
     }
     flash()->error('Login', trans('admin.msg_usuario_error'));
     return $this->wbd->view('backend.pages.login.index');
 }
开发者ID:filipepaladino,项目名称:base-admin,代码行数:15,代码来源:AuthController.php

示例14: show

 public function show($id)
 {
     $usuarios = Usuario::find($id);
     //dd($Campus);
     if ($usuarios) {
         $data = array(array('rut', 'nombres', 'apellidos', 'email'), array($estudiantes->rut, $estudiantes->nombres, $estudiantes->apellidos, $estudiantes->email));
         Excel::create('Usuarios' . $usuarios->nombres, function ($excel) use($data) {
             $excel->sheet('Sheetname', function ($sheet) use($data) {
                 $sheet->fromArray($data);
             });
         })->download('csv');
     } else {
         abort('404');
     }
 }
开发者ID:jaime1992,项目名称:Proyecto-Sala-Utem,代码行数:15,代码来源:ArchivoUsuariosController.php

示例15: search

 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Usuario::find();
     // add conditions that should always apply here
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     // grid filtering conditions
     $query->andFilterWhere(['id' => $this->id, 'dtEntrada' => $this->dtEntrada, 'isAdmin' => $this->isAdmin, 'isAtivo' => $this->isAtivo]);
     $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'cpf', $this->cpf])->andFilterWhere(['like', 'email', $this->email])->andFilterWhere(['like', 'password', $this->password])->andFilterWhere(['like', 'matricula', $this->matricula])->andFilterWhere(['like', 'siape', $this->siape])->andFilterWhere(['like', 'perfil', $this->perfil])->andFilterWhere(['like', 'auth_key', $this->auth_key])->andFilterWhere(['like', 'password_reset_token', $this->password_reset_token]);
     return $dataProvider;
 }
开发者ID:tammy00,项目名称:paps,代码行数:23,代码来源:UsuarioSearch.php


注:本文中的app\models\Usuario::find方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。