作者 王晓刚
1 个管道 的构建 通过 耗费 0 秒

提现失败问题

... ... @@ -63,6 +63,12 @@ class SchoolController extends AdminBaseController{
return $this -> fetch();
}
public function getArea(){
$parent_id = $this->request->param('pid');
$where['pid'] = ['eq',$parent_id];
$data = Db::name('area')->where($where)->select();
$this->success('SUCCESS',$data);
}
/*
... ...
... ... @@ -9,12 +9,18 @@
<form class="js-ajax-form" method="post" action="{:url('School/school_edit_post')}" role="form" style="margin-top: 20px;">
<div class="input-group">
<span class="input-group-addon">学校地区:</span>
<select class="form-control">
<select class="form-control" name="province" id="province" required>
<option>请选择</option>
<foreach name="$province" item="p">
<option value="{$p.name}">{$p.name}</option>
</foreach>
</select>
<input type="text" class="form-control" name="region" value="{$data.region}" >
<select class="form-control" name="city" id="city" required>
<option>请选择</option>
</select>
<select class="form-control" name="county" id="county" required>
<option>请选择</option>
</select>
<input type="text" class="form-control" name="region" value="{$data.region}" >
</div>
<br>
... ... @@ -40,4 +46,50 @@
</div>
</body>
<script src="__STATIC__/js/admin.js"></script>
<script>
$('#province').change(function(){
var province_id = $('#province option:selected').val();
$.ajax({
url:"{:url('getArea')}",
type:"GET",
data:{'pid':province_id},
success:function(data) {
var result = eval("(" + data + ")");
if(result.code==20000){
var mydata = "<option value=''>请选择</option>";
for (var i = 0; i < result.data.length; i++) {
var data = result.data[i];
mydata += '<option value="'+data.name+'">'+data.name+'</option>';
}
$('#city').html(mydata);
$('#county').html("<option value=''>请选择</option>");
}else if(result.code==40005){
alert('获取失败!');
}
}
})
})
//获取区/县
$('#city').change(function(){
var city_id = $('#city option:selected').val();
$.ajax({
url:"{:url('getArea')}",
type:"GET",
data:{'pid':city_id},
success:function(data) {
var result = eval("(" + data + ")");
if(result.code==20000){
var mydata = "<option value=''>请选择</option>";
for (var i = 0; i < result.data.length; i++) {
var data = result.data[i];
mydata += '<option value="'+data.name+'">'+data.name+'</option>';
}
$('#county').html(mydata);
}else if(result.code==40005){
alert('获取失败!');
}
}
})
})
</script>
</html>
\ No newline at end of file
... ...