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

报名后逻辑修改

... ... @@ -76,12 +76,12 @@ class IndexController extends RestBaseController
$volunteer = $volunteerModel->selectData($volunteer_page,$volunteer_pageNum,array('status'=>2));
//活动
$activityModel = new ActivityModel();
$activity = $activityModel->selectData(0,2);
$activity = $activityModel->selectDataByTime(0,2);
// $beginAtOnce = $activityModel->beginAtOnce($activity_page,$activity_pageNum);
//新闻
$activityNewsModel = new ActivityNewsModel();
$news = $activityNewsModel->selectData($activity_page,$activity_pageNum);
$news = $activityModel->selectDataByTime($activity_page,$activity_pageNum,1);
//幻灯片
$slideItemModel = new SlideItemModel();
... ... @@ -552,6 +552,7 @@ class IndexController extends RestBaseController
*
* @param name:id type:int require:1 other: desc:活动id
* @param name:form_id type:int require:1 other: desc:表单id
* @param name:card_number type:int require:1 other: desc:身份证号
* @param name:type type:int require:1 other: desc:活动类型1:线上2:线下3:线上+线下
* @param name:start_time type:int require:1 other: desc:开始时间
* @param name:end_time type:int require:1 other: desc:结束时间
... ... @@ -568,6 +569,7 @@ class IndexController extends RestBaseController
$end_time=strtotime(input('end_time'));
$activity_id=input('id');
$form_id=input('form_id');
$card_number=input('card_number');
$this->saveFormId($userId,$form_id);
/*三期增加字段*/
... ... @@ -593,6 +595,7 @@ class IndexController extends RestBaseController
// $this->error('已经报名参加过该活动!');
}
$data['user_id']=$userId;
$data['card_number']=$card_number;
$data['activity_id']=$activity_id;
$data['type']=$type;
$data['start_time']=$start_time;
... ... @@ -663,13 +666,13 @@ class IndexController extends RestBaseController
$data['select_time']=$select_time;
$data['apply_stay']=$apply_stay;
$data['apply_food']=$apply_food;
$data['card_number']=input('card_number');
$data['status']=0;//需要重新进行审核
$Join=new JoinModel();
$result=$Join->where($map)->Update($data);
/*echo $Join->getLastSql();
dump($result);
exit();*/
if ($result>0){
$this->success('修改成功,请等待审核!');
}
... ... @@ -691,11 +694,13 @@ class IndexController extends RestBaseController
* @return birthday:生日
* @return sex:性别
* @return tel:手机号
* @return card_number:身份证号
* @return work_type:工作类型
* @return work_content:工作内容
* @return select_time:选择日期
* @return apply_stay:申请入住
* @return apply_food:申请用餐
*
*/
public function getApplyInfo(){
... ... @@ -727,12 +732,13 @@ class IndexController extends RestBaseController
}
$info=db('join')->field('sgin_time,id,type,user_id,activity_id,select_time,apply_stay,apply_food,work_content')->where($map)->find();
$user=db('volunteer')->field('sex,name,birthday,move_phone')->where('user_id',$userId)->find();
$user=db('volunteer')->field('card_number,sex,name,birthday,move_phone')->where('user_id',$userId)->find();
if (!empty($user)){
$return['name']=$user['name'];
$return['birthday']=$user['birthday'];
$return['sex']=$user['sex']==1?'男':'女';
$return['tel']=$user['move_phone'];
$return['card_number']=$user['card_number'];
}
if (!empty($info)){
$return['work_content']=db('work')->where('id',$info['work_content'])->value('name');
... ...
... ... @@ -448,8 +448,7 @@ class MemberCenterController extends RestBaseController
*
* @header name:XX-Token require:1 default: desc:token
*
* @param name:add_time type:int require:0 other: desc:添加时间
* @param name:user_id type:int require:0 other: desc:用户id
* @param name:join_id type:int require:0 other: desc:参加id
*
*/
public function addTime(){
... ... @@ -460,11 +459,27 @@ class MemberCenterController extends RestBaseController
if($user['type'] != 2){
$this->success(['code'=>40001,'msg'=>'查无此人!']);
}
$map['user_id']=input('user_id');
$map['id']=input('join_id');
$time=input('add_time');
// $data['add_time']=['exp','work_time'+$time];
$join=\db('join')->where($map)->find();
if (empty($join)){
$this->error('参数错误');
}
$joinUpdate['work_time']=$time;
\db('join')->where($map)->update($joinUpdate);
if ($time>$join['work_time']){
$add_time=$time-$join['work_time'];
$volunteerUpdate['work_time']=$add_time;
\db('volunteer')->where('user_id',$join['user_id'])->setInc('work_time',$add_time);
}else{
$add_time=$join['work_time']-$time;
\db('volunteer')->where('user_id',$join['user_id'])->setDec('work_time',$add_time);
}
$result=1;
/* // $data['add_time']=['exp','work_time'+$time];
$result=db('volunteer')->where($map)->setInc('work_time',$time);
// echo db('volunteer')->getLastSql();
// echo db('volunteer')->getLastSql();*/
if ($result>0){
$this->success('修改成功!');
}else{
... ... @@ -492,9 +507,10 @@ class MemberCenterController extends RestBaseController
if($user['type'] != 2){
$this->success(['code'=>40001,'msg'=>'查无此人!']);
}
/*获取*/
if (!empty($return['time'])){
$return['time']= array_reverse($return['time']);
}
... ... @@ -834,7 +850,7 @@ class MemberCenterController extends RestBaseController
\db('form_id')->where('form_id',$form_id['form_id'])->update(['use_time'=>time()]);
$data['keyword1']= $volunteer['name'];
$data['keyword2']='活动审核';
$data['keyword3']='未通过';
$data['keyword3']='未通过 原因:'.$refund_reason;
$data['keyword4']=$activity['activity_name'];
$message = [
'touser' => $openid,
... ...
... ... @@ -56,6 +56,28 @@ class ActivityModel extends Model
->toArray();
return $data;
}
public function selectDataByTime($page,$pageNum,$type=0){
$order = "create_time desc";
$where['a.delete_time'] = ['eq',0];
if ($type==0){
$where['a.end_time']=['>',time()];
}else{
$where['a.end_time']=['<',time()];
}
$where['is_up'] = ['eq',1];
$data = $this->alias('a')
->field('a.*,p.province_name,act.type_name')
->join('activity_type act','act.id=a.activity_type','LEFT')
->join('position_province p','p.id=a.position_id','LEFT')
->where($where)
->limit(($page * $pageNum),$pageNum)
->order($order)
->select()
->toArray();
return $data;
}
public function selectCityData($city_id){
$order = "create_time desc";
$where['a.delete_time'] = ['eq',0];
... ...
... ... @@ -55,15 +55,17 @@ class JoinModel extends Model
*/
public function getUserJoin($userId){
$where['j.user_id']=$userId;
$where['j.status']=['>',1];
$where['j.status']=['in','1,3'];
$info=$this->alias('j')
->field('a.*,at.type_name,pp.*,a.id as id')
->join('cmf_activity a','a.id=j.activity_id')
->join('cmf_activity_type at','a.activity_type=at.id')
->join('cmf_position_province pp','a.position_id=pp.id')
->join('cmf_activity_type at','a.activity_type=at.id','LEFT')
->join('cmf_position_province pp','a.position_id=pp.id','LEFT')
->where($where)
->order('a.start_time','desc')
->select()
->toArray();
// echo $this->getLastSql();
return $info;
}
}
\ No newline at end of file
... ...
... ... @@ -681,7 +681,7 @@ class ActivityController extends AdminBaseController
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]['time'][$k1]=$v1['date'];
}
$date[$k]['select']=implode(',',$date[$k]['time']);
}else{
... ... @@ -729,7 +729,7 @@ class ActivityController extends AdminBaseController
$title = [
['ID', 15, 'id', 1],
['姓名', 15, 'name', 1],
['图片', 15, 'photo', 2,200],
/* ['图片', 15, 'photo', 2,200],*/
['参与方式', 15, 'type', 1],
['审核状态', 15, 'status', 1],
['选择时间', 15, 'select_time', 1],
... ... @@ -740,7 +740,6 @@ class ActivityController extends AdminBaseController
];
$Excel = new Excel();
$letter = $Excel->excelAcross(count($title));
// dump($letter);
$Excel->excel($letter, $title, $join, "$activity[activity_name]活动申请列表");
}
... ...
... ... @@ -37,8 +37,8 @@
<th width="50">标题</th>
<th width="20">缩略图</th>
<th width="20">摘要</th>
<th width="30">创建时间</th>
<th width="30">更新时间</th>
<th width="30">开始时间</th>
<th width="30">结束时间</th>
<th width="30">发布时间</th>
<th width="30">状态</th>
<th width="100">操作</th>
... ... @@ -62,8 +62,8 @@
</td>
<td>{$vo.abstract}</td>
<!--<td>{:cmf_replace_content_file_url(htmlspecialchars_decode($vo.content))}</td>-->
<td>{:date('Y-m-d H:i:s',$vo['create_time'])}</td>
<td>{:date('Y-m-d H:i:s',$vo['update_time'])}</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>
<td>{:date('Y-m-d',$vo['time'])}</td>
<td>
<notempty name="vo.is_up">
... ...
... ... @@ -32,6 +32,7 @@
<th width="20">状态</th>
<th width="30">参加类型</th>
<th width="30">工作内容</th>
<th width="30">身份证号</th>
<th width="30">选择时间</th>
<th width="30">申请住宿</th>
<th width="30">申请饮食</th>
... ... @@ -76,6 +77,9 @@
<td>
{$vo['work_content']}
</td>
<td>
{$vo['card_number']}
</td>
<!-- <td><if condition="$vo['start_time'] neq 0">{:date('Y-m-d',$vo['start_time'])}</if></td>-->
<!--<td><if condition="$vo['end_time'] neq 0">{:date('Y-m-d',$vo['end_time'])}</if></td>-->
<td>
... ... @@ -89,7 +93,7 @@
<td>
<notempty name="vo['apply_stay']">
<volist name="vo['apply_stay']" id="v1">
{$v1.date} {$v1.idcard}<br />
{$v1.date} <br />
</volist>
</notempty>
</td>
... ...