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

报名后逻辑修改

... ... @@ -336,8 +336,6 @@ class IndexController extends RestBaseController
$title='成为志愿者';
}
if ($is_volunteer==1 && $check==0 && $is_pass==1 && $is_book==1){
$status=4;
$title='已签到';
... ... @@ -374,6 +372,7 @@ class IndexController extends RestBaseController
$map1=[];
$sub_map['j.activity_id']=$id;
$sub_map['j.status']=['in','1,3'];
$sub_map['j.delete_time']=0;
$subQuery = db('join')->alias('j')
->field('max(j.id)')
... ... @@ -382,6 +381,7 @@ class IndexController extends RestBaseController
->group('j.user_id')
->select()
->toArray();
if (!empty($subQuery)){
foreach ($subQuery as $k=>$v){
$new_map[]=$v["max(j.id)"];
... ... @@ -390,8 +390,8 @@ class IndexController extends RestBaseController
}
$map1['j.activity_id']=$id;
//dump($map1);
$map1['j.status']=['in','1,3'];
$map1['j.delete_time']=0;
$people=db('join')->alias('j')
->group('j.user_id')
... ... @@ -559,6 +559,7 @@ class IndexController extends RestBaseController
$Join=new JoinModel();
$where['user_id']=$userId;
$where['activity_id']=$activity_id;
$where['status']=1;
$where['delete_time']=0;
$join=$Join->findData($where);
if (empty($join)){
... ... @@ -633,9 +634,11 @@ class IndexController extends RestBaseController
$map['user_id']=$userId;
$map['activity_id']=$activity_id;
$map['delete_time']=0;
$map['status']=0;
$join=$Join->findData($map);
if ($join){
// $this->error('已经报名参加过该活动!');
$this->error('已经报名参加过该活动!');
}
$data['user_id']=$userId;
$data['card_number']=$card_number;
... ... @@ -743,7 +746,7 @@ class IndexController extends RestBaseController
* @return select_time:选择日期
* @return apply_stay:申请入住
* @return apply_food:申请用餐
*
*
*/
public function getApplyInfo(){
... ... @@ -920,14 +923,21 @@ class IndexController extends RestBaseController
* @header name:XX-Token require:1 default: desc:token
*
* @param name:city_id type:int require:1 other: desc:城市id
* @param name:end type:int require:1 other: desc:0,未结束1,已结束
* @return activity:活动@
* @activity id:id activity_name:活动名称 abstract:摘要 thumbnail:缩略图 time:时间 content:内容 province_name:省市地区
*/
public function cityGetActivity(){
$city_id=input('city_id');
$end=input('end');
if (empty($end)||$end==0){
$type='>=';
}else{
$type='<';
}
$Activity=new ActivityModel();
$activity=$Activity->selectCityData($city_id);
$activity=$Activity->selectCityData($city_id,$type);
$this->success('',$activity);
}
... ... @@ -965,14 +975,21 @@ class IndexController extends RestBaseController
* @header name:XX-Token require:1 default: desc:token
*
* @param name:type n_id type:int require:1 other: desc:类型id
* @param name:end type:int require:1 other: desc:0,未结束1,已结束
* @return activity:活动@
* @activity id:id activity_name:活动名称 abstract:摘要 thumbnail:缩略图 time:时间 content:内容 province_name:省市地区
*/
public function typeGetActivity(){
$type_id=input('type');
$end=input('end');
if (empty($end)||$end==0){
$type='>=';
}else{
$type='<';
}
$Activity=new ActivityModel();
$activity=$Activity->selectTypeData($type_id);
$activity=$Activity->selectTypeData($type_id,$type);
$this->success('',$activity);
}
... ... @@ -1038,8 +1055,6 @@ class IndexController extends RestBaseController
$last->mergeImage('../static/images/bottom.png','png',595,536,425,0);
$last->mergeImage('../upload/qrcode/1-'.$id.'.png','png',595,536,477,160);
$last->save('../upload/qrcode/4-'.$id.'.png');
dump($circle);
dump($Image->get());*/
... ...
... ... @@ -56,21 +56,25 @@ class MemberCenterController extends RestBaseController
//判断当前用户是否提交过
$volunteerModel = new VolunteerModel();
$result = $volunteerModel->findData(array('user_id'=>$user_id,'delete_time'=>0));
// dump($result->toArray());
$userModel = new UserModel();
$user = $userModel->findData(array('id'=>$user_id));
if(empty($result)){
$is_submit = 0;
}else {
$user['avatar']=$result['photo'];
$user['user_nickname']=$result['name'];
$is_submit = 1;
}
if (empty($result['level'])){
$result['level']=0;
}
if (empty($result['work_time'])){
$result['work_time']=0;
}
$user['level']=$result['level'];
$user['work_time']=$result['work_time'];
$user['is_submit'] = $is_submit;
... ... @@ -452,6 +456,8 @@ class MemberCenterController extends RestBaseController
*
*/
public function addTime(){
$user_id = $this->getUserId();
//判断这个用户是不是管理员
$userModel = new UserModel();
... ... @@ -461,20 +467,24 @@ class MemberCenterController extends RestBaseController
}
$map['id']=input('join_id');
$time=input('add_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);
$user_id1=input('user_id');
if (empty($user_id1)){
$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);
}
}else{
$add_time=$join['work_time']-$time;
\db('volunteer')->where('user_id',$join['user_id'])->setDec('work_time',$add_time);
\db('volunteer')->where('user_id',$user_id1)->setInc('work_time',$time);
}
$result=1;
/* // $data['add_time']=['exp','work_time'+$time];
... ... @@ -486,6 +496,12 @@ class MemberCenterController extends RestBaseController
$this->error('此人不是审核通过的志愿者!');
}
}
/**
* @title 管理员查看活动申请详情
* @description 管理员审核
... ... @@ -574,6 +590,7 @@ class MemberCenterController extends RestBaseController
if(empty($id)){
$this->error('缺少参数id');
}
$data['refund_reason']=input('refund_reason')??'';
$status = $this->request->param('status');
if(empty($status)){
$this->error('缺少参数status');
... ... @@ -594,34 +611,38 @@ class MemberCenterController extends RestBaseController
if ($data['status']==2){
$keyword='审核通过';
}else{
$keyword='审核未通过';
$keyword="审核未通过 原因:$data[refund_reason]";
}
$data['refund_reason']=input('refund_reason')??'';
$result = $volunteerModel->updateData(array('id'=>$id),$data);
if(empty($result)){
$this->success(['code'=>40002,'msg'=>'当前申请可能已被其他管理员审核,请刷新页面!']);
}
$userMap['user_id']=$id;
$openid=db('third_party_user')->where($userMap)->value('openid');
$volunteer=db('volunteer')->where('id',$id)->find();
$formMap['user_id']=$id;
$userMap['user_id']=$volunteer['user_id'];
$openid=db('third_party_user')->where($userMap)->value('openid');
$formMap['user_id']=$volunteer['user_id'];
$formMap['use_time']=0;
$formMap['expire_time']=['>',time()];
$form_id=\db('form_id')->where($formMap)->find();
$data['keyword1']= $volunteer['name'];
$data['keyword2']='志愿者审核';
$data['keyword3']=$keyword;
$data['keyword4']='志愿者审核';
$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);
$now=time();
\db('form_id')->where('form_id',$form_id['form_id'])->update(['use_time'=>$now]);
if (!empty($form_id)){
$data['keyword1']= $volunteer['name'];
$data['keyword2']='志愿者审核';
$data['keyword3']=$keyword;
$data['keyword4']='志愿者审核';
$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(['code'=>20000,'msg'=>'更新成功!']);
}
... ... @@ -677,7 +698,7 @@ class MemberCenterController extends RestBaseController
->group('a.user_id')
->select()
->toArray();*/
$new_map=[];
$subQuery = db('join')->alias('j')
->field('max(j.id)')
->join('volunteer v','v.user_id=j.user_id')
... ... @@ -828,6 +849,8 @@ class MemberCenterController extends RestBaseController
$formMap['use_time']=0;
$formMap['expire_time']=['>',time()];
$form_id=\db('form_id')->where($formMap)->find();
$now=time();
\db('form_id')->where('form_id',$form_id['form_id'])->update(['use_time'=>$now]);
if ($data['status']==1){
if (!empty($form_id)){
... ... @@ -872,7 +895,6 @@ class MemberCenterController extends RestBaseController
}
}
protected function wxappNotice($message){
$appId = 'wx7a3bf4e0796c070a';
$secret = '755478f064e09a8301345e0c427c6cf3';
... ... @@ -886,7 +908,7 @@ class MemberCenterController extends RestBaseController
try{
$result= $notice->send($message);
}catch(Exception $e){
$e->getMessage();
// $e->getMessage();
}
return $result;
}
... ...
... ... @@ -78,12 +78,11 @@ class ActivityModel extends Model
return $data;
}
public function selectCityData($city_id){
public function selectCityData($city_id,$type=">="){
$order = "create_time desc";
$where['a.delete_time'] = ['eq',0];
$where['a.is_up']=1;
$where['a.end_time']=['>',time()];
$where['a.end_time']=[$type,time()];
if (!empty($city_id)){
$where['a.position_id'] = $city_id;
}
... ... @@ -96,15 +95,17 @@ class ActivityModel extends Model
->order($order)
->select()
->toArray();
// echo $this->getLastSql();
return $data;
}
public function selectTypeData($type_id){
public function selectTypeData($type_id,$type="<="){
$order = "create_time desc";
$where['a.delete_time'] = ['eq',0];
$where['a.is_up']=1;
$where['a.end_time']=['>',time()];
$where['a.end_time']=[$type,time()];
if (!empty($type_id)){
$where['a.activity_type'] = $type_id;
}
... ...
... ... @@ -75,7 +75,7 @@ class PublicController extends RestBaseController
{
$validate = new Validate([
'openid' => 'require',
'session_key' => 'require',
'session_key' => 'require',
'encrypted_data' => 'require',
'iv' => 'require',
]);
... ... @@ -189,13 +189,51 @@ class PublicController extends RestBaseController
$openid = $this->request->param('openid');
$third_party_user = Db::name('third_party_user')->where(array('openid'=>$openid))->find();
if(empty($third_party_user)){
$this->success('查无此人!',['code'=>20000,'msg'=>'查无此人!']);
/*没有相关用户 添加用户到数据库 分配token*/
$ip = $this->request->ip(0, true);
$currentTime=time();
Db::startTrans();
$appId = config('app_id');
$userId = Db::name("user")->insertGetId([
'create_time' => $currentTime,
'user_status' => 1,
'user_type' => 2,
'sex' => 0,
'user_nickname' => '用户',
'avatar' => '',
'last_login_ip' => $ip,
'last_login_time' => $currentTime
]);
$row=Db::name("third_party_user")->insert([
'openid' => $openid,
'user_id' => $userId,
'third_party' => 'wxapp',
'app_id' => $appId,
'last_login_ip' => $ip,
'union_id' => '',
'last_login_time' => $currentTime,
'create_time' => $currentTime,
'login_times' => 1,
'status' => 1
]);
if($userId && $row){
Db::commit();
$token = cmf_generate_user_token($userId, 'wxapp');
$this->success("登录成功!", ['token' => $token]);
}else{
Db::rollback();
$this->error(['code'=>'40004','msg'=>'登录失败']);
}
// $this->success('查无此人!',['code'=>20000,'msg'=>'查无此人!']);
}
$data = Db::name('user_token')->where(array('user_id'=>$third_party_user['user_id']))->find();
if($data['expire_time']<time()){
$this->success('token过期了',['code'=>20000,'msg'=>'token过期了']);
$token = cmf_generate_user_token($third_party_user['user_id'], 'wxapp');
$this->success('ok',['code'=>20000,'msg'=>'ok','token'=>$token]);
}else{
$this->success('ok',['code'=>20000,'msg'=>'ok','data'=>$data['token']]);
$this->success('ok',['code'=>20000,'msg'=>'ok','token'=>$data['token']]);
}
}
... ...
... ... @@ -25,23 +25,26 @@ class ActivityController extends AdminBaseController
$startTime = empty($param['start_time']) ? 0 : strtotime($param['start_time']);
$endTime = empty($param['end_time']) ? 0 : strtotime($param['end_time']);
if (!empty($startTime) && !empty($endTime)) {
$where['create_time'] = [['>= time', $startTime], ['<= time', $endTime]];
$where['a.create_time'] = [['>= time', $startTime], ['<= time', $endTime]];
} else {
if (!empty($startTime)) {
$where['create_time'] = ['>= time', $startTime];
$where['a.create_time'] = ['>= time', $startTime];
}
if (!empty($endTime)) {
$where['create_time'] = ['<= time', $endTime];
$where['a.create_time'] = ['<= time', $endTime];
}
}
$keyword = empty($param['keyword']) ? '' : $param['keyword'];
if (!empty($keyword)) {
$where['activity_name|abstract'] = ['like', "%$keyword%"];
$where['a.activity_name|a.abstract'] = ['like', "%$keyword%"];
}
$data=Db::name('activity')
->where('delete_time',0)
->alias('a')
->join('activity_type at','a.activity_type=at.id','LEFT')
->join('position_city pc','a.position_id=pc.id','LEFT')
->where('a.delete_time',0)
->where($where)
->order('create_time desc')
->order('a.create_time desc')
->paginate(10);
$data->appends($param);
$list=$data->items();
... ... @@ -55,6 +58,7 @@ class ActivityController extends AdminBaseController
'data'=>$list,
'page'=>$data->render(),
]);
//dump($list);
$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'] : '');
... ... @@ -453,7 +457,7 @@ class ActivityController extends AdminBaseController
$map['j.activity_id']=input('id');
//$map['j.delete_time']=0;
$join=\db('join')
->field('j.*,v.name,v.photo')
->field('j.*,v.name,v.photo,v.card_number')
->alias('j')
->join('volunteer v','v.user_id=j.user_id')
->where($map)
... ... @@ -466,9 +470,9 @@ class ActivityController extends AdminBaseController
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');
$join[$k]['select_time']=json_decode($v['select_time'],true);
$join[$k]['apply_stay']=json_decode($v['apply_stay'],true);
$join[$k]['work_content']=\db('work')->where('id',$v['work_content'])->value('name');
$join[$k]['select_time'] =json_decode($v['select_time'],true);
$join[$k]['apply_stay'] =json_decode($v['apply_stay'],true);
$join[$k]['apply_food']=json_decode($v['apply_food'],true);
}
$this->assign('data',$join);
... ... @@ -649,20 +653,22 @@ class ActivityController extends AdminBaseController
public function excel(){
$map['j.activity_id']=input('id');
$activity=\db('activity')->where('id',$map['j.activity_id'])->find();
$map['j.status']=['in','1,3'];
$map['j.delete_time']=0;
$join=\db('join')
->field('j.*,v.name,v.photo')
->field('j.*,v.name,v.photo,v.sex,v.card_number,v.move_phone,v.birthday')
->alias('j')
->join('volunteer v','v.user_id=j.user_id')
->where($map)
->select()
->toArray();
/*dump($join);*/
$work=\db('work')->select()->toArray();
/* dump($join);
exit();*/
//dump(get_image_path('https://volunteer.cnpu.org/upload/20190112/9bd2840928f0acee61ce6c906cda32c3.jpg'));
foreach ($join as $k=>$v){
/*dump($k);*/
$join[$k]['card_number']='`'.$v['card_number'];
if (!empty($v['add_time'])){
$join[$k]['add_time']=date('Y-m-d H:i:s',$v['add_time']);
}
... ... @@ -694,8 +700,6 @@ class ActivityController extends AdminBaseController
$join[$k]['apply_stay']='';
}
if (!empty($v['apply_food'])){
$select[$k]=json_decode($v['apply_food'],true);
foreach ($select[$k] as $k1=>$v1){
... ... @@ -730,13 +734,26 @@ class ActivityController extends AdminBaseController
$join[$k]['type']='线上及线下';
break;
}
switch ($v['sex']){
case 1:
$join[$k]['sex']='男';
break;
case 2:
$join[$k]['sex']='女';
break;
}
$join[$k]['work_content']=$work[$v['work_content']-1]['name'];
}
$title = [
['ID', 15, 'id', 1],
['姓名', 15, 'name', 1],
/* ['图片', 15, 'photo', 2,200],*/
['性别', 15, 'sex', 1],
['出生日期', 15, 'birthday', 1],
['电话', 15, 'move_phone', 1],
['身份证号', 25, 'card_number', 1],
['参与方式', 15, 'type', 1],
['审核状态', 15, 'status', 1],
['工作内容', 15, 'work_content', 1],
['选择时间', 30, 'select', 1],
['申请入住', 30, 'stay', 1],
['申请用餐', 30, 'food', 1],
... ... @@ -746,7 +763,7 @@ class ActivityController extends AdminBaseController
$Excel = new Excel();
$letter = $Excel->excelAcross(count($title));
$Excel->excel($letter, $title, $join, "$activity[activity_name]活动申请列表");
$Excel->excel($letter, $title, $join, "$activity[activity_name]参与人员");
}
public function addtime(){
... ...
... ... @@ -50,16 +50,23 @@ class VolunteerController extends AdminBaseController
if (!empty($addr)) {
$where['addr'] = ['like', "%$addr%"];
}
$data = Db::name('volunteer')
$list = Db::name('volunteer')
->where('delete_time', 0)
->where($where)
->order('create_time desc')
->paginate(10);
$data->appends($param);
$list->appends($param);
$data=$list->items();
$year=date('Y');
foreach ($data as $k=>$v){
$data[$k]['age']=$year-date('Y',strtotime($v['birthday']));
$data[$k]['level']=get_level($v['work_time']);
}
$this->assign([
'data' => $data,
'page' => $data->render(),
'page' => $list ->render(),
]);
$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'] : '');
... ... @@ -69,6 +76,7 @@ class VolunteerController extends AdminBaseController
return $this->fetch();
}
//编辑
public function edit()
{
... ... @@ -281,7 +289,7 @@ class VolunteerController extends AdminBaseController
$Excel = new Excel();
$letter = $Excel->excelAcross(count($title));
$Excel->excel($letter, $title, $data, '志愿者列表');
$Excel->excel($letter, $title, $data, 'volunteers');
}
public function sendnotice(){
... ... @@ -318,5 +326,26 @@ class VolunteerController extends AdminBaseController
}
}
public function pass(){
$id=input('id');
$update['status']='2';
$result=\db('volunteer')->where('id',$id)->update($update);
if ($result>0){
$this->success('编辑成功!');
}else{
$this->error('编辑失败');
}
}
public function unpass(){
$id=input('id');
$update['status']='3';
$result=\db('volunteer')->where('id',$id)->update($update);
if ($result>0){
$this->success('编辑成功!');
}else{
$this->error('编辑失败');
}
}
}
\ No newline at end of file
... ...
... ... @@ -113,9 +113,15 @@ class Excel
}
$fileName = $name;
$ua = $_SERVER['HTTP_USER_AGENT'];
$ua = strtolower($ua);
if(preg_match('/msie/', $ua) || preg_match('/edge/', $ua)) { //判断是否为IE或Edge浏览器
$fileName = str_replace('+', '%20', urlencode($fileName)); //使用urlencode对文件名进行重新编码
}
$date = date("Y-m-d",time());
$fileName .= "_{$date}.xlsx";
$fileName = iconv("utf-8", "GBK", $fileName);
$fileName = iconv("utf-8", "gb2312", $fileName);
//重命名表
// $objPHPExcel->getActiveSheet()->setTitle('test');
//设置活动单指数到第一个表,所以Excel打开这是第一个表
... ... @@ -125,6 +131,7 @@ class Excel
header('Cache-Control: max-age=0');
$objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save('php://output'); //文件通过浏览器下载
exit();
// END
}
... ...
... ... @@ -35,12 +35,13 @@
</th>
<th width="20">ID</th>
<th width="50">标题</th>
<th width="20">缩略图</th>
<th width="20">摘要</th>
<th width="20">参与人数</th>
<th width="100">活动类型</th>
<th width="20">封面图</th>
<th width="30">开始时间</th>
<th width="30">结束时间</th>
<th width="30">发布时间</th>
<th width="30">活动地点</th>
<th width="20">报名人数</th>
<!-- <th width="30">结束时间</th>
<th width="30">发布时间</th>-->
<th width="30">状态</th>
<th width="100">操作</th>
</tr>
... ... @@ -54,19 +55,18 @@
</td>
<td>{$vo.id}</td>
<td>{$vo.activity_name}</td>
<td>{$vo.type_name}</td>
<td>
<notempty name="$vo.thumbnail">
<a href="javascript:parent.imagePreviewDialog('{:cmf_get_image_preview_url($vo.thumbnail)}');">
<i class="fa fa-photo fa-fw"></i>
<img height="80px" src="{:cmf_get_image_preview_url($vo.thumbnail)}">
</a>
</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>
<td>{:date('Y-m-d',$vo['time'])}</td>
<td>{$vo.city_name}</td>
<td><a href="{:url('activity/join',array('id'=>$vo['id']))}">{$vo.count}</a></td>
<td>
<notempty name="vo.is_up">
<a data-toggle="tooltip" title="已发布"><i class="fa fa-check"></i></a>
... ... @@ -74,6 +74,11 @@
<a data-toggle="tooltip" title="未发布"><i class="fa fa-close"></i></a>
</notempty>
</td>
<!--<td>{:cmf_replace_content_file_url(htmlspecialchars_decode($vo.content))}</td>-->
<!--<td>{:date('Y-m-d H:i:s',$vo['end_time'])}</td>-->
<!--<td>{:date('Y-m-d',$vo['time'])}</td>-->
<td>
<a href='{:url("activity/edit",array("id"=>$vo["id"]))}'>{:lang('EDIT')}</a>|
<a class="js-ajax-delete" href="{:url('activity/delete',array('id'=>$vo['id']))}">{:lang('DELETE')}</a>
... ...
... ... @@ -150,19 +150,19 @@
console.log(res)
openIframeLayer("{:url('activity/joinTime')}?id=" + selectedCategoriesId, '请完善信息', {
area: ['1000px', '700px'],
// btn: ['确定', '取消'],
btn: ['确定', '取消'],
yes: function (index, layero) {
//do something
var iframeWin = window[layero.find('iframe')[0]['name']];
var selectedCategories = iframeWin.confirm();
if (selectedCategories.selectedCategoriesId.length == 0) {
layer.msg('请选择分类');
return;
}
$('#js-categories-id-input').val(selectedCategories.selectedCategoriesId.join(','));
$('#js-categories-name-input').val(selectedCategories.selectedCategoriesName.join(' '));
console.log(index)
console.log(layero)
var iframeWin= window[layero.find('iframe')];
var body = layer.getChildFrame('body', index);
var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象,执行iframe页的方法:
iframeWin.load();
//console.log(layer.getFrameIndex(index));
layer.close(index); //如果设定了yes回调,需进行手工关闭
console.log('reload');
location.reload()
}
});
}
... ...
... ... @@ -12,13 +12,21 @@
<input type="hidden" class="form-control" id="input-name" name="id" value="{$_GET['id']}">
</div>
</div>
<div class="form-group">
<div style="display: none" class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
<button id="sub" type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
</div>
</div>
</form>
</div>
<script type="application/javascript">
function load(){
/*检查*/
$('#sub').click();
}
</script>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>
\ No newline at end of file
... ...
... ... @@ -20,7 +20,7 @@
</div>
</form>
<script type="application/javascript">
<script type="application/javascript">/**/
function load(){
/*检查*/
$('#sub').click();
... ...
... ... @@ -19,7 +19,9 @@
<div class="col-md-6 col-sm-10">
<notempty name="pic">
<volist name="pic" id="vo">
<img style="width:150px;" src="{$vo}"/>
<a href="javascript:parent.imagePreviewDialog('{$vo}');">
<img style="width:150px;" src="{$vo}"/>
</a>
</volist>
</notempty>
</div>
... ...
... ... @@ -72,16 +72,13 @@
</th>
<th>ID</th>
<th>姓名</th>
<th>头像</th>
<th>性别</th>
<th>出生日期</th>
<th>民族</th>
<th>政治面貌</th>
<th>学历</th>
<th>工作单位</th>
<th>更多信息请查看详情</th>
<th>提交时间</th>
<th>更新时间</th>
<th>状态</th>
<th>年龄</th>
<th>地区</th>
<th>总工时</th>
<th>星级</th>
<th>审核状态</th>
<th>操作</th>
</tr>
</thead>
... ... @@ -95,6 +92,11 @@
<td>{$vo.id}</td>
<td>{$vo.name}</td>
<td>
<a href="javascript:parent.imagePreviewDialog('{$vo.photo}');">
<img height="80px" src="{$vo.photo}">
</a>
</td>
<td>
<if condition="$vo.sex eq 0">
未知
<elseif condition="$vo.sex eq 1"/>
... ... @@ -103,14 +105,12 @@
</if>
</td>
<td>{$vo.birthday}</td>
<td>{$vo.nation}</td>
<td>{$vo.politics}</td>
<td>{$vo.education}</td>
<td>{$vo.unit}</td>
<td>……</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>
{$vo.age}
</td>
<td>{$vo.province}</td>
<td>{$vo.work_time}</td>
<td>{$vo.level}</td>
<td>
<if condition="$vo.status eq 1">
未审核
... ... @@ -122,7 +122,9 @@
</td>
<td>
<a href='{:url("volunteer/edit",array("id"=>$vo["id"]))}'>查看详情</a>|
<a class="js-ajax-delete" href="{:url('volunteer/delete',array('id'=>$vo['id']))}">{:lang('DELETE')}</a>
<!--<a class="js-ajax-delete" href="{:url('volunteer/delete',array('id'=>$vo['id']))}">{:lang('DELETE')}</a>-->
<a class="js-ajax-delete" href="{:url('volunteer/pass',array('id'=>$vo['id']))}">通过</a>|
<a class="js-ajax-delete" href="{:url('volunteer/unpass',array('id'=>$vo['id']))}">拒绝</a>
</td>
</tr>
</foreach>
... ...
... ... @@ -1880,4 +1880,18 @@ function wxappNotice($message){
$domain='/upload';
$return=strstr($url,$domain);
return $return;
}
/**
* 获取级别
*/
function get_level($time){
$map['min']=['<=',$time];
$map['max']=['>=',$time];
$level=\db('level')->where($map)->value('level');
if (empty($level)){
return 0;
}
return $level;
}
\ No newline at end of file
... ...