示例#1
0
 public function getUser()
 {
     if ($this->_user === false) {
         $this->_user = Usuario::findByUsername($this->usuario);
     }
     return $this->_user;
 }
示例#2
0
文件: Persona.php 项目: RodmanII/sgm
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getNombreUsuario()
 {
     return $this->hasOne(Usuario::className(), ['nombre' => 'nombre_usuario']);
 }
示例#3
0
文件: _form.php 项目: RodmanII/sgm
?>

    <?php 
echo $form->field($model, 'cod_estado_civil')->dropDownList(ArrayHelper::map(EstadoCivil::find()->all(), 'codigo', 'nombre'));
?>

    <?php 
if ($model->isNewRecord) {
    echo $form->field($model, 'nombre_usuario')->dropDownList(ArrayHelper::map(Usuario::find()->where('NOT EXISTS
        (
        SELECT  nombre_usuario
        FROM    persona
        WHERE   persona.nombre_usuario = usuario.nombre
        )')->all(), 'nombre', 'nombre'), ['prompt' => 'Seleccione un usuario']);
} else {
    echo $form->field($model, 'nombre_usuario')->dropDownList(ArrayHelper::map(Usuario::find()->all(), 'nombre', 'nombre'), ['prompt' => 'Seleccione un usuario']);
}
?>

    <?php 
echo $form->field($model, 'carnet_minoridad')->textInput(['maxlength' => true]);
?>

    <?php 
echo '<div class="cflex">';
echo '<span style="order: 1; flex-grow: 1; margin-right:10px;">';
if ($model->isNewRecord) {
    echo Html::label('Es Informante', 'esinfor');
    echo Html::radioList('informante', 'No', ['Si' => 'Si', 'No' => 'No'], ['id' => 'esinfor']);
    echo Html::label('Firma', 'firin');
    echo Html::fileInput('firma', null, ['id' => 'firin', 'enable' => false, 'class' => 'form-control']);
示例#4
0
文件: Rol.php 项目: RodmanII/sgm
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getUsuarios()
 {
     return $this->hasMany(Usuario::className(), ['cod_rol' => 'codigo']);
 }