</a> </div> </div> <div class="portlet-body"> <p><?php echo Html::a('下载 <i class="glyphicon glyphicon-arrow-down"></i>', U::current(['download' => 1]), ['class' => 'btn btn-success', 'data-pjax' => '0']); ?> </p> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'mobile', 'value' => function ($model, $key, $index, $column) { return $model->mobile; }], ['attribute' => 'name', 'format' => 'raw', 'value' => function ($model, $key, $index, $column) { //VIP级别 加入时间 开始时间 结束时间 $cusername = $model->name; $level = \app\models\VipLevel::items($model->vip_level_id); $vip_join_time = $model->isVip() ? $model->getVipJoinTime() : ''; $vip_start_time = $model->isVip() ? $model->getVipStartTime() : ''; $vip_end_time = $model->isVip() ? $model->getVipEndTime() : ''; $customlist = "VIP级别 " . $level . "<br>加入时间 " . $vip_join_time . "<br>开始时间 " . $vip_start_time . "<br>结束时间 " . $vip_end_time; //return $model->name." <a style='float:right' tabindex='0' class='btn btn-info glyphicon glyphicon-th-list' role='button' data-trigger='focus' title='".$cusername."' data-toggle='popover' data-placement='right' data-content='".$customlist."'></a>"; return $model->name; }], ['label' => '微信信息', 'format' => 'html', 'value' => function ($model, $key, $index, $column) { if (empty($model->user)) { return "<img width=48 src='/wx/web/images/wxmpres/headimg-nowx-blank.png' title='微信未绑定'>"; } else { $mobiles = $model->user->getBindMobileNumbers(); $mobile = empty($mobiles) ? '无' : $mobiles[0]; if (empty($model->user->headimgurl)) { return "<img style='float:left;' width=48 src='/wx/web/images/wxmpres/headimg-blank.png'> <span style='color:#aaa'>昵称 " . $model->user->nickname . "<br> 地区 " . $model->user->country . " " . $model->user->province . " " . $model->user->city . "<br> 绑定手机 " . $mobile . "</span>"; } else {
--> <p> <?php echo Html::a('下载 <i class="glyphicon glyphicon-arrow-down"></i>', U::current(['download' => 1]), ['class' => 'btn btn-success', 'data-pjax' => '0']); ?> </p> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => ['mobile', 'name', ['attribute' => 'is_vip', 'format' => 'html', 'value' => function ($model, $key, $index, $column) { return $model->isVip() ? "是" : "否"; }, 'filter' => ['0' => '否', '1' => '是']], ['label' => '部门名称', 'attribute' => 'office_id', 'value' => function ($model, $key, $index, $column) { return empty($model->office->title) ? '' : $model->office->title; }, 'filter' => MOffice::getOfficeNameOptionSimple2('gh_03a74ac96138', false, false), 'headerOptions' => array('style' => 'width:200px;'), 'visible' => Yii::$app->user->getIsAdmin()], ['attribute' => 'vip_level_id', 'value' => function ($model, $key, $index, $column) { return \app\models\VipLevel::items($model->vip_level_id); }, 'filter' => \app\models\VipLevel::items()], ['attribute' => 'vip_join_time', 'value' => function ($model, $key, $index, $column) { return $model->isVip() ? $model->getVipJoinTime() : ''; }], ['attribute' => 'vip_start_time', 'value' => function ($model, $key, $index, $column) { return $model->isVip() ? $model->getVipStartTime() : ''; }], ['attribute' => 'vip_end_time', 'value' => function ($model, $key, $index, $column) { return $model->isVip() ? $model->getVipEndTime() : ''; }], ['label' => '是否绑定', 'value' => function ($model, $key, $index, $column) { return empty($model->openidBindMobile) ? '否' : '是'; }], ['label' => '微信昵称', 'value' => function ($model, $key, $index, $column) { return empty($model->openidBindMobile->user->nickname) ? '' : $model->openidBindMobile->user->nickname; }]]]); ?> </div>
echo $form->field($model, 'mobile')->textInput(['maxlength' => 32]); ?> <?php echo $form->field($model, 'name')->textInput(['maxlength' => 16]); ?> <?php echo $form->field($model, 'is_vip')->textInput(); ?> <?php echo $form->field($model, 'office_id')->textInput(['maxlength' => 10]); ?> <?php echo $form->field($model, 'vip_level_id')->dropDownList(\app\models\VipLevel::items()); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> <?php ActiveForm::end(); ?> </div>