$id]); if (!$result) wl_message('编辑失败'); wl_message('编辑成功', web_url('member/checkMember/checkStudentIndex'), 'success'); } $data = pdo_get(PDO_NAME . 'member_student_info',['id' => $id]); include wl_template('member/check/checkStudentEdit'); } /* * 学历认证审核审核 */ public function checkStudentInfo() { global $_W, $_GPC; if ($_W['ispost']) { $id = $_GPC['data']['id']; $check_result = $_GPC['data']['result']; $reason = $_GPC['data']['reason']?:''; if (!in_array($check_result,['reject','pass'])) show_json(0,'参数错误'); if ($check_result == 'reject' && empty($reason)) show_json(0,'请填写不通过的原因'); $query_res = pdo_get(PDO_NAME . 'member_student_info',['id' => $id, 'check_status' => 0]); if (!$query_res) show_json(0,'已审核,请勿重复审核'); $check_status = $check_result == 'pass' ? 1 : 2; $update_arr = [ 'check_status' => $check_status, 'check_cause' => $reason, 'check_user_id' => $_W['uid'], 'check_time' => time(), ]; pdo_begin(); // 开始事务 $up_res = pdo_update(PDO_NAME . 'member_student_info',$update_arr,['id' => $id]); if (!$up_res) { pdo_rollback(); // 回滚 show_json(0,'失败'); } // 通过修改为学生身份 if ($check_status == 1) { $up_res2 = pdo_update(PDO_NAME . 'member',['identity_id' => 2],['id' => $query_res['mid']]); if (!$up_res2) { pdo_rollback(); // 回滚 show_json(0,'失败'); } } else { $content = '驳回原因:' . truncate_chinese_string($reason) . '...'; $link = h5_url('pagesA/studentIdentification/studentIdentification'); News::jobNotice($query_res['mid'], '您好,您的学生认证审核已完成', '学生认证审核通知', $content, '未通过', '点击重新申请', time(), $link); } pdo_commit(); // 提交事务 show_json(1,['message' => '成功', 'span' => $check_result == 'pass' ? '审核通过' : '审核失败']); } show_json(0,'请求失败'); } /* * 教师认证列表 */ public function checkTeacherIndex() { global $_W, $_GPC; $where = []; $pindex = max(1, intval($_GPC['page'])); $psize = 10; if (!empty($_GPC['keyword'])) { if ($_GPC['keywordtype'] == 1) { $where['mid'] = trim($_GPC['keyword']); } else if ($_GPC['keywordtype'] == 2) { $memberIdArr = []; $memberAll = pdo_getall(PDO_NAME . 'member',['nickname like' => '%'.trim($_GPC['keyword']).'%'],'id'); foreach ($memberAll as $memberRow) $memberIdArr[] = $memberRow['id']; $where['mid#'] = $memberIdArr ? implode(",",$memberIdArr) : '0'; } else if ($_GPC['keywordtype'] == 3) { $where['@name@'] = trim($_GPC['keyword']); } } if (is_numeric($_GPC['status'])) $where['status'] = trim($_GPC['status']); $memberData = Util::getNumData("*", PDO_NAME . 'member_teacher_certified', $where, 'id desc', $pindex, $psize, 1); $list = $memberData[0]; $pager = $memberData[1]; foreach ($list as &$item) { $member = Member::getMemberInfo($item,$item['mid']); $item['documents'] = tomedia($item['documents']); $item['create_time'] = date("Y-m-d H:i:s",$item['create_time']); } include wl_template('member/check/checkTeacherIndex'); } /* * 教师信息认证 */ public function checkTeacherInfo() { global $_W, $_GPC; if ($_W['ispost']) { try { $id = $_GPC['data']['id']; $check_result = $_GPC['data']['result']; $reason = $_GPC['data']['reason']?:''; if (empty($id) || !is_numeric($id)) show_json('缺少id参数'); if (!in_array($check_result,['reject','pass'])) show_json(0,'参数错误'); if ($check_result == 'reject' && empty($reason)) show_json(0,'请填写不通过的原因'); $query_res = pdo_get(PDO_NAME . 'member_teacher_certified',['id' => $id, 'status' => 0]); if (!$query_res) show_json(0,'已审核,请勿重复审核'); $status = $check_result == 'pass' ? 1 : 2; $update_arr = [ 'status' => $status, 'remark' => $reason, 'certified_userid' => $_W['uid'], 'certified_time' => time() ]; pdo_begin(); // 开始事务 $up_res = pdo_update(PDO_NAME . 'member_teacher_certified',$update_arr,['id' => $id]); if (!$up_res) throw new Exception('失败'); // 通过修改为教师身份 if ($status == 1) { $up_res2 = pdo_update(PDO_NAME . 'member',['identity_id' => 6],['id' => $query_res['mid']]); if (!$up_res2) throw new Exception('失败'); } else { $content = '驳回原因:' . truncate_chinese_string($reason) . '...'; $link = h5_url('pagesA/identityList/teacherCertification'); News::jobNotice($query_res['mid'], '您好,您的教师认证审核已完成', '教师认证审核通知', $content, '未通过', '点击重新申请', time(), $link); } pdo_commit(); // 提交事务 show_json(1,['message' => '成功', 'span' => $check_result == 'pass' ? '认证成功' : '认证失败']); } catch (Exception $e) { pdo_rollback(); // 回滚 show_json(0,$e->getMessage()); } } show_json(0,'请求失败'); } /* * 达人认证列表 */ public function checkBloggerIndex() { global $_W, $_GPC; $where = []; $pindex = max(1, intval($_GPC['page'])); $psize = 10; if (!empty($_GPC['keyword'])) { if ($_GPC['keywordtype'] == 1) { $where['storeid'] = trim($_GPC['keyword']); } else if ($_GPC['keywordtype'] == 2) { $memberIdArr = []; $memberAll = pdo_getall(PDO_NAME . 'member',['nickname like' => '%'.trim($_GPC['keyword']).'%'],'id'); foreach ($memberAll as $memberRow) $memberIdArr[] = $memberRow['id']; $where['mid#'] = $memberIdArr ? implode(",",$memberIdArr) : '0'; } else if ($_GPC['keywordtype'] == 3) { $where['@name@'] = trim($_GPC['keyword']); } else if ($_GPC['keywordtype'] == 4) { $where['mobile'] = trim($_GPC['keyword']); } } if (is_numeric($_GPC['status'])) $where['status'] = trim($_GPC['status']); $memberData = Util::getNumData("*", PDO_NAME . 'member_daren_certified', $where, 'id desc', $pindex, $psize, 1); $list = $memberData[0]; $pager = $memberData[1]; foreach ($list as &$item) { $member = Member::getMemberInfo($item,$item['mid']); $item['screenshot'] = tomedia($item['screenshot']); $item['create_time'] = date("Y-m-d H:i:s",$item['create_time']); } include wl_template('member/check/checkBloggerIndex'); } /* * 达人信息认证 */ public function checkBloggerInfo() { global $_W, $_GPC; if ($_W['ispost']) { try { $id = $_GPC['data']['id']; $check_result = $_GPC['data']['result']; $reason = $_GPC['data']['reason']?:''; if (empty($id) || !is_numeric($id)) show_json('缺少id参数'); if (!in_array($check_result,['reject','pass'])) show_json(0,'参数错误'); if ($check_result == 'reject' && empty($reason)) show_json(0,'请填写不通过的原因'); $query_res = pdo_get(PDO_NAME . 'member_daren_certified',['id' => $id, 'status' => 0]); if (!$query_res) show_json(0,'已审核,请勿重复审核'); $status = $check_result == 'pass' ? 1 : 2; $update_arr = [ 'status' => $status, 'remark' => $reason, 'certified_userid' => $_W['uid'], 'certified_time' => time() ]; pdo_begin(); // 开始事务 $up_res = pdo_update(PDO_NAME . 'member_daren_certified',$update_arr,['id' => $id]); if (!$up_res) throw new Exception('失败'); // 通过修改为达人身份 if ($status == 1) { $up_res2 = pdo_update(PDO_NAME . 'member',['identity_id' => 7],['id' => $query_res['mid']]); if (!$up_res2) throw new Exception('失败'); } else { $content = '驳回原因:' . truncate_chinese_string($reason) . '...'; $link = h5_url('pagesA/identityList/bloggerCertification'); News::jobNotice($query_res['mid'], '您好,您的达人认证审核已完成', '达人认证审核通知', $content, '未通过', '点击重新申请', time(), $link); } pdo_commit(); // 提交事务 show_json(1,['message' => '成功', 'span' => $check_result == 'pass' ? '认证成功' : '认证失败']); } catch (Exception $e) { pdo_rollback(); // 回滚 show_json(0,$e->getMessage()); } } show_json(0,'请求失败'); } }