选择下拉框条件改变对应数据,包括分页
html:
<select id="out_in_type">
<option selected value="0">出入库类型</option>
<?php foreach($inout_type as $k1 => $v1): ?>
<option value="<?=$v1['id']?>" ><?=$v1['inout_type']?></option>
<?php endforeach;?>
</select>
js:
//出入库类型搜索
$("#out_in_type").change(function(){
var out_in_type = $('#out_in_type option:selected').val();
var goods_name = $('#goods_name').val();
goods_name = $.trim(goods_name);
var begin_time = $('#begin').val();
var url = "<?php echo site_url('ware_center/log_inout_view');?>";
url = url+'?out_in_type='+out_in_type+'&goods_name='+goods_name+'&begin_time='+begin_time;
location.href = url;//刷新页面
})
控制器:
![](https://box.kancloud.cn/d966837241f3d4a7aa40273728aa27f6_1436x420.png)
模型层://主要是分页设置//ci的分页设置
![](https://box.kancloud.cn/81af31e59a1117da721e6d4105198789_1380x75.png)