作者 sgj
1 个管道 的构建 通过 耗费 0 秒

添加最新版本的easywechat

... ... @@ -127,4 +127,40 @@ class VolunteerController extends AdminBaseController
$this->success('操作成功!','');
}
}
public function daochu(){
$where=[];
$param = $this->request->param();
$startTime = empty($param['start_time']) ? 0 : strtotime($param['start_time']);
$endTime = empty($param['end_time']) ? 0 : strtotime($param['end_time']);
if (!empty($startTime) && !empty($endTime)) {
$where['create_time'] = [['>= time', $startTime], ['<= time', $endTime]];
} else {
if (!empty($startTime)) {
$where['create_time'] = ['>= time', $startTime];
}
if (!empty($endTime)) {
$where['create_time'] = ['<= time', $endTime];
}
}
$category = empty($param['category']) ? '' : $param['category'];
if (!empty($category)) {
$where['status'] = ['eq', "$category"];
}
$type = empty($param['type']) ? '' : $param['type'];
if (!empty($type)) {
$where['type'] = ['eq', "$type"];
}
$keyword = empty($param['keyword']) ? '' : $param['keyword'];
if (!empty($keyword)) {
$where['name|province|city|county|email|move_phone|fixed_phone|card_number|school|postcode|nation|politics|sex|urgency_phone|qq'] = ['like', "%$keyword%"];
}
$data=Db::name('volunteer')
->where('delete_time',0)
->where($where)
->order('create_time desc')
->select();
dump($data);
}
}
\ No newline at end of file
... ...
... ... @@ -31,6 +31,8 @@
value="{$end_time|default=''}"
style="width: 140px;" autocomplete="off"> &nbsp; &nbsp;
<input type="submit" class="btn btn-primary" value="搜索" />
<input type="hidden" value="daochu">
<input type="submit" class="btn btn-primary" value="导出" />
<a class="btn btn-danger" href="{:url('volunteer/index')}">清空</a>
</form>
<form class="js-ajax-form" action="" method="post">
... ...