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.
300 lines
12 KiB
300 lines
12 KiB
<?php
|
|
defined('IN_IA') or exit('Access Denied');
|
|
|
|
class checkMember_WeliamController
|
|
{
|
|
|
|
public function checkStudentIndex() {
|
|
global $_W, $_GPC;
|
|
|
|
$where = [];
|
|
$pindex = max(1, intval($_GPC['page']));
|
|
$psize = 10;
|
|
|
|
if (!empty($_GPC['username'])) {
|
|
$where['name@'] = '%' . trim($_GPC['username'] .'%');
|
|
}
|
|
|
|
$memberData = Util::getNumData("*", PDO_NAME . 'member_student_info', $where, 'id desc', $pindex, $psize, 1);
|
|
$list = $memberData[0];
|
|
$pager = $memberData[1];
|
|
|
|
include wl_template('member/check/checkStudentIndex');
|
|
}
|
|
|
|
public function checkStudentEdit()
|
|
{
|
|
global $_W, $_GPC;
|
|
|
|
$id = $_GPC['id'];
|
|
|
|
if (checksubmit('submit')) {
|
|
|
|
if (empty($_GPC['name'])) wl_message('请输入姓名');
|
|
if (empty($_GPC['mobile'])) wl_message('请输入手机号');
|
|
if (!preg_match("/^1[3-9]\d{9}$/",$_GPC['mobile'])) wl_message('请输入正确的手机号');
|
|
if (empty($_GPC['code'])) wl_message('请输入学号');
|
|
if (empty($_GPC['school_name'])) wl_message('请输入学校名称');
|
|
if (empty($_GPC['department_name'])) wl_message('请输入院系');
|
|
if (empty($_GPC['start_date'])) wl_message('请选择入学时间');
|
|
if (empty($_GPC['certificate_img'])) wl_message('请上传证件');
|
|
|
|
$data = [];
|
|
$data['name'] = trim($_GPC['name']);
|
|
$data['mobile'] = trim($_GPC['mobile']);
|
|
$data['code'] = trim($_GPC['code']);
|
|
$data['school_name'] = trim($_GPC['school_name']);
|
|
$data['department_name'] = trim($_GPC['department_name']);
|
|
$data['certificate_img'] = trim($_GPC['certificate_img']);
|
|
$data['start_date'] = trim($_GPC['start_date']);
|
|
$data['update_time'] = time();
|
|
|
|
$result = pdo_update(PDO_NAME . 'member_student_info',$data,['id' => $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,'请求失败');
|
|
}
|
|
}
|