...
|
...
|
@@ -21,6 +21,7 @@ class VolunteerController extends AdminBaseController |
|
|
public function index()
|
|
|
{
|
|
|
$where = [];
|
|
|
$where1 = [];
|
|
|
$param = $this->request->param();
|
|
|
$startTime = empty($param['start_time']) ? 0 : strtotime($param['start_time']);
|
|
|
$endTime = empty($param['end_time']) ? 0 : strtotime($param['end_time']);
|
...
|
...
|
@@ -42,6 +43,18 @@ class VolunteerController extends AdminBaseController |
|
|
if (!empty($type)) {
|
|
|
$where['type'] = ['eq', "$type"];
|
|
|
}
|
|
|
$sex = empty($param['sex']) ? '' : $param['sex'];
|
|
|
if (!empty($sex)) {
|
|
|
$where['sex'] = ['eq', "$sex"];
|
|
|
}
|
|
|
$level = empty($param['level']) ? '' : $param['level'];
|
|
|
if (!empty($level)) {
|
|
|
$level_map['level'] = ['eq', "$level"];
|
|
|
$level=\db('level')->where('level',$level)->find();
|
|
|
$where['work_time']=['>=',$level['min']];
|
|
|
$where1['work_time']=['<',$level['max']];
|
|
|
|
|
|
}
|
|
|
$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%"];
|
...
|
...
|
@@ -50,9 +63,13 @@ class VolunteerController extends AdminBaseController |
|
|
if (!empty($addr)) {
|
|
|
$where['addr'] = ['like', "%$addr%"];
|
|
|
}
|
|
|
|
|
|
// dump($where);
|
|
|
// dump($where1);
|
|
|
$list = Db::name('volunteer')
|
|
|
->where('delete_time', 0)
|
|
|
->where($where)
|
|
|
->where($where1)
|
|
|
->order('create_time desc')
|
|
|
->paginate(10);
|
|
|
$list->appends($param);
|
...
|
...
|
@@ -73,6 +90,8 @@ class VolunteerController extends AdminBaseController |
|
|
$this->assign('addr', isset($param['addr']) ? $param['addr'] : '');
|
|
|
$this->assign('category', isset($param['category']) ? $param['category'] : '');
|
|
|
$this->assign('type', isset($param['type']) ? $param['type'] : '');
|
|
|
$this->assign('sex', isset($param['sex']) ? $param['sex'] : '');
|
|
|
$this->assign('level', isset($param['level']) ? $param['level'] : '');
|
|
|
return $this->fetch();
|
|
|
}
|
|
|
|
...
|
...
|
@@ -261,6 +280,7 @@ class VolunteerController extends AdminBaseController |
|
|
$data[$k]['sex'] = '保密';
|
|
|
}
|
|
|
$data[$k]['card_number'] = '`' . $v['card_number'];
|
|
|
$data[$k]['level'] = get_level_text($v['work_time']);
|
|
|
}
|
|
|
$title = [
|
|
|
['ID', 15, 'id', 1],
|
...
|
...
|
@@ -285,6 +305,7 @@ class VolunteerController extends AdminBaseController |
|
|
['市', 15, 'city', 1],
|
|
|
['区县', 15, 'county', 1],
|
|
|
['详细地址', 15, 'address', 1],
|
|
|
['星级', 15, 'level', 1],
|
|
|
];
|
|
|
|
|
|
$Excel = new Excel();
|
...
|
...
|
|