Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
Compass
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zong
Compass
Commits
002e7946
Commit
002e7946
authored
Feb 21, 2020
by
biao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
86cebbca
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
136 additions
and
39 deletions
+136
-39
compass_db_schema.xlsx
doc/DB/compass_db_schema.xlsx
+0
-0
memo.txt
doc/memo.txt
+5
-3
小程序文件命名以及接口调用说明.xlsx
doc/小程序文件命名以及接口调用说明.xlsx
+0
-0
接口文档 V1.0.xls
doc/接口文档 V1.0.xls
+0
-0
ajax_check_user_registed.php
src/user/if/ajax_check_user_registed.php
+13
-15
ajax_social_user_register1.php
src/user/if/ajax_social_user_register1.php
+2
-2
ajax_social_user_register2.php
src/user/if/ajax_social_user_register2.php
+42
-19
synchronize_social_event_dat.php
src/user/if/synchronize_social_event_dat.php
+74
-0
No files found.
doc/DB/compass_db_schema.xlsx
View file @
002e7946
No preview for this file type
doc/memo.txt
View file @
002e7946
...
@@ -11,9 +11,11 @@
...
@@ -11,9 +11,11 @@
志愿者活动是只有指南针单独有。志愿者活动还是需要单独添加和编辑。
志愿者活动是只有指南针单独有。志愿者活动还是需要单独添加和编辑。
志愿者活动所有账号账号都可以发布。但是需要系统运营端审核。
志愿者活动所有账号账号都可以发布。但是需要系统运营端审核。
系统账号可以发布 社会实践/亲子活动/志愿者活动,并且可以指定参与范围(是否包含社会人士)
系统账号可以发布志愿者活动,并且可以指定参与范围(是否区域内学校,是否包含社会人士)
家校账户可以发布 面向本校的志愿者活动,社会实践活动只能通过家校平台同步过来。
家校账户可以发布志愿者活动 面向本校的志愿者活动,社会实践活动只能通过家校平台同步过来。
家园账户可以发布本校的志愿者活动,亲子活动活动只能通过家校平台同步过来。
家园账户可以发布本园的志愿者活动,亲子活动活动只能通过家校平台同步过来。
教育局可以发布针对本区域学校的志愿者活动
机构可以发布志愿者活动,只能面向社会人士发布
哪些人可以发布慈善活动呢?只在后台发布?还是?
哪些人可以发布慈善活动呢?只在后台发布?还是?
用户领取证书需要消耗积分吗?【不用】
用户领取证书需要消耗积分吗?【不用】
...
...
doc/小程序文件命名以及接口调用说明.xlsx
View file @
002e7946
No preview for this file type
doc/接口文档 V1.0.xls
View file @
002e7946
No preview for this file type
src/user/if/ajax_check_user_registed.php
View file @
002e7946
...
@@ -19,21 +19,6 @@ if(empty($jsCode) && empty($openId)) {
...
@@ -19,21 +19,6 @@ if(empty($jsCode) && empty($openId)) {
responseNG
(
$result
);
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的情况下
//有code的情况下
if
(
!
empty
(
$jsCode
))
{
if
(
!
empty
(
$jsCode
))
{
$appId
=
WECHAT_APP_ID
;
$appId
=
WECHAT_APP_ID
;
...
@@ -66,6 +51,19 @@ if(!empty($jsCode)) {
...
@@ -66,6 +51,19 @@ if(!empty($jsCode)) {
$result
[
"message"
]
=
"参数错误!"
;
$result
[
"message"
]
=
"参数错误!"
;
responseNG
(
$result
);
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
)
{
function
responseNG
(
$result
)
{
...
...
src/user/if/ajax_social_user_register1.php
View file @
002e7946
...
@@ -40,9 +40,9 @@ $userMst = new UserMst();
...
@@ -40,9 +40,9 @@ $userMst = new UserMst();
$userMst
->
school_no
=
$schoolNo
;
$userMst
->
school_no
=
$schoolNo
;
$userMst
->
class_no
=
$classNo
;
$userMst
->
class_no
=
$classNo
;
if
(
empty
(
$legalPerson
))
{
if
(
empty
(
$legalPerson
))
{
$userMst
->
role
=
4
;
//社会用户[非机构]
$userMst
->
role
=
5
;
//社会用户[非机构]
}
else
{
}
else
{
$userMst
->
role
=
5
;
//社会用户[机构]
$userMst
->
role
=
6
;
//社会用户[机构]
}
}
$userMst
->
openid
=
$openId
;
$userMst
->
openid
=
$openId
;
...
...
src/user/if/ajax_social_user_register2.php
View file @
002e7946
...
@@ -13,7 +13,6 @@ $classNo = ParamUtil::getRequestString("classNo");
...
@@ -13,7 +13,6 @@ $classNo = ParamUtil::getRequestString("classNo");
$schoolOwner
=
ParamUtil
::
getRequestBoolean
(
"schoolOwner"
,
false
);
$schoolOwner
=
ParamUtil
::
getRequestBoolean
(
"schoolOwner"
,
false
);
$classOwner
=
ParamUtil
::
getRequestBoolean
(
"classOwner"
,
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....openId="
.
$openId
,
0
);
ErrorLogger
::
doOutput
(
"Compass...ajax_social_user_register2.php....unionId="
.
$unionId
,
0
);
ErrorLogger
::
doOutput
(
"Compass...ajax_social_user_register2.php....unionId="
.
$unionId
,
0
);
ErrorLogger
::
doOutput
(
"Compass...ajax_social_user_register2.php....schoolNo="
.
$schoolNo
,
0
);
ErrorLogger
::
doOutput
(
"Compass...ajax_social_user_register2.php....schoolNo="
.
$schoolNo
,
0
);
...
@@ -36,29 +35,53 @@ $param['unionid'] = $unionId;
...
@@ -36,29 +35,53 @@ $param['unionid'] = $unionId;
$param
[
'delete_flg'
]
=
false
;
$param
[
'delete_flg'
]
=
false
;
$userList
=
UserMst
::
getList
(
$param
,
'id'
,
'desc'
,
0
,
1
);
$userList
=
UserMst
::
getList
(
$param
,
'id'
,
'desc'
,
0
,
1
);
if
(
!
empty
(
$userList
))
{
if
(
!
empty
(
$userList
))
{
$result
[
"message"
]
=
"用户
已注册
!"
;
$result
[
"message"
]
=
"用户
不存在
!"
;
responseOK
(
$result
);
responseOK
(
$result
);
}
}
//用户数据插入
//用户数据插入
$userMst
=
new
UserMst
();
$userMst
=
$userList
[
0
];
$userMst
->
school_no
=
$schoolNo
;
$userMst
->
role
=
6
;
//社会用户[机构]
$userMst
->
class_no
=
$classNo
;
$userMst
->
original_source
=
$role
;
//此处跟role一样
//处理上传图片
$userMst
->
openid
=
$openId
;
$aliHandler
=
new
AliUploadHandler
();
$userMst
->
unionid
=
$unionId
;
if
(
!
empty
(
$_FILES
[
'legalPersonImgage1'
][
'tmp_name'
])){
$userMst
->
name
=
$name
;
$upload_file
=
FileUploadUtil
::
getScalarFile
(
@
$_FILES
[
'legalPersonImgage1'
]);
$userMst
->
role
=
$role
;
$tmp_file_name
=
date
(
"Ymd"
)
.
"_"
.
trim
(
basename
(
$upload_file
->
name
));
//保存的名字自定义,这里如果图片的名字原来的是aa.jp,保存成20200220_aa.jpg
//年龄端
if
(
$role
==
1
)
{
$url
=
$aliHandler
->
uploadImg
(
$tmp_file_name
,
$upload_file
->
tmp_name
);
$userMst
->
child_age
=
1
;
//3~6岁
ErrorLogger
::
doOutput
(
$url
);
}
else
if
(
$role
==
2
)
{
//这里的url就是http://compass-dev.oss-cn-beijing.aliyuncs.com/20200220_aa.jpg
$userMst
->
child_age
=
2
;
//7岁以上
$userMst
->
legal_person_imgage1
=
$url
;
}
else
{
}
$userMst
->
child_age
=
0
;
//不设定
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
;
}
}
$userMst
->
school_owner
=
$schoolOwner
if
(
!
empty
(
$_FILES
[
'otherImgage'
][
'tmp_name'
])){
$userMst
->
class_owner
=
$classOwner
$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
();
$userMst
->
save
();
ErrorLogger
::
doOutput
(
"Compass...ajax_social_user_register2.php....End."
,
0
);
ErrorLogger
::
doOutput
(
"Compass...ajax_social_user_register2.php....End."
,
0
);
...
...
src/user/if/synchronize_social_event_dat.php
0 → 100644
View file @
002e7946
<?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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment