Commit b80888d6 by biao

1

parent a0d5cefb
...@@ -421,6 +421,8 @@ DROP TABLE IF EXISTS course_mst; ...@@ -421,6 +421,8 @@ DROP TABLE IF EXISTS course_mst;
CREATE TABLE IF NOT EXISTS course_mst( CREATE TABLE IF NOT EXISTS course_mst(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment, id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
parent_category_id int8 NOT NULL,
sub_category_id int8 NOT NULL,
title varchar(128) NOT NULL, title varchar(128) NOT NULL,
front_image varchar(64) NOT NULL, front_image varchar(64) NOT NULL,
teacher_profile text, teacher_profile text,
...@@ -428,7 +430,6 @@ CREATE TABLE IF NOT EXISTS course_mst( ...@@ -428,7 +430,6 @@ CREATE TABLE IF NOT EXISTS course_mst(
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4; ) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
##----user_point_log create ##----user_point_log create
DROP TABLE IF EXISTS user_point_log; DROP TABLE IF EXISTS user_point_log;
......
开发服务器:
111.230.198.141
默认账户为 root ,初始密码:FS3y_e7pZYT?
目录:/var/www/html/compass
管理端:http://manager.koala-online.cn
数据库:http://manager.koala-online.cn/phpMyAdmin
管理端开发地址 管理端开发地址
http://compass.koala-online.cn/manager http://compass.koala-online.cn/manager
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
*/ */
class CourseMst extends CompassDynamicData class CourseMst extends CompassDynamicData
{ {
var $parent_category_id;
var $sub_category_id;
var $title; var $title;
var $front_image; var $front_image;
var $teacher_profile; var $teacher_profile;
...@@ -23,6 +25,8 @@ class CourseMst extends CompassDynamicData ...@@ -23,6 +25,8 @@ class CourseMst extends CompassDynamicData
{ {
parent::constructor($record); parent::constructor($record);
$this->parent_category_id = $record["parent_category_id"];
$this->sub_category_id = $record["sub_category_id"];
$this->title = $record["title"]; $this->title = $record["title"];
$this->front_image = $record["front_image"]; $this->front_image = $record["front_image"];
$this->teacher_profile = $record["teacher_profile"]; $this->teacher_profile = $record["teacher_profile"];
...@@ -90,6 +94,8 @@ class CourseMst extends CompassDynamicData ...@@ -90,6 +94,8 @@ class CourseMst extends CompassDynamicData
{ {
$v_param = array(); $v_param = array();
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, "title");
ParamUtil::copyObj2Array($v_param, $this, "front_image"); ParamUtil::copyObj2Array($v_param, $this, "front_image");
ParamUtil::copyObj2ArrayNullField($v_param, $this, "teacher_profile"); ParamUtil::copyObj2ArrayNullField($v_param, $this, "teacher_profile");
......
...@@ -36,6 +36,9 @@ require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/UserPointLog.inc"); ...@@ -36,6 +36,9 @@ 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/UserSignDat.inc");
require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/SystemConstDat.inc"); require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/SystemConstDat.inc");
require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/CourseCategoryDat.inc"); require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/CourseCategoryDat.inc");
require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/CourseMst.inc");
require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/CourseMediaDat.inc");
// definition // definition
require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/definition/ImageType.inc"); require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/definition/ImageType.inc");
......
...@@ -6,21 +6,30 @@ require_once ("../user_include.inc"); ...@@ -6,21 +6,30 @@ require_once ("../user_include.inc");
ErrorLogger::doOutput("Compass...ajax_get_course_by_category.php....Start.", 0); ErrorLogger::doOutput("Compass...ajax_get_course_by_category.php....Start.", 0);
//获取参数 //获取参数
$parentId = ParamUtil::getRequestNumber("parentId", 0);
$subId = ParamUtil::getRequestNumber("subId", 0);
$page = ParamUtil::getRequestNumber("page", 0);
//根据常量获取定义的值 //每页显示条数
$parentCategorys = CourseParentCategory::getList(); $rowCount = 10;
$result = array(); $result = array();
//获取对应的二级分类
foreach($parentCategorys as $parentCategory) { $offset = $page * $rowCount;
//检索数据库 //检索数据库
$param['parent_id'] = $parentCategory->id; $param = array();
$param['delete_flg'] = false; $param['parent_category_id'] = $parentId;
$subCategoryList = CourseCategoryDat::getList($param,'id','desc', 0, 1); $param['sub_category_id'] = $subId;
$parentCategory->subCategorys = $subCategoryList; $param['delete_flg'] = false;
$result[] = $parentCategory; $courseList = CourseMst::getList($param,'id','desc', $offset, $rowCount);
} $allCount = CourseMst::getListCount($param);
//接口返回数据
$result["allCount"] = $allCount;
$result["page"] = $page;
$result["rowCount"] = $rowCount;
$result["list"] = $courseList;
ErrorLogger::doOutput("Compass...ajax_get_course_by_category.php....End.", 0); ErrorLogger::doOutput("Compass...ajax_get_course_by_category.php....End.", 0);
......
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