You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
624 lines
21 KiB
624 lines
21 KiB
<?php
|
|
namespace app\admin\controller;
|
|
|
|
use think\Db;
|
|
use app\admin\model\Agency;
|
|
use think\Controller;
|
|
use think\db\Query;
|
|
|
|
class Activitys extends Base
|
|
{
|
|
protected $groupid='';
|
|
public function __construct(){
|
|
parent::__construct();
|
|
$groupid=session('admin_auth.role');
|
|
$this->groupid=$groupid;
|
|
}
|
|
/**
|
|
* 列表
|
|
*/
|
|
public function index()
|
|
{
|
|
$kind=input("kind");
|
|
$this->assign('kind',$kind);
|
|
$search_name=input('search_name');
|
|
$this->assign('search_name',$search_name);
|
|
$map=array();
|
|
if($kind)$map['kind']=$kind;
|
|
if($search_name){
|
|
$map['title']= array('like',"%".$search_name."%");
|
|
}
|
|
$gid=$this->groupid;
|
|
if(!in_array($gid,[1,2])&&$gid)$map['groups']=[['like',"%,".$gid.",%"],['like',$gid.",%"],['like',"%".$gid."%"],'OR'];
|
|
$admin_list=Db::name('activity')->where($map)->order('id desc')->paginate(config('paginate.list_rows'),false,['query'=>get_query()]);
|
|
$page = $admin_list->render();
|
|
$this->assign('list',$admin_list);
|
|
$this->assign('page',$page);
|
|
|
|
return $this->fetch();
|
|
}
|
|
/**
|
|
* 添加
|
|
*/
|
|
public function add()
|
|
{
|
|
$kind=input("kind");
|
|
$this->assign('kind',$kind);
|
|
$auth_group=Db::name('auth_group')->where('status','1')->select();
|
|
$this->assign('groups',$auth_group);
|
|
|
|
$list=Db::name('smstpl')->where('status','1')->select();
|
|
$this->assign('tpls',$list);
|
|
$apply=[];
|
|
array_push($apply,['fname'=>'姓名','ftag'=>'uname','ftype'=>'input','frequire'=>1,'foptions'=>'','fnotice'=>'','del'=>1,'fsort'=>1]);
|
|
array_push($apply,['fname'=>'性别','ftag'=>'usex','ftype'=>'radio','frequire'=>1,'foptions'=>'男||女','fnotice'=>'','del'=>1,'fsort'=>2]);
|
|
array_push($apply,['fname'=>'年龄','ftag'=>'uage','ftype'=>'input','frequire'=>1,'foptions'=>'','fnotice'=>'','del'=>1,'fsort'=>3]);
|
|
array_push($apply,['fname'=>'工作','ftag'=>'ujob','ftype'=>'input','frequire'=>1,'foptions'=>'','fnotice'=>'','del'=>1,'fsort'=>4]);
|
|
array_push($apply,['fname'=>'电话','ftag'=>'utel','ftype'=>'input','frequire'=>1,'foptions'=>'','fnotice'=>'','del'=>1,'fsort'=>5]);
|
|
array_push($apply,['fname'=>'邮箱','ftag'=>'uemail','ftype'=>'input','frequire'=>1,'foptions'=>'','fnotice'=>'','del'=>1,'fsort'=>6]);
|
|
$this->assign("apply",$apply);
|
|
$this->assign('role',$this->groupid);
|
|
return $this->fetch();
|
|
}
|
|
/**
|
|
* 添加操作
|
|
*/
|
|
public function runadd()
|
|
{
|
|
$kind=input("kind");
|
|
$this->assign('kind',$kind);
|
|
$data=[];
|
|
$data['title']=input('title');
|
|
$data['kind']=$kind;
|
|
$data['status']=input('status');
|
|
$data['login']=input('login');
|
|
$data['contact']=input('contact');
|
|
$data['notice']=input('notice');
|
|
$data['poster']=input('poster');
|
|
$data['banner']=input('banner');
|
|
$data['pic']=input('pic');
|
|
$data['infor']=input('infor');
|
|
$data['smsid']=input('smsid');
|
|
$start=input('start_date');
|
|
if($start)$start=strtotime($start);
|
|
$data['start_date']=$start;
|
|
$end=input('end_date');
|
|
if($end)$end=strtotime($end);
|
|
$data['end_date']=$end;
|
|
$data['create_date']=time();
|
|
$groups=isset($_POST['groups'])?$_POST['groups']:'';
|
|
$data['groups']=is_array($groups)?implode(',', $groups):'';
|
|
$apply=input('apply')?htmlspecialchars_decode(input('apply')):'';
|
|
if($apply){
|
|
$applylist=json_decode($apply,true);
|
|
array_multisort(array_column($applylist,'fsort'),SORT_ASC,$applylist);
|
|
$apply=$applylist;
|
|
$apply=json_encode($apply);
|
|
$fileds=array_column($applylist,'ftag');
|
|
$cfileds=Db::name('activityapply')->getTableFields(['table'=>'wjs_activityapply']);
|
|
|
|
$update=true;
|
|
foreach ($fileds as $k=>$row){
|
|
if(!in_array($row, $cfileds)){
|
|
$current=$applylist[$k];
|
|
$curtext='varchar(255)';
|
|
if($current['ftype']=='checkbox'||$current['ftype']=='select'||$current['ftype']=='date') $curtext='int(11)';
|
|
if($current['ftype']=='textarea') $curtext='text';
|
|
if($current['frequire']==1)$curtext.=" not null ";
|
|
$sql="alter table wjs_activityapply add column ".$current['ftag']." ".$curtext." comment '".$current['fname'].' '.$current['foptions']."'";
|
|
|
|
$query=db()->execute($sql);
|
|
if(!$query){
|
|
$update=false;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
if(!$update){
|
|
$this->error('修改失败',url('admin/Activitys/index',['kind'=>$kind]));
|
|
}
|
|
}
|
|
$data['apply']=$apply;
|
|
|
|
$admin_id=Db::name('activity')->insert($data);
|
|
if($admin_id){
|
|
$this->success('添加成功',url('admin/Activitys/index',['kind'=>$kind]));
|
|
}else{
|
|
$this->error('添加失败',url('admin/Activitys/index',['kind'=>$kind]));
|
|
}
|
|
}
|
|
/**
|
|
* 修改
|
|
*/
|
|
public function edit()
|
|
{
|
|
$kind=input("kind");
|
|
$this->assign('kind',$kind);
|
|
$list=Db::name('activity')->find(input('admin_id'));
|
|
$list['groups']=$list['groups']?explode(',',$list['groups']):[];
|
|
|
|
$apply=$list['apply']?json_decode(htmlspecialchars_decode($list['apply']),true):[];
|
|
|
|
if(!count($apply)){
|
|
array_push($apply,['fname'=>'姓名','ftag'=>'uname','ftype'=>'input','frequire'=>1,'foptions'=>'','fnotice'=>'','del'=>1,'fsort'=>1]);
|
|
array_push($apply,['fname'=>'性别','ftag'=>'usex','ftype'=>'radio','frequire'=>1,'foptions'=>'男||女','fnotice'=>'','del'=>1,'fsort'=>2]);
|
|
array_push($apply,['fname'=>'年龄','ftag'=>'uage','ftype'=>'input','frequire'=>1,'foptions'=>'','fnotice'=>'','del'=>1,'fsort'=>3]);
|
|
array_push($apply,['fname'=>'工作','ftag'=>'ujob','ftype'=>'input','frequire'=>1,'foptions'=>'','fnotice'=>'','del'=>1,'fsort'=>4]);
|
|
array_push($apply,['fname'=>'电话','ftag'=>'utel','ftype'=>'input','frequire'=>1,'foptions'=>'','fnotice'=>'','del'=>1,'fsort'=>5]);
|
|
array_push($apply,['fname'=>'邮箱','ftag'=>'uemail','ftype'=>'input','frequire'=>1,'foptions'=>'','fnotice'=>'','del'=>1,'fsort'=>6]);
|
|
}
|
|
$this->assign("apply",$apply);
|
|
|
|
$this->assign('list',$list);
|
|
$auth_group=Db::name('auth_group')->where('status','1')->select();
|
|
$this->assign('groups',$auth_group);
|
|
$list=Db::name('smstpl')->where('status','1')->select();
|
|
$this->assign('tpls',$list);
|
|
$this->assign('role',$this->groupid);
|
|
return $this->fetch();
|
|
}
|
|
/**
|
|
* 修改操作
|
|
*/
|
|
public function runedit()
|
|
{
|
|
|
|
$kind=input("kind");
|
|
$this->assign('kind',$kind);
|
|
|
|
$data=[];
|
|
$data['title']=input('title');
|
|
$data['kind']=$kind;
|
|
$data['status']=input('status');
|
|
$data['login']=input('login');
|
|
$data['contact']=input('contact');
|
|
$data['notice']=input('notice');
|
|
$data['poster']=input('poster');
|
|
$data['banner']=input('banner');
|
|
$data['pic']=input('pic');
|
|
$data['infor']=input('infor');
|
|
$data['smsid']=input('smsid');
|
|
$start=input('start_date');
|
|
if($start)$start=strtotime($start);
|
|
$data['start_date']=$start;
|
|
$end=input('end_date');
|
|
if($end)$end=strtotime($end);
|
|
$data['end_date']=$end;
|
|
$data['create_date']=time();
|
|
$groups=isset($_POST['groups'])?$_POST['groups']:'';
|
|
$data['groups']=is_array($groups)?implode(',', $groups):'';
|
|
$apply=input('apply')?htmlspecialchars_decode(input('apply')):'';
|
|
if($apply){
|
|
$applylist=json_decode($apply,true);
|
|
array_multisort(array_column($applylist,'fsort'),SORT_ASC,$applylist);
|
|
$apply=$applylist;
|
|
$apply=json_encode($apply);
|
|
$fileds=array_column($applylist,'ftag');
|
|
$cfileds=Db::name('activityapply')->getTableFields(['table'=>'wjs_activityapply']);
|
|
|
|
$update=true;
|
|
foreach ($fileds as $k=>$row){
|
|
if(!in_array($row, $cfileds)){
|
|
$current=$applylist[$k];
|
|
$curtext='varchar(255)';
|
|
if($current['ftype']=='checkbox'||$current['ftype']=='select'||$current['ftype']=='date') $curtext='int(11)';
|
|
if($current['ftype']=='textarea') $curtext='text';
|
|
if($current['frequire']==1)$curtext.=" not null ";
|
|
$sql="alter table wjs_activityapply add column ".$current['ftag']." ".$curtext." comment '".$current['fname'].' '.$current['foptions']."'";
|
|
|
|
$query=db()->execute($sql);
|
|
if(!$query){
|
|
$update=false;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
if(!$update){
|
|
$this->error('修改失败',url('admin/Activitys/index',['kind'=>$kind]));
|
|
}
|
|
}
|
|
$data['apply']=$apply;
|
|
$id=input('id');
|
|
$rst=Db::name('activity')->where(['id'=>$id])->update($data);
|
|
if($rst!==false){
|
|
$this->success('修改成功',url('admin/Activitys/index',['kind'=>$kind]));
|
|
}else{
|
|
$this->error('修改失败',url('admin/Activitys/index',['kind'=>$kind]));
|
|
}
|
|
}
|
|
/**
|
|
* 删除
|
|
*/
|
|
public function del()
|
|
{
|
|
$kind=input("kind");
|
|
$this->assign('kind',$kind);
|
|
$admin_id=input('id');
|
|
if (empty($admin_id)){
|
|
$this->error('ID不存在',url('admin/Activitys/index',['kind'=>$kind]));
|
|
}
|
|
$rst=Db::name('activity')->delete($admin_id);
|
|
if($rst!==false){
|
|
$this->success('删除成功',url('admin/Activitys/index',['kind'=>$kind]));
|
|
}else{
|
|
$this->error('删除失败',url('admin/Activitys/index',['kind'=>$kind]));
|
|
}
|
|
}
|
|
|
|
public function export(){
|
|
$id=input('admin_id');
|
|
$map=['id'=>$id];
|
|
$activity=Db::name('activity')->where($map)->find();
|
|
if(!$activity)$this->error("活动不存在");
|
|
$applys=Db::name('activityapply')->where(['aid'=>$id])->select();
|
|
$apply=json_decode($activity['apply'],true);
|
|
|
|
$expTitle=$activity['title'];
|
|
$expCellName=[];
|
|
foreach ($apply as $jow){
|
|
if($jow['ftag']&&$jow['fname']&&$jow['ftype']!='file'&&$jow['ftype']!='notice')array_push($expCellName,[$jow['ftag'],$jow['fname'],$jow['foptions'],$jow['ftype']]);
|
|
}
|
|
array_push($expCellName,['create_time','报名时间','','date']);
|
|
$apply=$activity['apply']?json_decode($activity['apply'],true):[];
|
|
foreach ($applys as &$row){
|
|
$row['usex']=$row['usex']==1?'男':'女';
|
|
if(count($apply)){
|
|
foreach ($apply as $j=>$jow){
|
|
$key=$jow['ftag'];
|
|
$val=$row[$key];
|
|
if($jow['ftype']=='select'||$jow['ftype']=='radio'){
|
|
$opts=$jow['foptions'];
|
|
if($opts){
|
|
$opts=explode("||", $opts);
|
|
$val=intval($val);
|
|
$val=isset($opts[$val-1])?$opts[$val-1]:'';
|
|
if($jow['ftype']=='radio'&&$val=='其他'){
|
|
$val.=$row['uother'];
|
|
}
|
|
}
|
|
}
|
|
if($jow['ftype']=='checkbox'){
|
|
$opts=$jow['foptions'];
|
|
if($opts){
|
|
$opts=explode("||", $opts);
|
|
$shtml='';
|
|
$vals=explode(",", $val);
|
|
foreach ($vals as $tmp){
|
|
$tmp=intval($tmp);
|
|
$shtml.=isset($opts[$tmp-1])?$opts[$tmp-1].';':'';
|
|
}
|
|
$val=$shtml;
|
|
}
|
|
}
|
|
$row[$key]=$val;
|
|
}
|
|
}
|
|
}
|
|
$expTableData=$applys;
|
|
$res=exportExcel($expTitle,$expCellName,$expTableData);
|
|
}
|
|
/**
|
|
* 列表
|
|
*/
|
|
public function tpl()
|
|
{
|
|
$kind=input("kind");
|
|
$this->assign('kind',$kind);
|
|
$search_name=input('search_name');
|
|
$this->assign('search_name',$search_name);
|
|
$map=array();
|
|
if($kind)$map['kind']=$kind;
|
|
if($search_name){
|
|
$map['title']= array('like',"%".$search_name."%");
|
|
}
|
|
$admin_list=Db::name('smstpl')->where($map)->order('id desc')->paginate(config('paginate.list_rows'),false,['query'=>get_query()]);
|
|
$page = $admin_list->render();
|
|
$this->assign('list',$admin_list);
|
|
$this->assign('page',$page);
|
|
return $this->fetch();
|
|
}
|
|
/**
|
|
* 添加
|
|
*/
|
|
public function addtpl()
|
|
{
|
|
$kind=input("kind");
|
|
$this->assign('kind',$kind);
|
|
return $this->fetch();
|
|
}
|
|
/**
|
|
* 添加操作
|
|
*/
|
|
public function runaddtpl()
|
|
{
|
|
$data=[];
|
|
$data['title']=input('title');
|
|
$data['status']=input('status');
|
|
$data['infor']=input('infor');
|
|
$data['create_date']=time();
|
|
$admin_id=Db::name('smstpl')->insert($data);
|
|
$url=url('admin/Activitys/tpl');
|
|
if($admin_id){
|
|
$this->success('添加成功',$url);
|
|
}else{
|
|
$this->error('添加失败',$url);
|
|
}
|
|
}
|
|
/**
|
|
* 修改
|
|
*/
|
|
public function edittpl()
|
|
{
|
|
$kind=input("kind");
|
|
$this->assign('kind',$kind);
|
|
$list=Db::name('smstpl')->find(input('admin_id'));
|
|
$this->assign('list',$list);
|
|
|
|
return $this->fetch();
|
|
}
|
|
/**
|
|
* 修改操作
|
|
*/
|
|
public function runedittpl()
|
|
{
|
|
$data=[];
|
|
$data['title']=input('title');
|
|
$data['status']=input('status');
|
|
$data['infor']=input('infor');
|
|
$data['create_date']=time();
|
|
$id=input('id');
|
|
$rst=Db::name('smstpl')->where(['id'=>$id])->update($data);
|
|
$url=url('admin/Activitys/tpl');
|
|
if($rst!==false){
|
|
$this->success('修改成功',$url);
|
|
}else{
|
|
$this->error('修改失败',$url);
|
|
}
|
|
}
|
|
/**
|
|
* 删除
|
|
*/
|
|
public function deltpl()
|
|
{
|
|
$kind=input("kind");
|
|
$this->assign('kind',$kind);
|
|
$admin_id=input('id');
|
|
$url=url('admin/Activitys/tpl');
|
|
if (empty($admin_id)){
|
|
$this->error('ID不存在',$url);
|
|
}
|
|
$rst=Db::name('smstpl')->delete($admin_id);
|
|
if($rst!==false){
|
|
$this->success('删除成功',$url);
|
|
}else{
|
|
$this->error('删除失败',$url);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 列表
|
|
*/
|
|
public function sms()
|
|
{
|
|
$kind=input("kind",'activitys');
|
|
$this->assign('kind',$kind);
|
|
$search_name=input('search_name');
|
|
$this->assign('search_name',$search_name);
|
|
$map=array();
|
|
if($kind)$map['sms_type']=$kind;
|
|
if($search_name){
|
|
$map['sms_txt|sms_tel']= array('like',"%".$search_name."%");
|
|
}
|
|
|
|
$admin_list=Db::name('smslog')->where($map)->order('sms_id desc')->paginate(config('paginate.list_rows'),false,['query'=>get_query()]);
|
|
$page = $admin_list->render();
|
|
$this->assign('list',$admin_list);
|
|
$this->assign('page',$page);
|
|
return $this->fetch();
|
|
}
|
|
|
|
/**
|
|
* 删除
|
|
*/
|
|
public function delsms()
|
|
{
|
|
$kind=input("kind");
|
|
$this->assign('kind',$kind);
|
|
$admin_id=input('id');
|
|
$url=url('admin/Activitys/sms');
|
|
if (empty($admin_id)){
|
|
$this->error('ID不存在',$url);
|
|
}
|
|
$rst=Db::name('smslog')->delete($admin_id);
|
|
if($rst!==false){
|
|
$this->success('删除成功',$url);
|
|
}else{
|
|
$this->error('删除失败',$url);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 列表
|
|
*/
|
|
public function apply()
|
|
{
|
|
$kind=input("kind");
|
|
$this->assign('kind',$kind);
|
|
$aid=input('aid');
|
|
$search_name=input('search_name');
|
|
$this->assign('search_name',$search_name);
|
|
$map=array();
|
|
if($kind)$map['kind']=$kind;
|
|
if($search_name){
|
|
$map['uname|ucard']= array('like',"%".$search_name."%");
|
|
}
|
|
if($aid)$map['aid']=$aid;
|
|
$admin_list=Db::name('activityapply')->where($map)->order('id desc')->paginate(config('paginate.list_rows'),false,['query'=>get_query()]);
|
|
$page = $admin_list->render();
|
|
$this->assign('list',$admin_list);
|
|
$this->assign('page',$page);
|
|
$this->assign('aid',$aid);
|
|
return $this->fetch();
|
|
}
|
|
/**
|
|
* 修改
|
|
*/
|
|
public function editapply()
|
|
{
|
|
$kind=input("kind");
|
|
$this->assign('kind',$kind);
|
|
$list=Db::name('activityapply')->find(input('admin_id'));
|
|
$aid=isset($list['aid'])?$list['aid']:'';
|
|
$showlist=[];
|
|
if($aid&&$list){
|
|
$activity=Db::name('activity')->where(['id'=>$aid])->find();
|
|
$apply=$activity['apply']?json_decode($activity['apply'],true):[];
|
|
if(count($apply)){
|
|
foreach ($apply as $j=>$jow){
|
|
$key=$jow['ftag'];
|
|
$val=$list[$key];
|
|
if($jow['ftype']=='date'){
|
|
$val=date("Y-m-d",$val);
|
|
}
|
|
if($jow['ftype']=='select'||$jow['ftype']=='radio'){
|
|
$opts=$jow['foptions'];
|
|
if($opts){
|
|
$opts=explode("||", $opts);
|
|
$val=intval($val);
|
|
$val=isset($opts[$val-1])?$opts[$val-1]:'';
|
|
if($jow['ftype']=='radio'&&$val=='其他'){
|
|
$val.=$list['uother'];
|
|
}
|
|
}
|
|
}
|
|
if($jow['ftype']=='checkbox'){
|
|
$opts=$jow['foptions'];
|
|
if($opts){
|
|
$opts=explode("||", $opts);
|
|
$shtml='';
|
|
$vals=explode(",", $val);
|
|
foreach ($vals as $tmp){
|
|
$tmp=intval($tmp);
|
|
$shtml.=isset($opts[$tmp-1])?$opts[$tmp-1].';':'';
|
|
}
|
|
$val=$shtml;
|
|
}
|
|
}
|
|
if($jow['ftype']=='file'){
|
|
$files=explode(";", $val);
|
|
$shtml='';
|
|
foreach ($files as $k=>$tmp){
|
|
$file=pathinfo($tmp);
|
|
if(isset($file['extension'])){
|
|
if(in_array($file['extension'],['jpg','jpeg','png','gif'])){
|
|
$shtml.='<img src="'.SITE_PATH.$tmp.'" style="max-width:100px;margin-right:5px;"/>';
|
|
}else{
|
|
$shtml.='<a href="'.SITE_PATH.$tmp.'" target="__blank">附件'.$k.'</a>';
|
|
}
|
|
}
|
|
}
|
|
$val=$shtml;
|
|
}
|
|
if($jow['ftype']!='notice')array_push($showlist,['key'=>$jow['fname'],'val'=>$val]);
|
|
}
|
|
}
|
|
}
|
|
$this->assign('showlist',$showlist);
|
|
$this->assign('list',$list);
|
|
|
|
return $this->fetch();
|
|
}
|
|
/**
|
|
* 删除
|
|
*/
|
|
public function delapply()
|
|
{
|
|
$kind=input("kind");
|
|
$this->assign('kind',$kind);
|
|
$admin_id=input('id');
|
|
$url=url('admin/Activitys/apply');
|
|
if (empty($admin_id)){
|
|
$this->error('ID不存在',$url);
|
|
}
|
|
$rst=Db::name('activityapply')->delete($admin_id);
|
|
if($rst!==false){
|
|
$this->success('删除成功',$url);
|
|
}else{
|
|
$this->error('删除失败',$url);
|
|
}
|
|
}
|
|
/**
|
|
* 审核/取消审核
|
|
*/
|
|
public function editstate(){
|
|
if(request()->isAjax()){
|
|
$exptime=input('exptime');
|
|
$data=[];
|
|
$data['express']=input('express');
|
|
$data['expname']=input('expname');
|
|
$data['exptime']=$exptime?strtotime($exptime):'';
|
|
$data['state']=input('state');
|
|
$data['advice']=input('advice');
|
|
$data['passtime']=(input('state')==1)?time():'';
|
|
$id=input('id');
|
|
$aid=input('aid');
|
|
$rst=Db::name('activityapply')->where(['id'=>$id])->update($data);
|
|
$url=url("apply",['aid'=>$aid]);
|
|
if($rst!==false){
|
|
$this->success('审核成功',$url);
|
|
}else{
|
|
$this->error('审核失败',$url);
|
|
}
|
|
}
|
|
$id=input('id');
|
|
$aid=input('aid');
|
|
$find=Db::name('activityapply')->where(array('id'=>$id))->find();
|
|
|
|
$this->assign('list',$find);
|
|
$this->assign('aid',$aid);
|
|
return $this->fetch();
|
|
}
|
|
/**
|
|
* 审核/取消审核
|
|
*/
|
|
public function state()
|
|
{
|
|
$id=input('x');
|
|
$find=Db::name('activityapply')->where(array('id'=>$id))->find();
|
|
$msg='未审';
|
|
if($find){
|
|
|
|
$status=$find['state'];
|
|
if($status==1){
|
|
$statedata = array('state'=>0);
|
|
}else{
|
|
$statedata = array('state'=>1);
|
|
$msg='已审';
|
|
}
|
|
$send=$find['send'];
|
|
if($send==0){
|
|
$statedata['send']=1;
|
|
}
|
|
$query=Db::name('activityapply')->where(array('id'=>$id))->setField($statedata);
|
|
if($send==0&&$query){
|
|
$aid=$find['aid'];
|
|
$act=Db::name('activity')->where(array('id'=>$aid))->find();
|
|
if($act){
|
|
$notice_title='您好,您的活动报名('.$act['title'].')已审核成功 ';
|
|
$notice='';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice_title,
|
|
'user_id'=>$find['uid'],
|
|
'apply_id'=>$aid,
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('activitynotice')->insert($sl_data);
|
|
}
|
|
}
|
|
}
|
|
$this->success($msg);
|
|
}
|
|
}
|
|
|