Exemplo n.º 1
0
Arquivo: Maker.php Projeto: kkkiii/gnw
 public function trans_prov($id)
 {
     $prov = Prov::find()->where('id =' . $id)->one();
     return $prov->provname;
 }
Exemplo n.º 2
0
Arquivo: _form.php Projeto: kkkiii/gnw
    <?php 
$form = ActiveForm::begin([]);
?>
<div class="form-inline">
    <?php 
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'gender')->dropDownList(['女' => '女', '男' => '男']);
?>
</div>
	<div class="form-inline">
    <?php 
echo $form->field($model, 'prov')->dropDownList(ArrayHelper::map(Prov::find()->all(), 'id', 'provname'), ['prompt' => '选个省直/辖市', 'onchange' => '
                                        $.post( "index.php?r=maker/lists&id=' . '"+$(this).val(), function( data ) {
                                            $( "select#maker-city" ).html( data );
                                        });']);
?>

    <?php 
echo $form->field($model, 'city')->dropDownList(ArrayHelper::map(City::find()->all(), 'id', 'cityname'), []);
?>
    
    
    
    </div>
    <?php 
echo $form->field($model, 'begoodat')->checkboxlist(ArrayHelper::map(Begoodatprof::find()->all(), 'id', 'begoodat'), [0, 2]);
?>
Exemplo n.º 3
0
Arquivo: City.php Projeto: kkkiii/gnw
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getProv()
 {
     return $this->hasOne(Prov::className(), ['id' => 'prov_id']);
 }