...
|
...
|
@@ -25,23 +25,26 @@ class ActivityController extends AdminBaseController |
|
|
$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]];
|
|
|
$where['a.create_time'] = [['>= time', $startTime], ['<= time', $endTime]];
|
|
|
} else {
|
|
|
if (!empty($startTime)) {
|
|
|
$where['create_time'] = ['>= time', $startTime];
|
|
|
$where['a.create_time'] = ['>= time', $startTime];
|
|
|
}
|
|
|
if (!empty($endTime)) {
|
|
|
$where['create_time'] = ['<= time', $endTime];
|
|
|
$where['a.create_time'] = ['<= time', $endTime];
|
|
|
}
|
|
|
}
|
|
|
$keyword = empty($param['keyword']) ? '' : $param['keyword'];
|
|
|
if (!empty($keyword)) {
|
|
|
$where['activity_name|abstract'] = ['like', "%$keyword%"];
|
|
|
$where['a.activity_name|a.abstract'] = ['like', "%$keyword%"];
|
|
|
}
|
|
|
$data=Db::name('activity')
|
|
|
->where('delete_time',0)
|
|
|
->alias('a')
|
|
|
->join('activity_type at','a.activity_type=at.id','LEFT')
|
|
|
->join('position_city pc','a.position_id=pc.id','LEFT')
|
|
|
->where('a.delete_time',0)
|
|
|
->where($where)
|
|
|
->order('create_time desc')
|
|
|
->order('a.create_time desc')
|
|
|
->paginate(10);
|
|
|
$data->appends($param);
|
|
|
$list=$data->items();
|
...
|
...
|
@@ -55,6 +58,7 @@ class ActivityController extends AdminBaseController |
|
|
'data'=>$list,
|
|
|
'page'=>$data->render(),
|
|
|
]);
|
|
|
//dump($list);
|
|
|
$this->assign('start_time', isset($param['start_time']) ? $param['start_time'] : '');
|
|
|
$this->assign('end_time', isset($param['end_time']) ? $param['end_time'] : '');
|
|
|
$this->assign('keyword', isset($param['keyword']) ? $param['keyword'] : '');
|
...
|
...
|
@@ -453,7 +457,7 @@ class ActivityController extends AdminBaseController |
|
|
$map['j.activity_id']=input('id');
|
|
|
//$map['j.delete_time']=0;
|
|
|
$join=\db('join')
|
|
|
->field('j.*,v.name,v.photo')
|
|
|
->field('j.*,v.name,v.photo,v.card_number')
|
|
|
->alias('j')
|
|
|
->join('volunteer v','v.user_id=j.user_id')
|
|
|
->where($map)
|
...
|
...
|
@@ -466,9 +470,9 @@ class ActivityController extends AdminBaseController |
|
|
if (!empty($v['sgin_time'])){
|
|
|
$join[$k]['sgin_time']=date('Y-m-d H:i:s',$v['sgin_time']);
|
|
|
}
|
|
|
$join[$k]['work_content']=\db('work')->where('id',$v['work_content'])->value('name');
|
|
|
$join[$k]['select_time']=json_decode($v['select_time'],true);
|
|
|
$join[$k]['apply_stay']=json_decode($v['apply_stay'],true);
|
|
|
$join[$k]['work_content']=\db('work')->where('id',$v['work_content'])->value('name');
|
|
|
$join[$k]['select_time'] =json_decode($v['select_time'],true);
|
|
|
$join[$k]['apply_stay'] =json_decode($v['apply_stay'],true);
|
|
|
$join[$k]['apply_food']=json_decode($v['apply_food'],true);
|
|
|
}
|
|
|
$this->assign('data',$join);
|
...
|
...
|
@@ -649,20 +653,22 @@ class ActivityController extends AdminBaseController |
|
|
public function excel(){
|
|
|
$map['j.activity_id']=input('id');
|
|
|
$activity=\db('activity')->where('id',$map['j.activity_id'])->find();
|
|
|
|
|
|
$map['j.status']=['in','1,3'];
|
|
|
$map['j.delete_time']=0;
|
|
|
$join=\db('join')
|
|
|
->field('j.*,v.name,v.photo')
|
|
|
->field('j.*,v.name,v.photo,v.sex,v.card_number,v.move_phone,v.birthday')
|
|
|
->alias('j')
|
|
|
->join('volunteer v','v.user_id=j.user_id')
|
|
|
->where($map)
|
|
|
->select()
|
|
|
->toArray();
|
|
|
/*dump($join);*/
|
|
|
|
|
|
$work=\db('work')->select()->toArray();
|
|
|
/* dump($join);
|
|
|
exit();*/
|
|
|
//dump(get_image_path('https://volunteer.cnpu.org/upload/20190112/9bd2840928f0acee61ce6c906cda32c3.jpg'));
|
|
|
foreach ($join as $k=>$v){
|
|
|
/*dump($k);*/
|
|
|
$join[$k]['card_number']='`'.$v['card_number'];
|
|
|
if (!empty($v['add_time'])){
|
|
|
$join[$k]['add_time']=date('Y-m-d H:i:s',$v['add_time']);
|
|
|
}
|
...
|
...
|
@@ -694,8 +700,6 @@ class ActivityController extends AdminBaseController |
|
|
$join[$k]['apply_stay']='';
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!empty($v['apply_food'])){
|
|
|
$select[$k]=json_decode($v['apply_food'],true);
|
|
|
foreach ($select[$k] as $k1=>$v1){
|
...
|
...
|
@@ -730,13 +734,26 @@ class ActivityController extends AdminBaseController |
|
|
$join[$k]['type']='线上及线下';
|
|
|
break;
|
|
|
}
|
|
|
switch ($v['sex']){
|
|
|
case 1:
|
|
|
$join[$k]['sex']='男';
|
|
|
break;
|
|
|
case 2:
|
|
|
$join[$k]['sex']='女';
|
|
|
break;
|
|
|
}
|
|
|
$join[$k]['work_content']=$work[$v['work_content']-1]['name'];
|
|
|
}
|
|
|
$title = [
|
|
|
['ID', 15, 'id', 1],
|
|
|
['姓名', 15, 'name', 1],
|
|
|
/* ['图片', 15, 'photo', 2,200],*/
|
|
|
['性别', 15, 'sex', 1],
|
|
|
['出生日期', 15, 'birthday', 1],
|
|
|
['电话', 15, 'move_phone', 1],
|
|
|
['身份证号', 25, 'card_number', 1],
|
|
|
['参与方式', 15, 'type', 1],
|
|
|
['审核状态', 15, 'status', 1],
|
|
|
['工作内容', 15, 'work_content', 1],
|
|
|
['选择时间', 30, 'select', 1],
|
|
|
['申请入住', 30, 'stay', 1],
|
|
|
['申请用餐', 30, 'food', 1],
|
...
|
...
|
@@ -746,7 +763,7 @@ class ActivityController extends AdminBaseController |
|
|
$Excel = new Excel();
|
|
|
$letter = $Excel->excelAcross(count($title));
|
|
|
|
|
|
$Excel->excel($letter, $title, $join, "$activity[activity_name]活动申请列表");
|
|
|
$Excel->excel($letter, $title, $join, "$activity[activity_name]参与人员");
|
|
|
}
|
|
|
|
|
|
public function addtime(){
|
...
|
...
|
|