コード例 #1
0
ファイル: _form.php プロジェクト: noikiy/wowewe
<div class="muser-account-form">

    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, 'amount')->textInput();
?>

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

    <?php 
echo $form->field($model, 'cat')->dropDownList(MUserAccount::getCatOptionName());
?>

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

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? Yii::t('app', '新建') : Yii::t('app', '修改'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php 
ActiveForm::end();
?>
コード例 #2
0
ファイル: index.php プロジェクト: noikiy/wowewe
    </p>
    -->

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'options' => ['class' => 'table-responsive'], 'tableOptions' => ['class' => 'table table-striped'], 'columns' => [['label' => false, 'format' => 'html', 'value' => function ($model, $key, $index, $column) {
    if (empty($model->user->headimgurl)) {
        return '';
    }
    $headimgurl = Html::img(U::getUserHeadimgurl($model->user->headimgurl, 46), ['style' => 'width:46px;']);
    return $headimgurl;
}], ['label' => '微信昵称', 'value' => function ($model, $key, $index, $column) {
    return empty($model->user->nickname) ? '' : $model->user->nickname;
}], 'create_time', ['attribute' => 'amount', 'value' => function ($model, $key, $index, $column) {
    return $model->getAmountInfo();
}], ['attribute' => 'status', 'label' => '状态', 'value' => function ($model, $key, $index, $column) {
    return MUserAccount::getStatusDesc($model->status);
}, 'filter' => MUserAccount::getStatusDesc(), 'headerOptions' => array('style' => 'width:120px;')], ['attribute' => 'cat', 'value' => function ($model, $key, $index, $column) {
    return MUserAccount::getCatOptionName($model->cat);
}, 'filter' => MUserAccount::getCatOptionName()], ['attribute' => 'memo', 'value' => function ($model, $key, $index, $column) {
    return $model->getMemoInfo();
}], 'scene_id', 'charge_mobile', ['class' => 'yii\\grid\\ActionColumn', 'template' => '{update} {delete}']]]);
?>

</div>

<?php 
/*
    <h2>
        账户余额: <?= $user->getUserAccountBalanceInfo(); ?>
    </h2>
*/