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

添加最新版本的easywechat

... ... @@ -721,6 +721,54 @@ class MemberCenterController extends RestBaseController
}
$result=db('join')->where($map)->update($data);
if ($result>0){
$join=\db('join')->where($map)->find();
$activity=\db('activity')->where('id',$join['activity_id'])->find();
$userMap['user_id']=$join['user_id'];
$openid=db('third_party_user')->where($userMap)->value('openid');
$volunteer=\db('volunteer')->where('user_id',$join['user_id'])->find();
$formMap['user_id']=$join['user_id'];
$formMap['use_time']=0;
$formMap['expire_time']=['>',time()];
$form_id=\db('form_id')->where($formMap)->find();
if ($data['status']==1){
if (!empty($form_id)){
\db('form_id')->where('form_id',$form_id['form_id'])->update(['use_time'=>time()]);
$data['keyword1']= $volunteer['name'];
$data['keyword2']='活动审核';
$data['keyword3']='通过';
$data['keyword4']=$activity['activity_name'];
$message = [
'touser' => $openid,
'template_id' => '1FYkLuMK8LNKO4_nxJ_DuNQhgIjaaJQlAukgt92C-uw',
'page' => 'pages/index/index',
'form_id' => $form_id['value'],
'data' => $data,
'emphasis_keyword' =>$data['keyword3'],
];
$this->wxappNotice($message);
}
}else{
if (!empty($form_id)){
\db('form_id')->where('form_id',$form_id['form_id'])->update(['use_time'=>time()]);
$data['keyword1']= $volunteer['name'];
$data['keyword2']='活动审核';
$data['keyword3']='未通过';
$data['keyword4']=$activity['activity_name'];
$message = [
'touser' => $openid,
'template_id' => '1FYkLuMK8LNKO4_nxJ_DuNQhgIjaaJQlAukgt92C-uw',
'page' => 'pages/index/index',
'form_id' => $form_id['value'],
'data' => $data,
'emphasis_keyword' =>$data['keyword3'],
];
$this->wxappNotice($message);
}
}
$this->success('更新成功!');
}else{
$this->error('操作失败!');
... ...