Commit 002e7946 by biao

1

parent 86cebbca
......@@ -11,9 +11,11 @@
志愿者活动是只有指南针单独有。志愿者活动还是需要单独添加和编辑。
志愿者活动所有账号账号都可以发布。但是需要系统运营端审核。
系统账号可以发布 社会实践/亲子活动/志愿者活动,并且可以指定参与范围(是否包含社会人士)
家校账户可以发布 面向本校的志愿者活动,社会实践活动只能通过家校平台同步过来。
家园账户可以发布本校的志愿者活动,亲子活动活动只能通过家校平台同步过来。
系统账号可以发布志愿者活动,并且可以指定参与范围(是否区域内学校,是否包含社会人士)
家校账户可以发布志愿者活动 面向本校的志愿者活动,社会实践活动只能通过家校平台同步过来。
家园账户可以发布本园的志愿者活动,亲子活动活动只能通过家校平台同步过来。
教育局可以发布针对本区域学校的志愿者活动
机构可以发布志愿者活动,只能面向社会人士发布
哪些人可以发布慈善活动呢?只在后台发布?还是?
用户领取证书需要消耗积分吗?【不用】
......
......@@ -19,21 +19,6 @@ if(empty($jsCode) && empty($openId)) {
responseNG($result);
}
//有openId的情况下
if(!empty($openId)) {
//检索数据库
$param['openid'] = $openId;
$param['delete_flg'] = false;
$tmpUserMst = UserMst::getList($param,'id','desc', 0, 1);
if(empty($tmpUserMst)) {
$result["message"] = "未注册!";
responseOK($result);
} else {
$result["message"] = "已注册!";
responseNG($result);
}
}
//有code的情况下
if(!empty($jsCode)) {
$appId = WECHAT_APP_ID;
......@@ -66,6 +51,19 @@ if(!empty($jsCode)) {
$result["message"] = "参数错误!";
responseNG($result);
}
} else if(!empty($openId)) {
//有openId的情况下
//检索数据库
$param['openid'] = $openId;
$param['delete_flg'] = false;
$tmpUserMst = UserMst::getList($param,'id','desc', 0, 1);
if(empty($tmpUserMst)) {
$result["message"] = "未注册!";
responseOK($result);
} else {
$result["message"] = "已注册!";
responseNG($result);
}
}
function responseNG($result) {
......
......@@ -40,9 +40,9 @@ $userMst = new UserMst();
$userMst->school_no = $schoolNo;
$userMst->class_no = $classNo;
if(empty($legalPerson)) {
$userMst->role = 4; //社会用户[非机构]
$userMst->role = 5; //社会用户[非机构]
} else {
$userMst->role = 5; //社会用户[机构]
$userMst->role = 6; //社会用户[机构]
}
$userMst->openid = $openId;
......
......@@ -13,7 +13,6 @@ $classNo = ParamUtil::getRequestString("classNo");
$schoolOwner = ParamUtil::getRequestBoolean("schoolOwner", false);
$classOwner = ParamUtil::getRequestBoolean("classOwner", false);
ErrorLogger::doOutput("Compass...ajax_social_user_register2.php....name=" . $name, 0);
ErrorLogger::doOutput("Compass...ajax_social_user_register2.php....openId=" . $openId, 0);
ErrorLogger::doOutput("Compass...ajax_social_user_register2.php....unionId=" . $unionId, 0);
ErrorLogger::doOutput("Compass...ajax_social_user_register2.php....schoolNo=" . $schoolNo, 0);
......@@ -36,29 +35,53 @@ $param['unionid'] = $unionId;
$param['delete_flg'] = false;
$userList = UserMst::getList($param,'id','desc', 0, 1);
if(!empty($userList)) {
$result["message"] = "用户已注册!";
$result["message"] = "用户不存在!";
responseOK($result);
}
//用户数据插入
$userMst = new UserMst();
$userMst->school_no = $schoolNo;
$userMst->class_no = $classNo;
$userMst->original_source = $role;//此处跟role一样
$userMst->openid = $openId;
$userMst->unionid = $unionId;
$userMst->name = $name;
$userMst->role = $role;
//年龄端
if($role == 1) {
$userMst->child_age = 1; //3~6岁
} else if($role == 2) {
$userMst->child_age = 2; //7岁以上
} else {
$userMst->child_age = 0; //不设定
$userMst = $userList[0];
$userMst->role = 6; //社会用户[机构]
//处理上传图片
$aliHandler = new AliUploadHandler();
if(!empty($_FILES['legalPersonImgage1']['tmp_name'])){
$upload_file = FileUploadUtil::getScalarFile(@$_FILES['legalPersonImgage1']);
$tmp_file_name = date("Ymd") . "_" . trim(basename($upload_file->name));//保存的名字自定义,这里如果图片的名字原来的是aa.jp,保存成20200220_aa.jpg
$url = $aliHandler->uploadImg($tmp_file_name, $upload_file->tmp_name);
ErrorLogger::doOutput($url);
//这里的url就是http://compass-dev.oss-cn-beijing.aliyuncs.com/20200220_aa.jpg
$userMst->legal_person_imgage1 = $url;
}
$userMst->school_owner = $schoolOwner
$userMst->class_owner = $classOwner
if(!empty($_FILES['legalPersonImgage2']['tmp_name'])){
$upload_file = FileUploadUtil::getScalarFile(@$_FILES['legalPersonImgage2']);
$tmp_file_name = date("Ymd") . "_" . trim(basename($upload_file->name));//保存的名字自定义,这里如果图片的名字原来的是aa.jp,保存成20200220_aa.jpg
$url = $aliHandler->uploadImg($tmp_file_name, $upload_file->tmp_name);
ErrorLogger::doOutput($url);
//这里的url就是http://compass-dev.oss-cn-beijing.aliyuncs.com/20200220_aa.jpg
$userMst->legal_person_imgage2 = $url;
}
if(!empty($_FILES['licensenImgage']['tmp_name'])){
$upload_file = FileUploadUtil::getScalarFile(@$_FILES['licensenImgage']);
$tmp_file_name = date("Ymd") . "_" . trim(basename($upload_file->name));//保存的名字自定义,这里如果图片的名字原来的是aa.jp,保存成20200220_aa.jpg
$url = $aliHandler->uploadImg($tmp_file_name, $upload_file->tmp_name);
ErrorLogger::doOutput($url);
//这里的url就是http://compass-dev.oss-cn-beijing.aliyuncs.com/20200220_aa.jpg
$userMst->licensen_imgage = $url;
}
if(!empty($_FILES['otherImgage']['tmp_name'])){
$upload_file = FileUploadUtil::getScalarFile(@$_FILES['otherImgage']);
$tmp_file_name = date("Ymd") . "_" . trim(basename($upload_file->name));//保存的名字自定义,这里如果图片的名字原来的是aa.jp,保存成20200220_aa.jpg
$url = $aliHandler->uploadImg($tmp_file_name, $upload_file->tmp_name);
ErrorLogger::doOutput($url);
//这里的url就是http://compass-dev.oss-cn-beijing.aliyuncs.com/20200220_aa.jpg
$userMst->other_imgage = $url;
}
$userMst->save();
ErrorLogger::doOutput("Compass...ajax_social_user_register2.php....End.", 0);
......
<?php
// 4.家校平台社会实践活动同步接口
require_once ("../user_include.inc");
ErrorLogger::doOutput("Compass...synchronize_social_event_dat.php....Start.", 0);
//获取参数
$schoolNo = ParamUtil::getRequestString("schoolNo");
$classNo = ParamUtil::getRequestString("classNo");
$originalSource = ParamUtil::getRequestNumber("originalSource", 0);
$eventId = ParamUtil::getRequestNumber("eventId", 0);
$title = ParamUtil::getRequestString("title");
$author = ParamUtil::getRequestString("author");
$publishTime = ParamUtil::getRequestString("publishTime");
$content = ParamUtil::getRequestString("content");
$images = ParamUtil::getRequestString("images");
//参数检查
if(empty($schoolNo) || empty($originalSource) || empty($title || $eventId <= 0 {
responseNG("参数错误!");
}
//originalSource为1或者2
if($originalSource <> 1 && $originalSource <> 2) {
responseNG("参数错误!");
}
//判断该活动是否已经存在
$param = array();
$param['school_no'] = $schoolNo;
$param['original_source'] = $originalSource;
$param['event_id'] = $eventId;
$param['delete_flg'] = false;
$socialEventList = SocialEventDat::getList($param,'id','desc', 0, 1);
if(empty($socialEventList)) {
$socialEventList = new SocialEventDat();
$socialEventList->school_no = $schoolNo;
$socialEventList->class_no = $classNo;
$socialEventList->original_source = $originalSource;
$socialEventList->event_id = $eventId;
$socialEventList->title = $title;
$socialEventList->author = $author;
$socialEventList->publish_time = $publishTime;
$socialEventList->content = $content;
$socialEventList->images = $images;
$socialEventList->save();
} else {
$socialEventList = $schoolList[0];
$socialEventList->title = $title;
$socialEventList->author = $author;
$socialEventList->publish_time = $publishTime;
$socialEventList->content = $content;
$socialEventList->images = $images;
$socialEventList->save();
$socialEventList->save();
}
ErrorLogger::doOutput("Compass...synchronize_social_event_dat.php....End.", 0);
responseOK("更新成功!");
function responseNG($message) {
$result = array("status"=>"NG", "message"=>$message);
print json_encode($result);
exit;
}
function responseOK($message) {
$result = array("status"=>"OK", "message"=>$message);
print json_encode($result);
exit;
}
?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment