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.
501 lines
21 KiB
501 lines
21 KiB
<?php
|
|
|
|
defined('IN_IA') or exit('Access Denied');
|
|
class StudentModuleUniapp extends Uniapp
|
|
{
|
|
/*
|
|
* 学生认证申请初始数据
|
|
*/
|
|
public function studentIdentityIndex()
|
|
{
|
|
global $_W, $_GPC;
|
|
|
|
$mid = $_W['mid'];
|
|
|
|
if (empty($mid) || !is_numeric($mid)) $this->renderError('缺少参数');
|
|
|
|
$fields_arr = [
|
|
'id','mid','name','code','school_name','department_name','start_date','certificate_img','check_cause','check_status'
|
|
];
|
|
$data = pdo_get(PDO_NAME . 'member_student_info',['mid' => $mid],$fields_arr);
|
|
if (is_numeric($data['check_status']) && $data['check_status'] == 0) $this->renderError('待审核中,请勿重复申请认证');
|
|
if ($data['check_status'] == 1) $this->renderError('认证已成功,请勿重复申请认证',['is_jump' => true]);
|
|
|
|
$user = pdo_get(PDO_NAME . 'member',['id' => $mid],['identity_id']);
|
|
if ($user && !in_array($user['identity_id'],[1,3])) {
|
|
$identity = pdo_get(PDO_NAME . 'member_identity',['id' => $user['identity_id']],['name']);
|
|
$this->renderError('您已经是' . $identity['name'] . '身份,无法申请学生认证');
|
|
}
|
|
|
|
if ($data) {
|
|
$data['certificate_img'] = tomedia($data['certificate_img']);
|
|
$data['reject'] = $data['check_cause'];
|
|
$data['status'] = $data['check_status'];
|
|
unset($data['check_cause'],$data['check_status']);
|
|
$this->renderSuccess('数据获取成功',$data);
|
|
}
|
|
$this->renderSuccess('数据为空',[
|
|
'id' => '',
|
|
'mid' => $mid,
|
|
'name' => '',
|
|
'code' => '',
|
|
'school_name' => '',
|
|
'department_name' => '',
|
|
'start_date' => '',
|
|
'certificate_img' => '',
|
|
'reject' => '',
|
|
'status' => 0
|
|
]);
|
|
}
|
|
/*
|
|
* 学生认证申请
|
|
*/
|
|
public function studentIdentityAttestation()
|
|
{
|
|
global $_W, $_GPC;
|
|
|
|
$data = [];
|
|
$id = $_GPC['id'];
|
|
$mid = $_W['mid'];
|
|
$uniacid = $_W['uniacid'];
|
|
$sms_code = $_GPC['sms_code'];
|
|
|
|
// 验证信息
|
|
if (empty($_GPC['name'])) $this->renderError('请输入姓名');
|
|
if (empty($_GPC['mobile'])) $this->renderError('请输入手机号');
|
|
if (!preg_match("/^1[3-9]\d{9}$/",$_GPC['mobile'])) $this->renderError('请输入正确的手机号');
|
|
if (empty($_GPC['code'])) $this->renderError('请输入学号');
|
|
if (empty($_GPC['school_name'])) $this->renderError('请输入学校名称');
|
|
if (empty($_GPC['department_name'])) $this->renderError('请输入院系');
|
|
if (empty($_GPC['start_date'])) $this->renderError('请选择入学时间');
|
|
if (empty($_GPC['certificate_img'])) $this->renderError('请上传证件');
|
|
|
|
if (strtotime($_GPC['start_date']) > time()) $this->renderError('入学时间不能超出未来时间');
|
|
|
|
$this->checkCode($_GPC['mobile'],$sms_code);
|
|
|
|
$validate = Member::validateMemberIdentity($_W['mid']);
|
|
if (!$validate['status']) $this->renderError($validate['msg'],['is_jump' => true]);
|
|
|
|
$where = ['mid' => $mid];
|
|
$student_res = pdo_get(PDO_NAME . 'member_student_info',$where);
|
|
if ($student_res) {
|
|
if (is_numeric($student_res['check_status']) && $student_res['check_status'] == 0) $this->renderError('待审核中,请勿重复申请');
|
|
if ($student_res['check_status'] == 1) $this->renderError('已审核通过,请勿重复申请');
|
|
}
|
|
|
|
$name_res = Filter::init(trim($_GPC['name']),$_W['source'],1);
|
|
if ($name_res['errno'] == 0) $this->renderError($name_res['message']);
|
|
$school_name_res = Filter::init(trim($_GPC['school_name']),$_W['source'],1);
|
|
if ($school_name_res['errno'] == 0) $this->renderError($school_name_res['message']);
|
|
$department_name_res = Filter::init(trim($_GPC['department_name']),$_W['source'],1);
|
|
if ($department_name_res['errno'] == 0) $this->renderError($department_name_res['message']);
|
|
$certificate_img_res = Filter::init(trim($_GPC['certificate_img']),$_W['source'],2);
|
|
if ($certificate_img_res['errno'] == 0) $this->renderError($certificate_img_res['message']);
|
|
|
|
// 创建认证申请
|
|
$data['mid'] = $mid;
|
|
$data['uniacid'] = $uniacid;
|
|
$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']);
|
|
|
|
if (empty($id)) {
|
|
$data['create_time'] = time();
|
|
$result = pdo_insert(PDO_NAME . 'member_student_info',$data);
|
|
} elseif (is_numeric($id)) {
|
|
$data['update_time'] = time();
|
|
$data['check_status'] = 0;
|
|
$result = pdo_update(PDO_NAME . 'member_student_info',$data,['id' => $id]);
|
|
} else {
|
|
$result = false;
|
|
}
|
|
if (!$result) $this->renderError('认证申请失败');
|
|
|
|
$this->renderSuccess('认证申请已提交');
|
|
}
|
|
/**
|
|
* Comment: 文件上传
|
|
* Author: zzw
|
|
* Date: 2023/3/24 14:32
|
|
*/
|
|
public function uploadFiles(){
|
|
global $_W , $_GPC;
|
|
#1、判断上传方式
|
|
$uploadType = $_GPC['upload_type'] ? $_GPC['upload_type'] : 1;//1=普通上传;2=微信端上传
|
|
#2、调用方法进行处理
|
|
UploadFile::uploadIndex($_FILES ,$uploadType, $_GPC['id'], [], 'student_info');
|
|
}
|
|
/*
|
|
* 校园活动信息列表
|
|
*/
|
|
public function campusActivitiesList() {
|
|
global $_W, $_GPC;
|
|
|
|
$mid = $_W['mid'];
|
|
$collect = $_GPC['collect'] ?: 0; # 收藏数据查询
|
|
$sub = $_GPC['sub'] ?: 0; # 发布记录查询
|
|
$pindex = max(1, intval($_GPC['page']));
|
|
$psize = $_GPC['size'] ?: 5;
|
|
|
|
$where = '';
|
|
if (empty($sub)) {
|
|
$where .= ' status = 1 ';
|
|
} else {
|
|
$where .= " create_place = 2 and create_user_id = {$mid}";
|
|
}
|
|
|
|
# 查询用户收藏数据
|
|
if (!empty($collect) && $collect == 1) {
|
|
$collect_list = pdo_getall(PDO_NAME . 'member_collect_activities',['mid' => $mid],['campus_activities_id']);
|
|
|
|
if ($collect_list) {
|
|
$caid_arr = [];
|
|
foreach ($collect_list as $collect_value) $caid_arr[] = $collect_value['campus_activities_id'];
|
|
$where .= " and id in('" . implode("','",$caid_arr) . "')";
|
|
} else {
|
|
$where .= ' and id = 0 ';
|
|
}
|
|
}
|
|
|
|
|
|
if (!empty($_GPC['cc_id'])) $where .= " and cc_id = '{$_GPC['cc_id']}'";
|
|
if (!empty($_GPC['recommend'])) $where .= " and recommend = '{$_GPC['recommend']}'";
|
|
if (!empty($_GPC['title'])) $where .= " and title like '%{$_GPC['title']}%'";
|
|
$statusArr = ['审核中' , '已发布', '已驳回'];
|
|
$field = ['id','title','describe','promotional_img','publish_time','create_place','create_user_id','cc_id','status','reject'];
|
|
$total = pdo_count(PDO_NAME . 'member_campus_activities',$where);
|
|
$list = pdo_getall(PDO_NAME . 'member_campus_activities',$where,$field,'','publish_time desc',[$pindex,$psize]);
|
|
foreach ($list as &$val) {
|
|
$val['promotional_img'] = MemberCampusActivities::handlePromotionalImg($val['promotional_img'],2);
|
|
$val['publish_time'] = $val['publish_time'] ? date("Y-m-d H:i:s",$val['publish_time']) : '';
|
|
#发布人
|
|
$val['nickname'] = '小粤';
|
|
$val['avatar'] = $_W['wlsetting']['base']['logo'] ? tomedia($_W['wlsetting']['base']['logo']) : tomedia('headimg_'.$_W['account']['acid'].'.jpg');
|
|
#分类名称
|
|
if ($val['create_place'] == 2) Member::getMemberInfo($val,$val['create_user_id']);
|
|
$cc_name = pdo_getcolumn(PDO_NAME . 'cultivate_class',['id' => $val['cc_id']],'name');
|
|
$val['cc_name'] = $cc_name ?: '';
|
|
$val['status_str'] = $statusArr[$val['status']];
|
|
// 活动点赞数
|
|
$thumbs_up_count = pdo_count(PDO_NAME . 'member_thumbs_up_activities',['campus_activities_id' => $val['id']]);
|
|
$val['thumbs_up_count'] = $thumbs_up_count ?: 0;
|
|
$is_thumbs_up = pdo_get(PDO_NAME . 'member_thumbs_up_activities',['campus_activities_id' => $val['id'], 'mid' => $_W['mid']]);
|
|
// 是否点赞该活动
|
|
$val['is_thumbs_up'] = $is_thumbs_up ? true : false;
|
|
if ($val['status'] == 1) $val['reject'] = '';
|
|
unset($val['create_place'],$val['create_user_id'],$val['status']);
|
|
}
|
|
|
|
$this->renderSuccess($list?'数据获取成功':'数据为空',['data' => $list, 'pager' => $pindex, 'total' => $total]);
|
|
}
|
|
/*
|
|
* 获取校园活动信息详情
|
|
*/
|
|
public function campusActivitiesFind() {
|
|
global $_W, $_GPC;
|
|
|
|
$id = $_GPC['id'];
|
|
if (empty($id)) $this->renderError('请求失败');
|
|
$fields = ['id','title','describe','promotional_img','publish_time','create_place','create_user_id'];
|
|
$data = pdo_get(PDO_NAME . 'member_campus_activities',['id' => $id],$fields);
|
|
#发布人
|
|
$data['nickname'] = '小粤';
|
|
$data['avatar'] = $_W['wlsetting']['base']['logo'] ? tomedia($_W['wlsetting']['base']['logo']) : tomedia('headimg_'.$_W['account']['acid'].'.jpg');
|
|
if ($data['create_place'] == 2) Member::getMemberInfo($data,$data['create_user_id']);
|
|
#分类名称
|
|
$cc_name = pdo_getcolumn(PDO_NAME . 'cultivate_class',['id' => $data['cc_id']],'name');
|
|
$data['cc_name'] = $cc_name ?: '';
|
|
$where = ['campus_activities_id' => $data['id']]; // 活动评价内容
|
|
$where2 = ['campus_activities_id' => $data['id'], 'mid' => $_W['mid']];
|
|
# 处理图集
|
|
$data['promotional_img'] = MemberCampusActivities::handlePromotionalImg($data['promotional_img']);
|
|
|
|
$thumbs_up_count = pdo_count(PDO_NAME . 'member_thumbs_up_activities',$where); // 活动点赞数
|
|
$data['thumbs_up_count'] = $thumbs_up_count ?: 0;
|
|
$is_thumbs_up = pdo_get(PDO_NAME . 'member_thumbs_up_activities',$where2);
|
|
$data['is_thumbs_up'] = $is_thumbs_up ? true : false; // 是否点赞该活动
|
|
|
|
$collect_count = pdo_count(PDO_NAME . 'member_collect_activities',$where); // 活动收藏数
|
|
$data['collect_count'] = $collect_count ?: 0;
|
|
$is_collect = pdo_get(PDO_NAME . 'member_collect_activities',$where2);
|
|
$data['is_collect'] = $is_collect ? true : false; // 是否收藏
|
|
$data['publish_time'] = date("Y-m-d H:i:s",$data['publish_time']);
|
|
|
|
unset($data['create_place'],$data['create_user_id']);
|
|
$this->renderSuccess('数据获取成功',['data' => $data]);
|
|
}
|
|
/*
|
|
* 校园活动添加评价
|
|
*/
|
|
public function addEvaluation() {
|
|
global $_W, $_GPC;
|
|
|
|
$mid = $_W['mid'];
|
|
$caid = $_GPC['caid'];
|
|
$oneid = $_GPC['oneid'];
|
|
$pid = $_GPC['pid'];
|
|
$content = $_GPC['content'];
|
|
|
|
if (empty($mid) || !is_numeric($mid)) $this->renderError('请求失败');
|
|
if (empty($caid) || !is_numeric($caid)) $this->renderError('请求失败');
|
|
if (empty($content)) $this->renderError('请填写评价内容');
|
|
$contentRes = Filter::init(trim($content));
|
|
if ($contentRes['errno'] == 0) $this->renderError($contentRes['message']);
|
|
|
|
$data = [
|
|
'mid' => $mid,
|
|
'uniacid' => $_W['uniacid'],
|
|
'campus_activities_id' => $caid,
|
|
'content' => base64_encode(trim($content)),
|
|
'create_time' => time()
|
|
];
|
|
if (!empty($pid) && is_numeric($pid)) {
|
|
$pQuery = pdo_get(PDO_NAME . 'member_evaluation_activities',['id' => $pid],['id']);
|
|
if (!$pQuery) $this->renderError('回复评价信息不存在!');
|
|
$data['pid'] = $pQuery['id'];
|
|
}
|
|
if (!empty($oneid) && is_numeric($pid)) $data['oneid'] = $oneid;
|
|
|
|
//判断是否需要审核
|
|
$settings = Setting::wlsetting_read('comment_set');
|
|
if($settings['campusActivities'] == 1) $data['status'] = 1;
|
|
|
|
$result = pdo_insert(PDO_NAME . 'member_evaluation_activities',$data);
|
|
if (!$result) $this->renderError('评价失败');
|
|
$this->renderSuccess('评价成功');
|
|
}
|
|
|
|
/**
|
|
* 获取评价数据
|
|
* @return void
|
|
*/
|
|
public function getEvaluationList()
|
|
{
|
|
global $_W, $_GPC;
|
|
|
|
$caid = $_GPC['caid'];
|
|
$oneid = $_GPC['oneid'] ?: 0;
|
|
$pindex = $_GPC['pindex'] ?: 1;
|
|
$psize = $_GPC['psize'] ?: 10;
|
|
|
|
if (empty($caid) || !is_numeric($caid)) $this->renderError('缺少参数:caid');
|
|
|
|
$where = ['campus_activities_id' => $caid, 'oneid' => $oneid, 'status' => 1];
|
|
|
|
$fields = 'id,mid,content,create_time,pid,oneid';
|
|
|
|
$commentRes = Util::getNumData($fields, PDO_NAME . 'member_evaluation_activities', $where, 'create_time asc', $pindex, $psize, 1);
|
|
$appraise_list = (array)$commentRes[0];
|
|
$pager = $commentRes[1];
|
|
$total = $commentRes[2];
|
|
foreach ($appraise_list as &$row) {
|
|
# 评价人信息
|
|
Member::getMemberInfo($row,$row['mid']);
|
|
# 回复信息
|
|
if (is_base64($row['content'])) $row['content'] = base64_decode($row['content']);
|
|
# 评价时间
|
|
$row['create_time'] = date("Y.m.d H:i",$row['create_time']);
|
|
# 是否显示查看回复
|
|
$row['is_query'] = false;
|
|
# 回复数量
|
|
$row['reply_count'] = 0;
|
|
if (!$row['oneid']) {
|
|
$count = pdo_count(PDO_NAME . 'member_evaluation_activities',['oneid' => $row['id'],'status' => 1]);
|
|
if ($count > 0) $row['is_query'] = true;
|
|
$row['reply_count'] = $count;
|
|
}
|
|
# 被回复人信息
|
|
if (!empty($row['pid'])) {
|
|
$pComment = pdo_get(PDO_NAME . 'member_evaluation_activities',['id' => $row['pid']],['mid']);
|
|
$quiltArr = [];
|
|
Member::getMemberInfo($quiltArr,$pComment['mid']);
|
|
$row['quilt_nickname'] = $quiltArr['nickname'];
|
|
$row['quilt_avatar'] = $quiltArr['avatar'];
|
|
$row['quilt_mid'] = $pComment['mid'];
|
|
}
|
|
}
|
|
|
|
$this->renderSuccess('数据获取成功',['list' => $appraise_list, 'pager' => $pager, 'total' => $total]);
|
|
}
|
|
|
|
/*
|
|
* 立即收藏活动
|
|
*/
|
|
public function immediatelyCollectActivities() {
|
|
global $_W, $_GPC;
|
|
|
|
$mid = $_W['mid'];
|
|
$caid = $_GPC['caid'];
|
|
if (empty($mid) || !is_numeric($mid)) $this->renderError('请求失败');
|
|
if (empty($caid) || !is_numeric($caid)) $this->renderError('请求失败');
|
|
$collect_data = pdo_get(PDO_NAME . 'member_collect_activities',['campus_activities_id' => $caid,'mid' => $mid]);
|
|
if ($collect_data) $this->renderError('请勿重复收藏');
|
|
$data = [
|
|
'mid' => $mid,
|
|
'campus_activities_id' => $caid,
|
|
'create_time' => time()
|
|
];
|
|
$result = pdo_insert(PDO_NAME . 'member_collect_activities', $data);
|
|
if (!$result) $this->renderError('收藏失败');
|
|
$this->renderSuccess('收藏成功');
|
|
}
|
|
/*
|
|
* 取消收藏活动
|
|
*/
|
|
public function cancelCollectActivities() {
|
|
global $_W, $_GPC;
|
|
|
|
$mid = $_W['mid'];
|
|
$caid = $_GPC['caid'];
|
|
if (empty($mid) || !is_numeric($mid)) $this->renderError('请求失败');
|
|
if (empty($caid) || !is_numeric($caid)) $this->renderError('请求失败');
|
|
|
|
$result = pdo_delete(PDO_NAME . 'member_collect_activities',['mid' => $mid, 'campus_activities_id' => $caid]);
|
|
if (!$result) $this->renderError('取消收藏失败');
|
|
$this->renderSuccess('取消成功');
|
|
}
|
|
/*
|
|
* 校园活动点赞(点赞/取消点赞)
|
|
*/
|
|
public function thumbsUpActivities() {
|
|
global $_W, $_GPC;
|
|
|
|
$mid = $_W['mid'];
|
|
$caid = $_GPC['caid'];
|
|
if (empty($mid) || !is_numeric($mid)) $this->renderError('请求失败');
|
|
if (empty($caid) || !is_numeric($caid)) $this->renderError('请求失败');
|
|
|
|
$query_res = pdo_get(PDO_NAME . 'member_thumbs_up_activities', ['mid' => $mid, 'campus_activities_id' => $caid]);
|
|
if ($query_res) {
|
|
$del_res = pdo_delete(PDO_NAME . 'member_thumbs_up_activities',['id' => $query_res['id']]);
|
|
if (!$del_res) $this->renderError('取消点赞失败');
|
|
$this->renderSuccess('已取消');
|
|
}
|
|
$data = [
|
|
'mid' => $mid,
|
|
'campus_activities_id' => $caid,
|
|
'create_time' => time()
|
|
];
|
|
$result = pdo_insert(PDO_NAME . 'member_thumbs_up_activities', $data);
|
|
if (!$result) $this->renderError('点赞失败');
|
|
$this->renderSuccess('点赞成功');
|
|
}
|
|
/**
|
|
* 短信验证码验证
|
|
* @param $mobile
|
|
* @param $code
|
|
* @return void
|
|
*/
|
|
private function checkCode($mobile,$code) {
|
|
$pin_info = pdo_get('wlmerchant_pincode' , ['mobile' => $mobile]);
|
|
if (empty($pin_info)) {
|
|
$this->renderError('验证码错误');
|
|
}
|
|
if ($pin_info['time'] < time() - 300) {
|
|
$this->renderError('验证码已过期,请重新获取');
|
|
}
|
|
if ($code != $pin_info['code']) $this->renderError('验证码错误');
|
|
}
|
|
|
|
/**
|
|
* 编辑-发布校园活动
|
|
* @return void
|
|
*/
|
|
public function getCampusActivities()
|
|
{
|
|
global $_W, $_GPC;
|
|
|
|
$id = $_GPC['id'];
|
|
$mid = $_W['mid'];
|
|
$member = pdo_get(PDO_NAME . 'member',['id' => $mid],['identity_id','rights']);
|
|
$identity_id = $member['identity_id'];
|
|
if ($identity_id != 7) $this->renderError('非达人身份,无法访问');
|
|
# 验证用户权限
|
|
$validateRights = Member::validateMemberRights($mid,'campus_activities',$member);
|
|
if (!$validateRights['status']) $this->renderError($validateRights['msg']);
|
|
$categoryList = Category::getChildCategoryAll(6,['id','name'],true);
|
|
$data = [
|
|
'id' => '',
|
|
'title' => '',
|
|
'cc_id' => '',
|
|
'describe' => '',
|
|
'promotional_img' => [],
|
|
'status' => 0,
|
|
'reject' => ''
|
|
];
|
|
if (!empty($id)) {
|
|
$queryRes = pdo_get(PDO_NAME . 'member_campus_activities',['id' => $id],array_keys($data));
|
|
if (!empty($queryRes)) {
|
|
$data = $queryRes;
|
|
if ($data['status'] != 2) $data['reject'] = '';
|
|
$data['promotional_img'] = MemberCampusActivities::promotionalImgArr($data['promotional_img']);
|
|
}
|
|
}
|
|
#unset($data['status']);
|
|
|
|
$this->renderSuccess('成功',['list' => $data, 'category_list' => $categoryList]);
|
|
}
|
|
|
|
/**
|
|
* 保存-发布校园活动
|
|
* @return void
|
|
*/
|
|
public function publishCampusActivities()
|
|
{
|
|
global $_W, $_GPC;
|
|
|
|
$mid = $_W['mid'];
|
|
$id = $_GPC['id'];
|
|
$cc_id = $_GPC['cc_id'];
|
|
$title = trim($_GPC['title']);
|
|
$describe = $_GPC['describe'];
|
|
$promotional_img = $_GPC['promotional_img'];
|
|
// 验证必填数据
|
|
if (empty($title)) $this->renderError('请填写活动标题');
|
|
if (empty($describe)) $this->renderError('请填写活动内容');
|
|
if (empty($promotional_img)) $this->renderError('请上传图集');
|
|
if (!is_array($promotional_img)) $this->renderError('图集数据类型错误');
|
|
// 验证数据是否违规
|
|
$textRes = Filter::init($title,$_W['source'],1);
|
|
if($textRes['errno'] == 0) $this->renderError('活动标题'.$textRes['message']);
|
|
$textRes = Filter::init($describe,$_W['source'],1);
|
|
if($textRes['errno'] == 0) $this->renderError('活动内容'.$textRes['message']);
|
|
foreach ($promotional_img as $image) {
|
|
$textRes = Filter::init($image,$_W['source'],2);
|
|
if($textRes['errno'] == 0) $this->renderError('图集'.$textRes['message']);
|
|
}
|
|
$promotional_img_str = MemberCampusActivities::promotionalImgStr($promotional_img);
|
|
// 验证活动标题是否存在
|
|
$queryWhere = " title = '{$title}'";
|
|
$queryWhere .= $id ? " and id != {$id} " : '';
|
|
$queryRes = pdo_get(PDO_NAME . 'member_campus_activities',$queryWhere,'id');
|
|
if ($queryRes) $this->renderError('活动标题:'.$title.',已存在');
|
|
// 新增|修改数据
|
|
$data = [
|
|
'uniacid' => $_W['uniacid'],
|
|
'title' => $title,
|
|
'cc_id' => $cc_id,
|
|
'describe' => htmlspecialchars_decode($describe),
|
|
'promotional_img' => $promotional_img_str
|
|
];
|
|
if ($id) {
|
|
$data['status'] = 0;
|
|
$data['update_time'] = time();
|
|
$updateRes = pdo_update(PDO_NAME . 'member_campus_activities',$data,['id' => $id]);
|
|
if (!$updateRes) $this->renderError('提交失败');
|
|
} else {
|
|
$data['create_place'] = 2;
|
|
$data['create_user_id'] = $mid;
|
|
$data['create_time'] = time();
|
|
$insertRes = pdo_insert(PDO_NAME . 'member_campus_activities',$data);
|
|
if (!$insertRes) $this->renderError('提交失败');
|
|
}
|
|
|
|
$this->renderSuccess('提交成功');
|
|
}
|
|
}
|