作者 sgj
1 个管道 的构建 失败 耗费 8 秒

报名后逻辑修改

... ... @@ -230,6 +230,8 @@ class IndexController extends RestBaseController
* @join photo:照片 name:名称 level:星级 duty:岗位
* @return button_status:按钮状态8.报名通过活动未结束,不能填写报告7.用户被拒绝重新申请客户6.用户是志愿者,但是未报名参加活动5.已结束(活动过期)4.已提交工作汇报(用户是志愿者,已报名活动,已通过审核,已签到)3.提交工作汇报(用户是志愿者,已报名活动,选择线下或线上+线下,已通过审核,按钮变为签到但不可点击,活动有效时间内,变为可点击状态)2.待审核(用户是志愿者,已报名活动,但是未通过审核)1.报名 (用户是志愿者,但是未报名参加活动)
* @return activity_stage:0.未开始1.进行中2.已结束
* @return status:0.未审核1.已通过2.已拒绝3.已提交工作汇报
* @return is_join:0.未参加1.已参加
*/
public function activity_info(){
$id = $this->request->param('id');
... ... @@ -304,7 +306,6 @@ class IndexController extends RestBaseController
}elseif($join['status']==0){
$is_book=1;
$is_pass=0;
}
$check=0;
... ... @@ -327,6 +328,8 @@ class IndexController extends RestBaseController
$title='已结束';
$check=1;
}
if ($is_volunteer==0 && $check==0) {
$status=6;
$check=1;
... ... @@ -364,12 +367,14 @@ class IndexController extends RestBaseController
}
$activity['button_title']=$title;
$activity['button_status']=$status;
/*活动参与状态*/
$activity['is_join']=$is_join;
$people=$Join->getJoinData($id);
$map1=[];
$sub_map['j.activity_id']=$id;
$sub_map['j.status']=['in','1,3'];
$subQuery = db('join')->alias('j')
->field('max(j.id)')
->join('volunteer v','v.user_id=j.user_id')
... ...
... ... @@ -44,8 +44,15 @@ class ActivityController extends AdminBaseController
->order('create_time desc')
->paginate(10);
$data->appends($param);
$list=$data->items();
foreach ($list as $k=>$v){
$join_map['status']=['in','1,3'];
$join_map['activity_id']=$v['id'];
$join_map['delete_time']=0;
$list[$k]['count']=\db('join')->where($join_map)->count('*');
}
$this->assign([
'data'=>$data,
'data'=>$list,
'page'=>$data->render(),
]);
$this->assign('start_time', isset($param['start_time']) ? $param['start_time'] : '');
... ... @@ -53,6 +60,8 @@ class ActivityController extends AdminBaseController
$this->assign('keyword', isset($param['keyword']) ? $param['keyword'] : '');
return $this->fetch();
}
public function news(){
$where=[];
$param = $this->request->param();
... ... @@ -442,7 +451,7 @@ class ActivityController extends AdminBaseController
public function join(){
$map['j.activity_id']=input('id');
$map['j.delete_time']=0;
//$map['j.delete_time']=0;
$join=\db('join')
->field('j.*,v.name,v.photo')
->alias('j')
... ... @@ -523,7 +532,7 @@ class ActivityController extends AdminBaseController
$notice=$wechat->mini_program->notice;
$result= $notice->send($message);
}catch(Exception $e){
$e->getMessage();
//$e->getMessage();
}
return $result;
}
... ... @@ -752,6 +761,7 @@ class ActivityController extends AdminBaseController
$time=input('time');
$map['activity_id']=$id;
$map['status']=['in','1,3'];
$map['delete_time']=0;
$join=\db('join')->where($map)->select();
foreach ($join as $k=>$v){
/*是否已经设置过时间*/
... ...
... ... @@ -46,6 +46,10 @@ class VolunteerController extends AdminBaseController
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%"];
}
$addr = empty($param['addr']) ? '' : $param['addr'];
if (!empty($addr)) {
$where['addr'] = ['like', "%$addr%"];
}
$data = Db::name('volunteer')
->where('delete_time', 0)
->where($where)
... ... @@ -59,6 +63,7 @@ class VolunteerController extends AdminBaseController
$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'] : '');
$this->assign('addr', isset($param['addr']) ? $param['addr'] : '');
$this->assign('category', isset($param['category']) ? $param['category'] : '');
$this->assign('type', isset($param['type']) ? $param['type'] : '');
return $this->fetch();
... ... @@ -111,8 +116,6 @@ class VolunteerController extends AdminBaseController
}
}
$this->success('操作成功!');
... ...
... ... @@ -37,6 +37,7 @@
<th width="50">标题</th>
<th width="20">缩略图</th>
<th width="20">摘要</th>
<th width="20">参与人数</th>
<th width="30">开始时间</th>
<th width="30">结束时间</th>
<th width="30">发布时间</th>
... ... @@ -61,6 +62,7 @@
</notempty>
</td>
<td>{$vo.abstract}</td>
<td>{$vo.count}</td>
<!--<td>{:cmf_replace_content_file_url(htmlspecialchars_decode($vo.content))}</td>-->
<td>{:date('Y-m-d H:i:s',$vo['start_time'])}</td>
<td>{:date('Y-m-d H:i:s',$vo['end_time'])}</td>
... ...
... ... @@ -59,12 +59,17 @@
</notempty>
</td>
<td>
<switch name="$vo.status">
<case value="0">未审核</case>
<case value="1">已通过</case>
<case value="2">未通过</case>
<case value="3">已签到</case>
</switch>
<if condition="$vo.delete_time eq 0">
<switch name="$vo.status">
<case value="0">未审核</case>
<case value="1">已通过</case>
<case value="2">未通过</case>
<case value="3">已签到</case>
</switch>
<else />
<span style="color:darkred">已退出</span>
</if>
</td>
<td>
<switch name="$vo.type">
... ... @@ -108,6 +113,8 @@
<td>{$vo['sgin_time']}</td>
<td>{$vo['work_time']}</td>
<td>
<if condition="$vo['delete_time'] eq 0">
<if condition="$vo['status'] eq 0">
<a href="{:url('activity/joinPass',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn" data-msg="确定审核通过吗?">通过</a>|
<span onclick="dorefund({$vo['id']})">拒绝</span>
... ... @@ -123,6 +130,12 @@
<font style="color: blue" onclick="doSelectCategory({$vo['id']})" href="{:url('activity/joinTime',array('id'=>$vo['id']))}">参加活动时间</font>
<font style="" onclick="userWork({$vo['id']})" href="{:url('activity/userWork',array('id'=>$vo['id']))}">查看工作汇报</font>
</if>
<else />
<span style="color:darkred">已退出</span>
</if>
</td>
</tr>
</foreach>
... ...
... ... @@ -21,6 +21,8 @@
<option value='2' <if condition="$type eq 2">selected</if>>社会志愿者</option>
<option value='3' <if condition="$type eq 3">selected</if>>办事处志愿者</option>
</select> &nbsp;&nbsp;
地区:
<input type="text" class="form-control" name="addr" style="width: 150px;" value="{$addr|default=''}" placeholder="请输入地区">&nbsp;&nbsp;
关键字:
<input type="text" class="form-control" name="keyword" style="width: 150px;" value="{$keyword|default=''}" placeholder="请输入关键字">&nbsp;&nbsp;
时间:
... ...