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
a0d5cefb
Commit
a0d5cefb
authored
Feb 11, 2020
by
biao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
d7ae9335
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
135 additions
and
35 deletions
+135
-35
compass_db_schema.xlsx
doc/DB/compass_db_schema.xlsx
+0
-0
接口文档 V1.0.xls
doc/接口文档 V1.0.xls
+0
-0
CourseCategoryDat.inc
src/cn/compass/entity/CourseCategoryDat.inc
+99
-0
CourseParentCategory.inc
src/cn/compass/entity/definition/CourseParentCategory.inc
+2
-0
compass_include.inc
src/settings/compass_include.inc
+2
-3
ajax_get_course_by_category.php
src/user/if/ajax_get_course_by_category.php
+21
-19
ajax_get_course_category.php
src/user/if/ajax_get_course_category.php
+11
-13
No files found.
doc/DB/compass_db_schema.xlsx
View file @
a0d5cefb
No preview for this file type
doc/接口文档 V1.0.xls
View file @
a0d5cefb
No preview for this file type
src/cn/compass/entity/CourseCategoryDat.inc
0 → 100644
View file @
a0d5cefb
<?php
/**
* CourseCategoryDat Entity
* $Id: CourseCategoryDat.inc,v 1.1 2020/1/17 14:38:28 Exp $
* @author lixq
* @package jp.compass.entity
* @access public
*/
class
CourseCategoryDat
extends
CompassDynamicData
{
var
$parent_id
;
var
$title
;
var
$delete_flg
;
/**
* 构造实现。course_category_dat创建实例。
*
* @access public
* @param mixed course_category_dat
*/
function
constructor
(
$record
)
{
parent
::
constructor
(
$record
);
$this
->
parent_id
=
$record
[
"parent_id"
];
$this
->
title
=
$record
[
"title"
];
$this
->
delete_flg
=
$record
[
"delete_flg"
];
}
/**
* 根据条件,获取数据列表。
* 条件与DBManager的doSelect相同。
* @access public
* @static
* @param array 检索条件
* @return array Entity的队列
*/
public
static
function
getList
(
$w_param
=
null
,
$orderkey
=
null
,
$direction
=
"ASC"
,
$offset
=
null
,
$limit
=
null
)
{
if
(
$w_param
==
null
)
{
$w_param
=
array
();
$w_param
[
"delete_flg"
]
=
"false"
;
}
return
CompassDBHandler
::
getList
(
"CourseCategoryDat"
,
"course_category_dat"
,
$w_param
,
$orderkey
,
$direction
,
$offset
,
$limit
);
}
/**
* 根据条件,获取数据列表的件数。
* 条件与DBManager的doSelect相同。
* @access public
* @static
* @param array 检索条件
* @return array Entity的队列
*/
public
static
function
getListCount
(
$w_param
=
null
)
{
if
(
$w_param
==
null
)
{
$w_param
=
array
();
$w_param
[
"delete_flg"
]
=
"false"
;
}
$db
=
CompassDBManager
::
getInstance
();
$result
=
$db
->
doSelect
(
"course_category_dat"
,
$w_param
,
null
,
null
,
null
,
null
,
"count(*) as count"
);
return
$result
[
0
][
"count"
];
}
/**
* 获得此类指定ID的实例。
*/
public
static
function
getById
(
$id
)
{
// delete_flg
$param
=
array
();
$param
[
"delete_flg"
]
=
false
;
return
CompassDBHandler
::
getById
(
"CourseCategoryDat"
,
"course_category_dat"
,
$id
,
$param
);
}
// -- 这里开始Dynamic ---
/**
* 将此实例写入DB。
* DynamicData共用的保存方法。
* @access public
* @return int 写入实例的ID
*/
public
function
save
()
{
$v_param
=
array
();
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"parent_id"
);
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"title"
);
ParamUtil
::
copyObj2Array
(
$v_param
,
$this
,
"delete_flg"
);
// 保存
parent
::
_save
(
"course_category_dat"
,
$v_param
);
}
}
\ No newline at end of file
src/cn/compass/entity/definition/CourseParentCategory.inc
View file @
a0d5cefb
...
...
@@ -10,6 +10,8 @@ class CourseParentCategory
public
$id
;
public
$title
;
public
$subCategorys
;
function
__construct
(
$record
)
{
$this
->
id
=
$record
[
"id"
];
$this
->
title
=
$record
[
"title"
];
...
...
src/settings/compass_include.inc
View file @
a0d5cefb
...
...
@@ -24,8 +24,6 @@ require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/ClassMst.inc");
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/EventDat.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/GovernmentMst.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/GradeMst.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/MiniplayTrafficClickDat.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/MiniplayTrafficClickLog.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/OrganizationMst.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/SchoolMst.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/SystemConstantDat.inc"
);
...
...
@@ -36,8 +34,8 @@ 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/UserPointLog.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/UserSignDat.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/UserStaffRelationDat.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/SystemConstDat.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/CourseCategoryDat.inc"
);
// definition
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/definition/ImageType.inc"
);
...
...
@@ -53,6 +51,7 @@ require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/definition/SystemFunction.in
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/definition/OrganizationStatus.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/definition/AcountModule.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/definition/OrderStatus.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/definition/CourseParentCategory.inc"
);
// Action
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/action/TemplateAction.inc"
);
...
...
src/user/if/ajax_get_
organization_rule_text - 副本
.php
→
src/user/if/ajax_get_
course_by_category
.php
View file @
a0d5cefb
<?php
<?php
<?php
//
使用代金券
//
根据课程分类获取课程列表
require_once
(
"../user_include.inc"
);
ErrorLogger
::
doOutput
(
"Compass...ajax_get_organization_rule_text.php....Start."
,
0
);
ErrorLogger
::
doOutput
(
"Compass...ajax_get_course_by_category.php....Start."
,
0
);
//获取参数
//根据常量获取定义的值
$constName
=
"ORGNAZATION_RULE"
;
$constValue
=
""
;
//检索数据库
$param
[
'name'
]
=
$constName
;
$param
[
'delete_flg'
]
=
false
;
$systemConstantDatList
=
SystemConstantDat
::
getList
(
$param
,
'id'
,
'desc'
,
0
,
1
);
if
(
!
empty
(
$systemConstantDatList
))
{
$constValue
=
$systemConstantDatList
[
0
]
->
constant_value
;
}
ErrorLogger
::
doOutput
(
"Compass...ajax_get_organization_rule_text.php....constValue="
.
$constValue
,
0
);
ErrorLogger
::
doOutput
(
"Compass...ajax_get_organization_rule_text.php....End."
,
0
);
$parentCategorys
=
CourseParentCategory
::
getList
();
$result
=
array
();
//获取对应的二级分类
foreach
(
$parentCategorys
as
$parentCategory
)
{
//如果为空说明未设定该参数的值
if
(
empty
(
$constValue
))
{
responseNG
(
"系统设定错误!"
);
//检索数据库
$param
[
'parent_id'
]
=
$parentCategory
->
id
;
$param
[
'delete_flg'
]
=
false
;
$subCategoryList
=
CourseCategoryDat
::
getList
(
$param
,
'id'
,
'desc'
,
0
,
1
);
$parentCategory
->
subCategorys
=
$subCategoryList
;
$result
[]
=
$parentCategory
;
}
ErrorLogger
::
doOutput
(
"Compass...ajax_get_course_by_category.php....End."
,
0
);
//返回结果
responseOK
(
$
constValue
);
responseOK
(
$
result
);
function
responseNG
(
$result
)
{
$result
=
array
(
"status"
=>
"NG"
,
"result"
=>
$result
);
...
...
src/user/if/ajax_get_course_category.php
View file @
a0d5cefb
...
...
@@ -8,26 +8,24 @@ ErrorLogger::doOutput("Compass...ajax_get_course_category.php....Start.", 0);
//根据常量获取定义的值
$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
);
$parentCategory
->
subCategorys
=
$subCategoryList
;
$result
[]
=
$parentCategory
;
}
//检索数据库
$param
[
'name'
]
=
$constName
;
$param
[
'delete_flg'
]
=
false
;
$systemConstantDatList
=
SystemConstantDat
::
getList
(
$param
,
'id'
,
'desc'
,
0
,
1
);
if
(
!
empty
(
$systemConstantDatList
))
{
$constValue
=
$systemConstantDatList
[
0
]
->
constant_value
;
}
ErrorLogger
::
doOutput
(
"Compass...ajax_get_course_category.php....constValue="
.
$constValue
,
0
);
ErrorLogger
::
doOutput
(
"Compass...ajax_get_course_category.php....End."
,
0
);
//如果为空说明未设定该参数的值
if
(
empty
(
$constValue
))
{
responseNG
(
"系统设定错误!"
);
}
//返回结果
responseOK
(
$
constValue
);
responseOK
(
$
result
);
function
responseNG
(
$result
)
{
$result
=
array
(
"status"
=>
"NG"
,
"result"
=>
$result
);
...
...
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