...
|
...
|
@@ -9,6 +9,7 @@ |
|
|
namespace app\admin\controller;
|
|
|
|
|
|
|
|
|
use app\admin\model\Excel;
|
|
|
use cmf\controller\AdminBaseController;
|
|
|
use think\Request;
|
|
|
use think\Validate;
|
...
|
...
|
@@ -644,6 +645,82 @@ class ActivityController extends AdminBaseController |
|
|
return $this->fetch();
|
|
|
}
|
|
|
|
|
|
public function excel(){
|
|
|
$map['j.activity_id']=input('id');
|
|
|
$activity=\db('activity')->where('id',$map['j.activity_id'])->find();
|
|
|
|
|
|
$map['j.delete_time']=0;
|
|
|
$join=\db('join')
|
|
|
->field('j.*,v.name,v.photo')
|
|
|
->alias('j')
|
|
|
->join('volunteer v','v.user_id=j.user_id')
|
|
|
->where($map)
|
|
|
->select()
|
|
|
->toArray();
|
|
|
/* dump($join);*/
|
|
|
|
|
|
//dump(get_image_path('https://volunteer.cnpu.org/upload/20190112/9bd2840928f0acee61ce6c906cda32c3.jpg'));
|
|
|
foreach ($join as $k=>$v){
|
|
|
/*dump($k);*/
|
|
|
if (!empty($v['add_time'])){
|
|
|
$join[$k]['add_time']=date('Y-m-d H:i:s',$v['add_time']);
|
|
|
}
|
|
|
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');
|
|
|
|
|
|
|
|
|
if (!empty($v['select_time'])){
|
|
|
$select[$k]=json_decode($v['select_time'],true);
|
|
|
foreach ($select[$k] as $k1=>$v1){
|
|
|
$date[$k]['time'][$k1]=$v1['date'].' '.$v1['time'];
|
|
|
}
|
|
|
$date[$k]['select']=implode(',',$date[$k]['time']);
|
|
|
}else{
|
|
|
$join[$k]['apply_stay']='';
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!empty($v['apply_stay'])){
|
|
|
$select[$k]=json_decode($v['apply_stay'],true);
|
|
|
foreach ($select[$k] as $k1=>$v1){
|
|
|
$date[$k]['time'][$k1]=$v1['date'].' '.$v1['idcard'];
|
|
|
}
|
|
|
$date[$k]['select']=implode(',',$date[$k]['time']);
|
|
|
}else{
|
|
|
$join[$k]['apply_stay']='';
|
|
|
}
|
|
|
|
|
|
$join[$k]['photo']=get_image_path($v['photo']);
|
|
|
if (!empty($v['apply_food'])){
|
|
|
$select[$k]=json_decode($v['apply_food'],true);
|
|
|
foreach ($select[$k] as $k1=>$v1){
|
|
|
$date[$k]['time'][$k1]=$v1['date'].' '.$v1['time'];
|
|
|
}
|
|
|
$date[$k]['select']=implode(',',$date[$k]['time']);
|
|
|
}else{
|
|
|
$join[$k]['apply_food']='';
|
|
|
}
|
|
|
}
|
|
|
$title = [
|
|
|
['ID', 15, 'id', 1],
|
|
|
['姓名', 15, 'name', 1],
|
|
|
['图片', 15, 'photo', 2,200],
|
|
|
['参与方式', 15, 'type', 1],
|
|
|
['审核状态', 15, 'status', 1],
|
|
|
['选择时间', 15, 'select_time', 1],
|
|
|
['申请入住', 15, 'apply_stay', 1],
|
|
|
['申请用餐', 15, 'apply_food', 1],
|
|
|
['工作报告', 15, 'work_report', 1],
|
|
|
['拒绝原因', 15, 'refund_reason', 1],
|
|
|
];
|
|
|
$Excel = new Excel();
|
|
|
$letter = $Excel->excelAcross(count($title));
|
|
|
// dump($letter);
|
|
|
|
|
|
$Excel->excel($letter, $title, $join, "$activity[activity_name]活动申请列表");
|
|
|
}
|
|
|
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|