Activeform checkbox 一个问题 [ 2.0 版本 ]
我的数据库里有一列数据是用户的消费值, 现在在用Activeform 生成查询页面的时候, 想用一个单选框选择, 用来选择消费值低于100的用户, 这种怎么用Activeform生成, 后台怎么接收?
秀小川 补充于 2017-11-22 10:07
类似于这种效果的选择框
最佳答案
其他 3 个回答
-
这是效果图:
代码:<?php $form = zActiveForm::begin([ 'action' => ['index'], 'method' => 'get', 'options' => ['data-pjax' => 'pjax-list'], 'enableClientValidation' => false ]); ?> <div class="dis_search"> <div class="form-inline search_first"> <?= $form->field($model, 'date_type')->dropDownList(searchOrderMain::$date_type_array)->label(null, ['Yii' => 'normal'])->error(false) ?> <?= $form->field($model, 'date_from', ['options' => ['class' => 'input-group date form_date']])->textInput(['unit' => '<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>'])->label(false)->error(false) ?> -- <?= $form->field($model, 'date_to', ['options' => ['class' => 'input-group date form_date']])->textInput(['unit' => '<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>'])->label(false)->error(false) ?> <?= $form->field($model, 'hotel_name')->textInput(['placeHolder' => '酒店名称'])->label('酒店名称', ['Yii' => 'normal'])->error(false) ?> <?= $form->field($model, 'channel_id')->dropDownList(ArrayHelper::map($model_list, 'ID', 'SUPPLIER_NAME'), ['prompt' => '请选择', 'class' => 'form-control select_screen', 'style' => 'width:172px;'])->label('销售渠道', ['Yii' => 'normal'])->error(false) ?> </div> <div class="form-inline search_second"> <?= $form->field($model, 'diret_flag')->dropDownList([0 => '请选择', 556 => '直连订单', 557 => '非直连订单'])->label('订单类型', ['Yii' => 'normal'])->error(false) ?> <?= $form->field($model, 'confirm_num')->dropDownList([0 => '请选择', 1 => '有', 2 => '无'])->label('确认号', ['Yii' => 'normal'])->error(false) ?> <?= $form->field($model, 'search_key')->textInput(['placeHolder' => '订单号/渠道订单号/客人姓名/客人电话', 'style' => 'width:250px;'])->label('更多查询', ['Yii' => 'normal'])->error(false) ?> <?= $form->field($model, 'ORDER_STATUS')->hiddenInput()->label(false)->error(false) ?> <?= $form->field($model, 'CHANNEL_ORDER_STATUS')->hiddenInput()->label(false)->error(false) ?> <div class="form-group search_button"> <?= Html::submitButton('<span class="glyphicon glyphicon-search"></span> 查询', ['class' => 'btn btn-primary left-20 loading-form', 'id' => 'search-button', 'onclick' => 'loading()']) ?> <?= Html::button('<span class="glyphicon glyphicon-save"></span> 导出订单', ['class' => 'btn btn-primary ', 'onclick' => 'z.exportExcel(\'form\', \'/hotel/ordermain/export\')']) ?> </div> </div> </div> <?php zActiveForm::end(); ?>
这是我的项目里面的,没时间整理,提交的时候就会提交到你渲染这个页面的那个控制器了,当然你也可以自定义,类似于这样:
<?php $form = zActiveForm::begin(['action' => '/hotel/hotel-room/set-bed-type', 'options' => ['class' => 'form-horizontal', 'data-pjax' => true]]); ?>
共 3 条回复
秀小川
注册时间:2017-08-16
最后登录:2022-05-23
在线时长:20小时47分
最后登录:2022-05-23
在线时长:20小时47分
- 粉丝1
- 金钱455
- 威望0
- 积分655