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

添加最新版本的easywechat

@@ -127,4 +127,40 @@ class VolunteerController extends AdminBaseController @@ -127,4 +127,40 @@ class VolunteerController extends AdminBaseController
127 $this->success('操作成功!',''); 127 $this->success('操作成功!','');
128 } 128 }
129 } 129 }
  130 +
  131 + public function daochu(){
  132 + $where=[];
  133 + $param = $this->request->param();
  134 + $startTime = empty($param['start_time']) ? 0 : strtotime($param['start_time']);
  135 + $endTime = empty($param['end_time']) ? 0 : strtotime($param['end_time']);
  136 + if (!empty($startTime) && !empty($endTime)) {
  137 + $where['create_time'] = [['>= time', $startTime], ['<= time', $endTime]];
  138 + } else {
  139 + if (!empty($startTime)) {
  140 + $where['create_time'] = ['>= time', $startTime];
  141 + }
  142 + if (!empty($endTime)) {
  143 + $where['create_time'] = ['<= time', $endTime];
  144 + }
  145 + }
  146 + $category = empty($param['category']) ? '' : $param['category'];
  147 + if (!empty($category)) {
  148 + $where['status'] = ['eq', "$category"];
  149 + }
  150 + $type = empty($param['type']) ? '' : $param['type'];
  151 + if (!empty($type)) {
  152 + $where['type'] = ['eq', "$type"];
  153 + }
  154 + $keyword = empty($param['keyword']) ? '' : $param['keyword'];
  155 + if (!empty($keyword)) {
  156 + $where['name|province|city|county|email|move_phone|fixed_phone|card_number|school|postcode|nation|politics|sex|urgency_phone|qq'] = ['like', "%$keyword%"];
  157 + }
  158 + $data=Db::name('volunteer')
  159 + ->where('delete_time',0)
  160 + ->where($where)
  161 + ->order('create_time desc')
  162 + ->select();
  163 + dump($data);
  164 +
  165 + }
130 } 166 }
@@ -31,6 +31,8 @@ @@ -31,6 +31,8 @@
31 value="{$end_time|default=''}" 31 value="{$end_time|default=''}"
32 style="width: 140px;" autocomplete="off"> &nbsp; &nbsp; 32 style="width: 140px;" autocomplete="off"> &nbsp; &nbsp;
33 <input type="submit" class="btn btn-primary" value="搜索" /> 33 <input type="submit" class="btn btn-primary" value="搜索" />
  34 + <input type="hidden" value="daochu">
  35 + <input type="submit" class="btn btn-primary" value="导出" />
34 <a class="btn btn-danger" href="{:url('volunteer/index')}">清空</a> 36 <a class="btn btn-danger" href="{:url('volunteer/index')}">清空</a>
35 </form> 37 </form>
36 <form class="js-ajax-form" action="" method="post"> 38 <form class="js-ajax-form" action="" method="post">