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
794937f6
Commit
794937f6
authored
Mar 08, 2020
by
biao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
11
parent
5819b46e
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
169 additions
and
152 deletions
+169
-152
compass_db_schema.txt
doc/DB/compass_db_schema.txt
+15
-7
compass_db_schema.xlsx
doc/DB/compass_db_schema.xlsx
+0
-0
小程序文件命名以及接口调用说明.xlsx
doc/小程序文件命名以及接口调用说明.xlsx
+0
-0
接口文档 V1.0.xls
doc/接口文档 V1.0.xls
+0
-0
环境准备.txt
doc/环境准备.txt
+2
-1
CourseMediaDat.inc
src/cn/compass/entity/CourseMediaDat.inc
+21
-11
CourseMst.inc
src/cn/compass/entity/CourseMst.inc
+3
-0
UserMst.inc
src/cn/compass/entity/UserMst.inc
+3
-0
UserPayLog.inc
src/cn/compass/entity/UserPayLog.inc
+16
-12
CourseParentCategory.inc
src/cn/compass/entity/definition/CourseParentCategory.inc
+1
-1
compass_include.inc
src/settings/compass_include.inc
+1
-1
ajax_get_area_info.php
src/user/if/ajax_get_area_info.php
+5
-4
ajax_get_course_by_category.php
src/user/if/ajax_get_course_by_category.php
+6
-5
ajax_get_course_category.php
src/user/if/ajax_get_course_category.php
+1
-2
ajax_get_course_detail.php
src/user/if/ajax_get_course_detail.php
+56
-34
ajax_get_top_dat.php
src/user/if/ajax_get_top_dat.php
+18
-1
ajax_get_user_role.php
src/user/if/ajax_get_user_role.php
+20
-11
ajax_set_user_message_read.php
src/user/if/ajax_set_user_message_read.php
+0
-61
ajax_user_join_circle.php
src/user/if/ajax_user_join_circle.php
+1
-1
No files found.
doc/DB/compass_db_schema.txt
View file @
794937f6
...
...
@@ -235,6 +235,7 @@ CREATE TABLE IF NOT EXISTS user_mst(
licensen_imgage text,
other_imgage text,
organization_status varchar(64) NOT NULL DEFAULT 'NEW',
is_member tinyint(1) NOT NULL DEFAULT '0'
ability_point int8 NOT NULL DEFAULT '0',
service_point int8 NOT NULL DEFAULT '0',
delete_flg tinyint(1) NOT NULL DEFAULT '0'
...
...
@@ -453,19 +454,21 @@ CREATE TABLE IF NOT EXISTS certificate_mst(
Create INDEX certificate_mst_id_idx ON certificate_mst(id);
##----user_p
oint
_log create
##----user_p
ay
_log create
DROP TABLE IF EXISTS user_p
oint
_log;
CREATE TABLE IF NOT EXISTS user_p
oint
_log(
DROP TABLE IF EXISTS user_p
ay
_log;
CREATE TABLE IF NOT EXISTS user_p
ay
_log(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
user_id int8 NOT NULL PRIMARY KEY auto_increment,
action_type int4 NOT NULL,
point int4 NOT NULL DEFAULT '0',
user_id int8 NOT NULL,
user_name varchar(64) NOT NULL,
action_type varchar(32) NOT NULL,
money float(5,2) NOT NULL DEFAULT '0',
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX user_point_log_user_id_idx ON user_point_log(user_id);
Create INDEX user_pay_log_user_id_idx ON user_pay_log(user_id);
Create INDEX user_pay_log_action_type_idx ON user_pay_log(action_type);
##----course_media_dat create
...
...
@@ -475,12 +478,16 @@ CREATE TABLE IF NOT EXISTS course_media_dat(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
course_id int8 NOT NULL DEFAULT '0',
parent_category_id int8 NOT NULL EFAULT '0',
sub_category_id int8 NOT NULL EFAULT '0',
title varchar(128) NOT NULL,
comment text NOT NULL,
tags text NOT NULL,
front_image text NOT NULL,
media text NOT NULL,
size int8 NOT NULL DEFAULT '0',
teacher varchar(128),
teacher_profile text,
is_free tinyint(1) NOT NULL DEFAULT '0',
price float(5,2) NOT NULL DEFAULT '0',
view_count int8 NOT NULL DEFAULT '0',
...
...
@@ -527,6 +534,7 @@ CREATE TABLE IF NOT EXISTS course_mst(
parent_category_id int8 NOT NULL,
sub_category_id int8 NOT NULL,
title varchar(128) NOT NULL,
comment text NOT NULL,
front_image text NOT NULL,
teacher_name varchar(128) NOT NULL,
teacher_profile text,
...
...
doc/DB/compass_db_schema.xlsx
View file @
794937f6
No preview for this file type
doc/小程序文件命名以及接口调用说明.xlsx
View file @
794937f6
No preview for this file type
doc/接口文档 V1.0.xls
View file @
794937f6
No preview for this file type
doc/环境准备.txt
View file @
794937f6
1. 小程
序开发者账号
1. 小程
序开发者账号
...
...
@@ -8,3 +8,4 @@
===
WxPayConfig 支付配置
一张首页的顶部banner图片
src/cn/compass/entity/CourseMediaDat.inc
View file @
794937f6
...
...
@@ -9,12 +9,16 @@
class
CourseMediaDat
extends
CompassDynamicData
{
var
$course_id
;
var
$parent_category_id
;
var
$sub_category_id
;
var
$title
;
var
$comment
;
var
$tags
;
var
$front_image
;
var
$media
;
var
$size
;
var
$teacher
;
var
$teacher_profile
;
var
$is_free
;
var
$price
;
var
$view_count
;
...
...
@@ -33,17 +37,19 @@ class CourseMediaDat extends CompassDynamicData
{
parent
::
constructor
(
$record
);
$this
->
course_id
=
$record
[
"course_id"
];
$this
->
title
=
$record
[
"title"
];
$this
->
tags
=
$record
[
"tags"
];
$this
->
front_image
=
$record
[
"front_image"
];
$this
->
media
=
$record
[
"media"
];
$this
->
size
=
$record
[
"size"
];
$this
->
teacher
=
$record
[
"teacher"
];
$this
->
is_free
=
$record
[
"is_free"
];
$this
->
price
=
$record
[
"price"
];
$this
->
view_count
=
$record
[
"view_count"
];
$this
->
delete_flg
=
$record
[
"delete_flg"
];
$this
->
course_id
=
$record
[
"course_id"
];
$this
->
title
=
$record
[
"title"
];
$this
->
comment
=
$record
[
"comment"
];
$this
->
tags
=
$record
[
"tags"
];
$this
->
front_image
=
$record
[
"front_image"
];
$this
->
media
=
$record
[
"media"
];
$this
->
size
=
$record
[
"size"
];
$this
->
teacher
=
$record
[
"teacher"
];
$this
->
teacher_profile
=
$record
[
"teacher_profile"
];
$this
->
is_free
=
$record
[
"is_free"
];
$this
->
price
=
$record
[
"price"
];
$this
->
view_count
=
$record
[
"view_count"
];
$this
->
delete_flg
=
$record
[
"delete_flg"
];
}
/**
...
...
@@ -108,12 +114,16 @@ class CourseMediaDat extends CompassDynamicData
$v_param
=
array
();
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"course_id"
);
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"parent_category_id"
);
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"sub_category_id"
);
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"title"
);
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"comment"
);
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"tags"
);
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"front_image"
);
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"media"
);
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"size"
);
ParamUtil
::
copyObj2ArrayNullField
(
$v_param
,
$this
,
"teacher"
);
ParamUtil
::
copyObj2ArrayNullField
(
$v_param
,
$this
,
"teacher_profile"
);
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"is_free"
);
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"price"
);
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"view_count"
);
...
...
src/cn/compass/entity/CourseMst.inc
View file @
794937f6
...
...
@@ -11,6 +11,7 @@ class CourseMst extends CompassDynamicData
var
$parent_category_id
;
var
$sub_category_id
;
var
$title
;
var
$comment
;
var
$front_image
;
var
$teacher_name
;
var
$teacher_profile
;
...
...
@@ -30,6 +31,7 @@ class CourseMst extends CompassDynamicData
$this
->
parent_category_id
=
$record
[
"parent_category_id"
];
$this
->
sub_category_id
=
$record
[
"sub_category_id"
];
$this
->
title
=
$record
[
"title"
];
$this
->
comment
=
$record
[
"comment"
];
$this
->
front_image
=
$record
[
"front_image"
];
$this
->
teacher_name
=
$record
[
"teacher_name"
];
$this
->
teacher_profile
=
$record
[
"teacher_profile"
];
...
...
@@ -101,6 +103,7 @@ class CourseMst extends CompassDynamicData
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"parent_category_id"
);
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"sub_category_id"
);
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"title"
);
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"comment"
);
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"front_image"
);
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"teacher_name"
);
ParamUtil
::
copyObj2ArrayNullField
(
$v_param
,
$this
,
"teacher_profile"
);
...
...
src/cn/compass/entity/UserMst.inc
View file @
794937f6
...
...
@@ -37,6 +37,7 @@ class UserMst extends CompassDynamicData
var
$licensen_imgage
;
var
$other_imgage
;
var
$organization_status
;
var
$is_member
;
var
$ability_point
;
var
$service_point
;
var
$delete_flg
;
...
...
@@ -80,6 +81,7 @@ class UserMst extends CompassDynamicData
$this
->
licensen_imgage
=
$record
[
"licensen_imgage"
];
$this
->
other_imgage
=
$record
[
"other_imgage"
];
$this
->
organization_status
=
$record
[
"organization_status"
];
$this
->
is_member
=
$record
[
"is_member"
];
$this
->
ability_point
=
$record
[
"ability_point"
];
$this
->
service_point
=
$record
[
"service_point"
];
$this
->
delete_flg
=
$record
[
"delete_flg"
];
...
...
@@ -175,6 +177,7 @@ class UserMst extends CompassDynamicData
ParamUtil
::
copyObj2ArrayNullField
(
$v_param
,
$this
,
"licensen_imgage"
);
ParamUtil
::
copyObj2ArrayNullField
(
$v_param
,
$this
,
"other_imgage"
);
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"organization_status"
);
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"is_member"
);
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"ability_point"
);
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"service_point"
);
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"delete_flg"
);
...
...
src/cn/compass/entity/UserP
oint
Log.inc
→
src/cn/compass/entity/UserP
ay
Log.inc
View file @
794937f6
<?php
/**
* UserP
oint
Log Entity
* $Id: UserP
oint
Log.inc,v 1.1 2020/2/27 14:40:01 Exp $
* UserP
ay
Log Entity
* $Id: UserP
ay
Log.inc,v 1.1 2020/2/27 14:40:01 Exp $
* @author zb
* @package jp.compass.entity
* @access public
*/
class
UserP
oint
Log
extends
CompassDynamicData
class
UserP
ay
Log
extends
CompassDynamicData
{
var
$user_id
;
var
$user_name
;
var
$action_type
;
var
$
point
;
var
$
money
;
var
$delete_flg
;
/**
* 构造实现。user_p
oint
_log创建实例。
* 构造实现。user_p
ay
_log创建实例。
*
* @access public
* @param mixed user_p
oint
_log
* @param mixed user_p
ay
_log
*/
function
constructor
(
$record
)
{
parent
::
constructor
(
$record
);
$this
->
user_id
=
$record
[
"user_id"
];
$this
->
user_name
=
$record
[
"user_name"
];
$this
->
action_type
=
$record
[
"action_type"
];
$this
->
point
=
$record
[
"point
"
];
$this
->
money
=
$record
[
"money
"
];
$this
->
delete_flg
=
$record
[
"delete_flg"
];
}
...
...
@@ -44,7 +46,7 @@ class UserPointLog extends CompassDynamicData
$w_param
[
"delete_flg"
]
=
"false"
;
}
return
CompassDBHandler
::
getList
(
"UserP
ointLog"
,
"user_point
_log"
,
$w_param
,
$orderkey
,
$direction
,
$offset
,
$limit
);
return
CompassDBHandler
::
getList
(
"UserP
ayLog"
,
"user_pay
_log"
,
$w_param
,
$orderkey
,
$direction
,
$offset
,
$limit
);
}
/**
...
...
@@ -62,7 +64,7 @@ class UserPointLog extends CompassDynamicData
$w_param
[
"delete_flg"
]
=
"false"
;
}
$db
=
CompassDBManager
::
getInstance
();
$result
=
$db
->
doSelect
(
"user_p
oint
_log"
,
$w_param
,
null
,
null
,
null
,
null
,
"count(*) as count"
);
$result
=
$db
->
doSelect
(
"user_p
ay
_log"
,
$w_param
,
null
,
null
,
null
,
null
,
"count(*) as count"
);
return
$result
[
0
][
"count"
];
}
...
...
@@ -76,7 +78,7 @@ class UserPointLog extends CompassDynamicData
$param
=
array
();
$param
[
"delete_flg"
]
=
false
;
return
CompassDBHandler
::
getById
(
"UserP
ointLog"
,
"user_point
_log"
,
$id
,
$param
);
return
CompassDBHandler
::
getById
(
"UserP
ayLog"
,
"user_pay
_log"
,
$id
,
$param
);
}
// -- 这里开始Dynamic ---
...
...
@@ -91,11 +93,12 @@ class UserPointLog extends CompassDynamicData
$v_param
=
array
();
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"user_id"
);
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"user_name"
);
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"action_type"
);
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"
point
"
);
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"
money
"
);
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"delete_flg"
);
// 保存
parent
::
_save
(
"user_p
oint
_log"
,
$v_param
);
parent
::
_save
(
"user_p
ay
_log"
,
$v_param
);
}
}
\ No newline at end of file
src/cn/compass/entity/definition/CourseParentCategory.inc
View file @
794937f6
...
...
@@ -26,7 +26,7 @@ class CourseParentCategory
$data
=
array
();
$tmp
=
array
(
"id"
=>
1
,
"title"
=>
"
科学
课堂"
);
$tmp
=
array
(
"id"
=>
1
,
"title"
=>
"
学科
课堂"
);
array_push
(
$data
,
$tmp
);
$tmp
=
array
(
"id"
=>
2
,
"title"
=>
"专题课堂"
);
...
...
src/settings/compass_include.inc
View file @
794937f6
...
...
@@ -29,7 +29,7 @@ require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/UserAccessDat.inc");
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/UserCommentDat.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/UserFavoriteDat.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/UserMst.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/UserP
oint
Log.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/UserP
ay
Log.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/MediaTagDat.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/UserMediaDat.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/SystemConstDat.inc"
);
...
...
src/user/if/ajax_get_area_info.php
View file @
794937f6
...
...
@@ -42,16 +42,17 @@ $offset = $page * $rowCount;
$param
=
array
();
//
$param['province'] = $province;
$param
[
'province'
]
=
$province
;
if
(
!
empty
(
$city
))
{
//
$param['city'] = $city;
$param
[
'city'
]
=
$city
;
}
if
(
!
empty
(
$district
))
{
//
$param['district'] = $district;
$param
[
'district'
]
=
$district
;
}
$param
[
'delete_flg'
]
=
false
;
$schoolList
=
SchoolMst
::
getList
(
$param
,
'province'
,
'asc, city asc, district asc'
,
$offset
,
$rowCount
);
$schoolCount
=
SchoolMst
::
getListCount
(
$param
);
$pageCount
=
ceil
(
$schoolCount
/
$rowCount
);
//能力分汇总
$abilityPoint
=
0
;
...
...
@@ -72,8 +73,8 @@ if(!empty($tmp)) {
//接口返回数据
$result
[
"page"
]
=
$page
;
$result
[
"rowCount"
]
=
$rowCount
;
$result
[
"pageCount"
]
=
$pageCount
;
$result
[
"schoolList"
]
=
$schoolList
;
$result
[
"schoolCount"
]
=
$schoolCount
;
$result
[
"abilityPoint"
]
=
$abilityPoint
;
ErrorLogger
::
doOutput
(
"Compass...ajax_get_certificates.php....End."
,
0
);
...
...
src/user/if/ajax_get_course_by_category.php
View file @
794937f6
...
...
@@ -22,14 +22,15 @@ $param = array();
$param
[
'parent_category_id'
]
=
$parentId
;
$param
[
'sub_category_id'
]
=
$subId
;
$param
[
'delete_flg'
]
=
false
;
$courseList
=
CourseMst
::
getList
(
$param
,
'id'
,
'desc'
,
$offset
,
$rowCount
);
$allCount
=
CourseMst
::
getListCount
(
$param
);
$mediaList
=
CourseMediaDat
::
getList
(
$param
,
'id'
,
'desc'
,
$offset
,
$rowCount
);
$allCount
=
CourseMediaDat
::
getListCount
(
$param
);
$pageCount
=
ceil
(
$allCount
/
$rowCount
);
//接口返回数据
$result
[
"allCount"
]
=
$allCount
;
$result
[
"page"
]
=
$page
;
$result
[
"rowCount"
]
=
$rowCount
;
$result
[
"list"
]
=
$courseList
;
$result
[
"page"
]
=
$page
;
$result
[
"pageCount"
]
=
$pageCount
;
$result
[
"list"
]
=
$mediaList
;
ErrorLogger
::
doOutput
(
"Compass...ajax_get_course_by_category.php....End."
,
0
);
...
...
src/user/if/ajax_get_course_category.php
View file @
794937f6
...
...
@@ -11,11 +11,10 @@ $parentCategorys = CourseParentCategory::getList();
$result
=
array
();
//获取对应的二级分类
foreach
(
$parentCategorys
as
$parentCategory
)
{
//检索数据库
$param
[
'parent_id'
]
=
$parentCategory
->
id
;
$param
[
'delete_flg'
]
=
false
;
$subCategoryList
=
CourseCategoryDat
::
getList
(
$param
,
'id'
,
'desc'
,
0
,
1
);
$subCategoryList
=
CourseCategoryDat
::
getList
(
$param
,
'id'
,
'desc'
);
$parentCategory
->
subCategorys
=
$subCategoryList
;
$result
[]
=
$parentCategory
;
}
...
...
src/user/if/ajax_get_course_detail.php
View file @
794937f6
...
...
@@ -7,11 +7,10 @@ ErrorLogger::doOutput("Compass...ajax_get_course_detail.php....Start.", 0);
//获取参数
$unionId
=
ParamUtil
::
getRequestString
(
"unionId"
);
$courseId
=
ParamUtil
::
getRequestNumber
(
"courseId"
,
0
);
$mediaId
=
ParamUtil
::
getRequestNumber
(
"mediaId"
,
0
);
//参数检查
if
(
empty
(
$unionId
)
||
empty
(
$
course
Id
))
{
if
(
empty
(
$unionId
)
||
empty
(
$
media
Id
))
{
$result
[
"message"
]
=
"参数错误!"
;
responseNG
(
$result
);
}
...
...
@@ -28,49 +27,72 @@ if(empty($userList)) {
$userMst
=
$userList
[
0
];
//判断用户的观看权限
$result
=
array
();
//
每页显示条数
$courseM
st
=
CourseMst
::
getById
(
$course
Id
);
if
(
empty
(
$courseM
s
t
))
{
$result
[
"message"
]
=
"
参数错误
!"
;
//
判断视频是否存在
$courseM
ediaDat
=
CourseMediaDat
::
getById
(
$media
Id
);
if
(
empty
(
$courseM
ediaDa
t
))
{
$result
[
"message"
]
=
"
视频不存在
!"
;
responseNG
(
$result
);
}
//获取对应的媒体列表
//如果为合集视频获取对应的媒体列表
$courseTitle
=
""
;
$teacherName
=
""
;
$teacherProfile
=
""
;
$frontImage
=
""
;
$courseMediaList
=
array
();
$param
=
array
();
$param
[
'course_id'
]
=
$courseId
;
$param
[
'delete_flg'
]
=
false
;
$tmpList
=
CourseMediaDat
::
getList
(
$param
,
'id'
,
'asc'
);
if
(
!
empty
(
$tmpList
))
{
foreach
(
$tmpList
as
$tmp
)
{
$tmp
->
haveBuy
=
false
;
if
(
!
$tmp
->
is_free
)
{
//收费课程的情况下,判断用户是否已经购买本课程
$param
=
array
();
$param
[
'user_id'
]
=
$$userMst
->
id
;
$param
[
'course_id'
]
=
$courseId
;
$param
[
'media_id'
]
=
$tmp
->
id
;
$param
[
'is_free'
]
=
false
;
$param
[
'status'
]
=
'SUCCESS'
;
$param
[
'delete_flg'
]
=
false
;
$userBuyList
=
UserMediaDat
::
getList
(
$param
,
"id"
,
"desc"
,
0
,
1
);
if
(
!
empty
(
$userBuyList
))
{
$tmp
->
haveBuy
=
true
;
//单个视频
if
(
$courseMediaDat
->
course_id
==
0
)
{
$courseMediaList
[]
=
$courseMediaDat
;
$courseTitle
=
$courseMediaDat
->
title
;
$teacherName
=
$courseMediaDat
->
teacher
;
$teacherProfile
=
$courseMediaDat
->
teacher_profile
;
$frontImage
=
$courseMediaDat
->
front_image
;
}
else
{
//合集视频
$courseMst
=
CourseMst
::
getById
(
$courseMediaDat
->
course_id
);
$courseTitle
=
$courseMst
->
title
;
$teacherName
=
$courseMst
->
teacher
;
$teacherProfile
=
$courseMst
->
teacher_profile
;
$frontImage
=
$courseMst
->
front_image
;
$param
=
array
();
$param
[
'course_id'
]
=
$courseMediaDat
->
course_id
;
$param
[
'delete_flg'
]
=
false
;
$tmpList
=
CourseMediaDat
::
getList
(
$param
,
'id'
,
'asc'
);
if
(
!
empty
(
$tmpList
))
{
foreach
(
$tmpList
as
$tmp
)
{
$tmp
->
haveBuy
=
false
;
if
(
!
$tmp
->
is_free
)
{
//收费课程的情况下,判断用户是否已经购买本课程
$param
=
array
();
$param
[
'user_id'
]
=
$$userMst
->
id
;
$param
[
'course_id'
]
=
$courseId
;
$param
[
'media_id'
]
=
$tmp
->
id
;
$param
[
'is_free'
]
=
false
;
$param
[
'status'
]
=
'SUCCESS'
;
$param
[
'delete_flg'
]
=
false
;
$userBuyList
=
UserMediaDat
::
getList
(
$param
,
"id"
,
"desc"
,
0
,
1
);
if
(
!
empty
(
$userBuyList
))
{
$tmp
->
haveBuy
=
true
;
}
}
$courseMediaList
[]
=
$tmp
;
}
$courseMediaList
[]
=
$tmp
;
}
}
//接口返回数据
$result
[
"teacherName"
]
=
$courseMst
->
teacher_name
;
$result
[
"teacherProfile"
]
=
$courseMst
->
teacher_profile
;
$result
[
"mediaCount"
]
=
$courseMst
->
media_count
;
$result
[
"list"
]
=
$courseMediaList
;
$result
[
"courseTitle"
]
=
$courseTitle
;
$result
[
"teacherName"
]
=
$teacherName
;
$result
[
"teacherProfile"
]
=
$teacherProfile
;
$result
[
"frontImage"
]
=
$teacherProfile
;
$result
[
"mediaCount"
]
=
count
(
$courseMediaList
);
$result
[
"mediaList"
]
=
$courseMediaList
;
ErrorLogger
::
doOutput
(
"Compass...ajax_get_course_detail.php....End."
,
0
);
...
...
src/user/if/ajax_get_top_dat.php
View file @
794937f6
...
...
@@ -54,7 +54,7 @@ $volunteerEventList = VolunteerEventDat::getList($param,'id','desc', 0, 1);
//亲子活动
if
(
$userMst
->
role
==
1
)
{
//亲子活动
//
本校
亲子活动
$param
=
array
();
$param
[
'school_no'
]
=
$userMst
->
school_no
;
$param
[
'original_source'
]
=
$userMst
->
school_no
;
...
...
@@ -71,6 +71,23 @@ if($userMst->role == 2) {
$socialEventList
=
SocialEventDat
::
getList
(
$param
,
'id'
,
'desc'
,
0
,
1
);
}
//教育局领导、社会用户、机构用户根据年龄段选择活动
if
(
$userMst
->
role
==
4
||
$userMst
->
role
==
5
||
$userMst
->
role
==
6
)
{
//3~6岁[亲子活动]
if
(
$userMst
->
child_age
==
1
)
{
$param
=
array
();
$param
[
'delete_flg'
]
=
false
;
$familyEventList
=
FamilyEventDat
::
getList
(
$param
,
'id'
,
'desc'
,
0
,
1
);
}
//7岁以上[社会实践]
if
(
$userMst
->
child_age
==
2
)
{
$param
=
array
();
$param
[
'delete_flg'
]
=
false
;
$socialEventList
=
SocialEventDat
::
getList
(
$param
,
'id'
,
'desc'
,
0
,
1
);
}
}
//公益课堂
$param
=
array
();
...
...
src/user/if/ajax_get_user_role.php
View file @
794937f6
...
...
@@ -15,7 +15,7 @@ $result = array();
//参数检查
if
(
empty
(
$unionId
))
{
$result
[
"message"
]
=
"参数错误!"
;
responseNG
(
$result
);
responseNG
1
(
$result
);
}
//判断用户是否存在
...
...
@@ -24,14 +24,16 @@ $param['unionid'] = $unionId;
$param
[
'delete_flg'
]
=
false
;
$userList
=
UserMst
::
getList
(
$param
,
'id'
,
'desc'
,
0
,
1
);
if
(
empty
(
$userList
))
{
$result
[
"message"
]
=
"
用户不存在
!"
;
responseNG
(
$result
);
$result
[
"message"
]
=
"
未注册用户
!"
;
responseNG
2
(
$result
);
}
$userMst
=
$userList
[
0
];
//接口返回数据
$result
[
"role"
]
=
$userMst
->
role
;
$result
[
"isMember"
]
=
$userMst
->
is_member
;
$result
[
"childAge"
]
=
$userMst
->
child_age
;
$result
[
"schoolOwner"
]
=
$userMst
->
school_owner
;
$result
[
"classOwner"
]
=
$userMst
->
class_owner
;
$result
[
"governmentId"
]
=
$userMst
->
government_id
;
...
...
@@ -43,13 +45,15 @@ $lbsUrl = 'https://apis.map.qq.com/ws/geocoder/v1?key=' . LBS_KEY . '&location='
$lbsObj
=
file_get_contents
(
$lbsUrl
);
$jsonObj
=
json_decode
(
$lbsObj
);
//对JSON格式的字符串进行编码
$lbsArray
=
get_object_vars
(
$jsonObj
);
//转换成数组
$resultObj
=
$lbsArray
[
'result'
];
//地理位置获取正常的情况下设定。 156:中国代码
if
(
$lbsArray
[
'status'
]
==
"0"
&&
$resultObj
->
ad_info
->
nation_code
==
156
)
{
//保存到用户当前地理位置中
$result
[
"province"
]
=
$resultObj
->
address_component
->
province
;
$result
[
"city"
]
=
$resultObj
->
address_component
->
city
;
$result
[
"district"
]
=
$resultObj
->
address_component
->
district
;
if
(
isset
(
$lbsArray
[
'result'
]))
{
$resultObj
=
$lbsArray
[
'result'
];
//地理位置获取正常的情况下设定。 156:中国代码
if
(
$lbsArray
[
'status'
]
==
"0"
&&
$resultObj
->
ad_info
->
nation_code
==
156
)
{
//保存到用户当前地理位置中
$result
[
"province"
]
=
$resultObj
->
address_component
->
province
;
$result
[
"city"
]
=
$resultObj
->
address_component
->
city
;
$result
[
"district"
]
=
$resultObj
->
address_component
->
district
;
}
}
ErrorLogger
::
doOutput
(
"Compass...ajax_get_user_role.php....End."
,
0
);
...
...
@@ -57,11 +61,16 @@ ErrorLogger::doOutput("Compass...ajax_get_user_role.php....End.", 0);
//返回结果
responseOK
(
$result
);
function
responseNG
(
$result
)
{
function
responseNG
1
(
$result
)
{
$result
=
array
(
"status"
=>
"NG"
,
"result"
=>
$result
);
print
json_encode
(
$result
);
exit
;
}
function
responseNG2
(
$result
)
{
$result
=
array
(
"status"
=>
"REGIST"
,
"result"
=>
$result
);
print
json_encode
(
$result
);
exit
;
}
function
responseOK
(
$result
)
{
$result
=
array
(
"status"
=>
"OK"
,
"result"
=>
$result
);
print
json_encode
(
$result
);
...
...
src/user/if/ajax_set_user_message_read.php
deleted
100644 → 0
View file @
5819b46e
<?php
// 修改用户的未读消息为已读状态
require_once
(
"../user_include.inc"
);
ErrorLogger
::
doOutput
(
"Compass...ajax_set_user_message_read.php....Start."
,
0
);
//获取参数
$unionId
=
ParamUtil
::
getRequestString
(
"unionId"
);
$messageId
=
ParamUtil
::
getRequestNumber
(
"messageId"
);
//参数检查
if
(
empty
(
$unionId
)
||
empty
(
$messageId
))
{
$result
[
"message"
]
=
"参数错误!"
;
responseNG
(
$result
);
}
//检索用户是否存在
$param
[
'unionid'
]
=
$unionId
;
$param
[
'delete_flg'
]
=
false
;
$userList
=
UserMst
::
getList
(
$param
,
'id'
,
'desc'
,
0
,
1
);
if
(
empty
(
$userList
))
{
$result
[
"message"
]
=
"用户不存在!"
;
responseNG
(
$result
);
}
$userId
=
$userList
[
0
]
->
id
;
//查询消息数据
$param
=
array
();
$param
[
'user_id'
]
=
$userId
;
$param
[
'is_read'
]
=
false
;
$param
[
'id'
]
=
$messageId
;
$param
[
'delete_flg'
]
=
false
;
$userMessageList
=
UserMessageDat
::
getList
(
$param
,
'id'
,
'desc'
,
0
,
1
);
//更新
if
(
!
empty
(
$userMessageList
))
{
$userMessageList
[
0
]
->
is_read
=
true
;
$userMessageList
[
0
]
->
save
();
}
ErrorLogger
::
doOutput
(
"Compass...ajax_set_user_message_read.php....End."
,
0
);
//返回结果
$result
[
"message"
]
=
"更新成功!"
;
responseOK
(
$result
);
function
responseNG
(
$result
)
{
$result
=
array
(
"status"
=>
"NG"
,
"result"
=>
$result
);
print
json_encode
(
$result
);
exit
;
}
function
responseOK
(
$result
)
{
$result
=
array
(
"status"
=>
"OK"
,
"result"
=>
$result
);
print
json_encode
(
$result
);
exit
;
}
?>
\ No newline at end of file
src/user/if/ajax_user_join_circle.php
View file @
794937f6
...
...
@@ -54,7 +54,7 @@ if($circleDat->need_check) {
$userMessageDat
=
new
UserMessageDat
();
$userMessageDat
->
user_id
=
$circleDat
->
owner_id
;
$userMessageDat
->
title
=
"您的圈子有一条加入申请"
;
$userMessageDat
->
comment
=
"嘀嘀嘀!
有个好友
申请加入您的圈子!"
;
$userMessageDat
->
comment
=
"嘀嘀嘀!
"
.
$userMst
->
name
.
"
申请加入您的圈子!"
;
//添加附件附件
$userMessageDat
->
attach_dat_type
=
"CIRCLE"
;
...
...
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