Commit 794937f6 by biao

11

parent 5819b46e
...@@ -235,6 +235,7 @@ CREATE TABLE IF NOT EXISTS user_mst( ...@@ -235,6 +235,7 @@ CREATE TABLE IF NOT EXISTS user_mst(
licensen_imgage text, licensen_imgage text,
other_imgage text, other_imgage text,
organization_status varchar(64) NOT NULL DEFAULT 'NEW', organization_status varchar(64) NOT NULL DEFAULT 'NEW',
is_member tinyint(1) NOT NULL DEFAULT '0'
ability_point int8 NOT NULL DEFAULT '0', ability_point int8 NOT NULL DEFAULT '0',
service_point int8 NOT NULL DEFAULT '0', service_point int8 NOT NULL DEFAULT '0',
delete_flg tinyint(1) NOT NULL DEFAULT '0' delete_flg tinyint(1) NOT NULL DEFAULT '0'
...@@ -453,19 +454,21 @@ CREATE TABLE IF NOT EXISTS certificate_mst( ...@@ -453,19 +454,21 @@ CREATE TABLE IF NOT EXISTS certificate_mst(
Create INDEX certificate_mst_id_idx ON certificate_mst(id); Create INDEX certificate_mst_id_idx ON certificate_mst(id);
##----user_point_log create ##----user_pay_log create
DROP TABLE IF EXISTS user_point_log; DROP TABLE IF EXISTS user_pay_log;
CREATE TABLE IF NOT EXISTS user_point_log( CREATE TABLE IF NOT EXISTS user_pay_log(
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,
user_id int8 NOT NULL PRIMARY KEY auto_increment, user_id int8 NOT NULL,
action_type int4 NOT NULL, user_name varchar(64) NOT NULL,
point int4 NOT NULL DEFAULT '0', action_type varchar(32) NOT NULL,
money float(5,2) NOT NULL DEFAULT '0',
delete_flg tinyint(1) NOT NULL DEFAULT '0' delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4; ) 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 ##----course_media_dat create
...@@ -475,12 +478,16 @@ CREATE TABLE IF NOT EXISTS course_media_dat( ...@@ -475,12 +478,16 @@ CREATE TABLE IF NOT EXISTS course_media_dat(
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,
course_id int8 NOT NULL DEFAULT '0', 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, title varchar(128) NOT NULL,
comment text NOT NULL,
tags text NOT NULL, tags text NOT NULL,
front_image text NOT NULL, front_image text NOT NULL,
media text NOT NULL, media text NOT NULL,
size int8 NOT NULL DEFAULT '0', size int8 NOT NULL DEFAULT '0',
teacher varchar(128), teacher varchar(128),
teacher_profile text,
is_free tinyint(1) NOT NULL DEFAULT '0', is_free tinyint(1) NOT NULL DEFAULT '0',
price float(5,2) NOT NULL DEFAULT '0', price float(5,2) NOT NULL DEFAULT '0',
view_count int8 NOT NULL DEFAULT '0', view_count int8 NOT NULL DEFAULT '0',
...@@ -527,6 +534,7 @@ CREATE TABLE IF NOT EXISTS course_mst( ...@@ -527,6 +534,7 @@ CREATE TABLE IF NOT EXISTS course_mst(
parent_category_id int8 NOT NULL, parent_category_id int8 NOT NULL,
sub_category_id int8 NOT NULL, sub_category_id int8 NOT NULL,
title varchar(128) NOT NULL, title varchar(128) NOT NULL,
comment text NOT NULL,
front_image text NOT NULL, front_image text NOT NULL,
teacher_name varchar(128) NOT NULL, teacher_name varchar(128) NOT NULL,
teacher_profile text, teacher_profile text,
......
1. 小程序开发者账号 1. 小程序开发者账号
...@@ -8,3 +8,4 @@ ...@@ -8,3 +8,4 @@
=== ===
WxPayConfig 支付配置 WxPayConfig 支付配置
一张首页的顶部banner图片
...@@ -9,12 +9,16 @@ ...@@ -9,12 +9,16 @@
class CourseMediaDat extends CompassDynamicData class CourseMediaDat extends CompassDynamicData
{ {
var $course_id; var $course_id;
var $parent_category_id;
var $sub_category_id;
var $title; var $title;
var $comment;
var $tags; var $tags;
var $front_image; var $front_image;
var $media; var $media;
var $size; var $size;
var $teacher; var $teacher;
var $teacher_profile;
var $is_free; var $is_free;
var $price; var $price;
var $view_count; var $view_count;
...@@ -35,11 +39,13 @@ class CourseMediaDat extends CompassDynamicData ...@@ -35,11 +39,13 @@ class CourseMediaDat extends CompassDynamicData
$this->course_id = $record["course_id"]; $this->course_id = $record["course_id"];
$this->title = $record["title"]; $this->title = $record["title"];
$this->comment = $record["comment"];
$this->tags = $record["tags"]; $this->tags = $record["tags"];
$this->front_image = $record["front_image"]; $this->front_image = $record["front_image"];
$this->media = $record["media"]; $this->media = $record["media"];
$this->size = $record["size"]; $this->size = $record["size"];
$this->teacher = $record["teacher"]; $this->teacher = $record["teacher"];
$this->teacher_profile = $record["teacher_profile"];
$this->is_free = $record["is_free"]; $this->is_free = $record["is_free"];
$this->price = $record["price"]; $this->price = $record["price"];
$this->view_count = $record["view_count"]; $this->view_count = $record["view_count"];
...@@ -108,12 +114,16 @@ class CourseMediaDat extends CompassDynamicData ...@@ -108,12 +114,16 @@ class CourseMediaDat extends CompassDynamicData
$v_param = array(); $v_param = array();
ParamUtil::copyObj2Array($v_param, $this, "course_id"); 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, "title");
ParamUtil::copyObj2Array($v_param, $this, "comment");
ParamUtil::copyObj2Array($v_param, $this, "tags"); ParamUtil::copyObj2Array($v_param, $this, "tags");
ParamUtil::copyObj2Array($v_param, $this, "front_image"); ParamUtil::copyObj2Array($v_param, $this, "front_image");
ParamUtil::copyObj2Array($v_param, $this, "media"); ParamUtil::copyObj2Array($v_param, $this, "media");
ParamUtil::copyObj2Array($v_param, $this, "size"); ParamUtil::copyObj2Array($v_param, $this, "size");
ParamUtil::copyObj2ArrayNullField($v_param, $this, "teacher"); 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, "is_free");
ParamUtil::copyObj2Array($v_param, $this, "price"); ParamUtil::copyObj2Array($v_param, $this, "price");
ParamUtil::copyObj2Array($v_param, $this, "view_count"); ParamUtil::copyObj2Array($v_param, $this, "view_count");
......
...@@ -11,6 +11,7 @@ class CourseMst extends CompassDynamicData ...@@ -11,6 +11,7 @@ class CourseMst extends CompassDynamicData
var $parent_category_id; var $parent_category_id;
var $sub_category_id; var $sub_category_id;
var $title; var $title;
var $comment;
var $front_image; var $front_image;
var $teacher_name; var $teacher_name;
var $teacher_profile; var $teacher_profile;
...@@ -30,6 +31,7 @@ class CourseMst extends CompassDynamicData ...@@ -30,6 +31,7 @@ class CourseMst extends CompassDynamicData
$this->parent_category_id = $record["parent_category_id"]; $this->parent_category_id = $record["parent_category_id"];
$this->sub_category_id = $record["sub_category_id"]; $this->sub_category_id = $record["sub_category_id"];
$this->title = $record["title"]; $this->title = $record["title"];
$this->comment = $record["comment"];
$this->front_image = $record["front_image"]; $this->front_image = $record["front_image"];
$this->teacher_name = $record["teacher_name"]; $this->teacher_name = $record["teacher_name"];
$this->teacher_profile = $record["teacher_profile"]; $this->teacher_profile = $record["teacher_profile"];
...@@ -101,6 +103,7 @@ class CourseMst extends CompassDynamicData ...@@ -101,6 +103,7 @@ class CourseMst extends CompassDynamicData
ParamUtil::copyObj2Array($v_param, $this, "parent_category_id"); ParamUtil::copyObj2Array($v_param, $this, "parent_category_id");
ParamUtil::copyObj2Array($v_param, $this, "sub_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, "comment");
ParamUtil::copyObj2Array($v_param, $this, "front_image"); ParamUtil::copyObj2Array($v_param, $this, "front_image");
ParamUtil::copyObj2Array($v_param, $this, "teacher_name"); ParamUtil::copyObj2Array($v_param, $this, "teacher_name");
ParamUtil::copyObj2ArrayNullField($v_param, $this, "teacher_profile"); ParamUtil::copyObj2ArrayNullField($v_param, $this, "teacher_profile");
......
...@@ -37,6 +37,7 @@ class UserMst extends CompassDynamicData ...@@ -37,6 +37,7 @@ class UserMst extends CompassDynamicData
var $licensen_imgage; var $licensen_imgage;
var $other_imgage; var $other_imgage;
var $organization_status; var $organization_status;
var $is_member;
var $ability_point; var $ability_point;
var $service_point; var $service_point;
var $delete_flg; var $delete_flg;
...@@ -80,6 +81,7 @@ class UserMst extends CompassDynamicData ...@@ -80,6 +81,7 @@ class UserMst extends CompassDynamicData
$this->licensen_imgage = $record["licensen_imgage"]; $this->licensen_imgage = $record["licensen_imgage"];
$this->other_imgage = $record["other_imgage"]; $this->other_imgage = $record["other_imgage"];
$this->organization_status = $record["organization_status"]; $this->organization_status = $record["organization_status"];
$this->is_member = $record["is_member"];
$this->ability_point = $record["ability_point"]; $this->ability_point = $record["ability_point"];
$this->service_point = $record["service_point"]; $this->service_point = $record["service_point"];
$this->delete_flg = $record["delete_flg"]; $this->delete_flg = $record["delete_flg"];
...@@ -175,6 +177,7 @@ class UserMst extends CompassDynamicData ...@@ -175,6 +177,7 @@ class UserMst extends CompassDynamicData
ParamUtil::copyObj2ArrayNullField($v_param, $this, "licensen_imgage"); ParamUtil::copyObj2ArrayNullField($v_param, $this, "licensen_imgage");
ParamUtil::copyObj2ArrayNullField($v_param, $this, "other_imgage"); ParamUtil::copyObj2ArrayNullField($v_param, $this, "other_imgage");
ParamUtil::copyObj2Array($v_param, $this, "organization_status"); 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, "ability_point");
ParamUtil::copyObj2Array($v_param, $this, "service_point"); ParamUtil::copyObj2Array($v_param, $this, "service_point");
ParamUtil::copyObj2Array($v_param, $this, "delete_flg"); ParamUtil::copyObj2Array($v_param, $this, "delete_flg");
......
<?php <?php
/** /**
* UserPointLog Entity * UserPayLog Entity
* $Id: UserPointLog.inc,v 1.1 2020/2/27 14:40:01 Exp $ * $Id: UserPayLog.inc,v 1.1 2020/2/27 14:40:01 Exp $
* @author zb * @author zb
* @package jp.compass.entity * @package jp.compass.entity
* @access public * @access public
*/ */
class UserPointLog extends CompassDynamicData class UserPayLog extends CompassDynamicData
{ {
var $user_id; var $user_id;
var $user_name;
var $action_type; var $action_type;
var $point; var $money;
var $delete_flg; var $delete_flg;
/** /**
* 构造实现。user_point_log创建实例。 * 构造实现。user_pay_log创建实例。
* *
* @access public * @access public
* @param mixed user_point_log * @param mixed user_pay_log
*/ */
function constructor($record) function constructor($record)
{ {
parent::constructor($record); parent::constructor($record);
$this->user_id = $record["user_id"]; $this->user_id = $record["user_id"];
$this->user_name = $record["user_name"];
$this->action_type = $record["action_type"]; $this->action_type = $record["action_type"];
$this->point = $record["point"]; $this->money = $record["money"];
$this->delete_flg = $record["delete_flg"]; $this->delete_flg = $record["delete_flg"];
} }
...@@ -44,7 +46,7 @@ class UserPointLog extends CompassDynamicData ...@@ -44,7 +46,7 @@ class UserPointLog extends CompassDynamicData
$w_param["delete_flg"] = "false"; $w_param["delete_flg"] = "false";
} }
return CompassDBHandler::getList("UserPointLog", "user_point_log", $w_param, $orderkey, $direction, $offset, $limit); return CompassDBHandler::getList("UserPayLog", "user_pay_log", $w_param, $orderkey, $direction, $offset, $limit);
} }
/** /**
...@@ -62,7 +64,7 @@ class UserPointLog extends CompassDynamicData ...@@ -62,7 +64,7 @@ class UserPointLog extends CompassDynamicData
$w_param["delete_flg"] = "false"; $w_param["delete_flg"] = "false";
} }
$db = CompassDBManager::getInstance(); $db = CompassDBManager::getInstance();
$result = $db->doSelect("user_point_log", $w_param, null, null, null, null, "count(*) as count"); $result = $db->doSelect("user_pay_log", $w_param, null, null, null, null, "count(*) as count");
return $result[0]["count"]; return $result[0]["count"];
} }
...@@ -76,7 +78,7 @@ class UserPointLog extends CompassDynamicData ...@@ -76,7 +78,7 @@ class UserPointLog extends CompassDynamicData
$param = array(); $param = array();
$param["delete_flg"] = false; $param["delete_flg"] = false;
return CompassDBHandler::getById("UserPointLog", "user_point_log", $id, $param); return CompassDBHandler::getById("UserPayLog", "user_pay_log", $id, $param);
} }
// -- 这里开始Dynamic --- // -- 这里开始Dynamic ---
...@@ -91,11 +93,12 @@ class UserPointLog extends CompassDynamicData ...@@ -91,11 +93,12 @@ class UserPointLog extends CompassDynamicData
$v_param = array(); $v_param = array();
ParamUtil::copyObj2Array($v_param, $this, "user_id"); 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, "action_type");
ParamUtil::copyObj2Array($v_param, $this, "point"); ParamUtil::copyObj2Array($v_param, $this, "money");
ParamUtil::copyObj2Array($v_param, $this, "delete_flg"); ParamUtil::copyObj2Array($v_param, $this, "delete_flg");
// 保存 // 保存
parent::_save("user_point_log", $v_param); parent::_save("user_pay_log", $v_param);
} }
} }
\ No newline at end of file
...@@ -26,7 +26,7 @@ class CourseParentCategory ...@@ -26,7 +26,7 @@ class CourseParentCategory
$data = array(); $data = array();
$tmp = array("id"=>1, "title"=>"科学课堂"); $tmp = array("id"=>1, "title"=>"学科课堂");
array_push($data, $tmp); array_push($data, $tmp);
$tmp = array("id"=>2, "title"=>"专题课堂"); $tmp = array("id"=>2, "title"=>"专题课堂");
......
...@@ -29,7 +29,7 @@ require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/UserAccessDat.inc"); ...@@ -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/UserCommentDat.inc");
require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/UserFavoriteDat.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/UserMst.inc");
require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/UserPointLog.inc"); require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/UserPayLog.inc");
require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/MediaTagDat.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/UserMediaDat.inc");
require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/SystemConstDat.inc"); require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/SystemConstDat.inc");
......
...@@ -42,16 +42,17 @@ $offset = $page * $rowCount; ...@@ -42,16 +42,17 @@ $offset = $page * $rowCount;
$param = array(); $param = array();
//$param['province'] = $province; $param['province'] = $province;
if(!empty($city)) { if(!empty($city)) {
// $param['city'] = $city; $param['city'] = $city;
} }
if(!empty($district)) { if(!empty($district)) {
// $param['district'] = $district; $param['district'] = $district;
} }
$param['delete_flg'] = false; $param['delete_flg'] = false;
$schoolList = SchoolMst::getList($param, 'province', 'asc, city asc, district asc', $offset, $rowCount); $schoolList = SchoolMst::getList($param, 'province', 'asc, city asc, district asc', $offset, $rowCount);
$schoolCount = SchoolMst::getListCount($param); $schoolCount = SchoolMst::getListCount($param);
$pageCount = ceil($schoolCount/$rowCount);
//能力分汇总 //能力分汇总
$abilityPoint = 0; $abilityPoint = 0;
...@@ -72,8 +73,8 @@ if(!empty($tmp)) { ...@@ -72,8 +73,8 @@ if(!empty($tmp)) {
//接口返回数据 //接口返回数据
$result["page"] = $page; $result["page"] = $page;
$result["rowCount"] = $rowCount; $result["rowCount"] = $rowCount;
$result["pageCount"] = $pageCount;
$result["schoolList"] = $schoolList; $result["schoolList"] = $schoolList;
$result["schoolCount"] = $schoolCount;
$result["abilityPoint"] = $abilityPoint; $result["abilityPoint"] = $abilityPoint;
ErrorLogger::doOutput("Compass...ajax_get_certificates.php....End.", 0); ErrorLogger::doOutput("Compass...ajax_get_certificates.php....End.", 0);
......
...@@ -22,14 +22,15 @@ $param = array(); ...@@ -22,14 +22,15 @@ $param = array();
$param['parent_category_id'] = $parentId; $param['parent_category_id'] = $parentId;
$param['sub_category_id'] = $subId; $param['sub_category_id'] = $subId;
$param['delete_flg'] = false; $param['delete_flg'] = false;
$courseList = CourseMst::getList($param,'id','desc', $offset, $rowCount); $mediaList = CourseMediaDat::getList($param,'id','desc', $offset, $rowCount);
$allCount = CourseMst::getListCount($param); $allCount = CourseMediaDat::getListCount($param);
$pageCount = ceil($allCount/$rowCount);
//接口返回数据 //接口返回数据
$result["allCount"] = $allCount;
$result["page"] = $page;
$result["rowCount"] = $rowCount; $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); ErrorLogger::doOutput("Compass...ajax_get_course_by_category.php....End.", 0);
......
...@@ -11,11 +11,10 @@ $parentCategorys = CourseParentCategory::getList(); ...@@ -11,11 +11,10 @@ $parentCategorys = CourseParentCategory::getList();
$result = array(); $result = array();
//获取对应的二级分类 //获取对应的二级分类
foreach($parentCategorys as $parentCategory) { foreach($parentCategorys as $parentCategory) {
//检索数据库 //检索数据库
$param['parent_id'] = $parentCategory->id; $param['parent_id'] = $parentCategory->id;
$param['delete_flg'] = false; $param['delete_flg'] = false;
$subCategoryList = CourseCategoryDat::getList($param,'id','desc', 0, 1); $subCategoryList = CourseCategoryDat::getList($param,'id','desc');
$parentCategory->subCategorys = $subCategoryList; $parentCategory->subCategorys = $subCategoryList;
$result[] = $parentCategory; $result[] = $parentCategory;
} }
......
...@@ -7,11 +7,10 @@ ErrorLogger::doOutput("Compass...ajax_get_course_detail.php....Start.", 0); ...@@ -7,11 +7,10 @@ ErrorLogger::doOutput("Compass...ajax_get_course_detail.php....Start.", 0);
//获取参数 //获取参数
$unionId = ParamUtil::getRequestString("unionId"); $unionId = ParamUtil::getRequestString("unionId");
$courseId = ParamUtil::getRequestNumber("courseId", 0); $mediaId = ParamUtil::getRequestNumber("mediaId", 0);
//参数检查 //参数检查
if(empty($unionId) || empty($courseId)) { if(empty($unionId) || empty($mediaId)) {
$result["message"] = "参数错误!"; $result["message"] = "参数错误!";
responseNG($result); responseNG($result);
} }
...@@ -28,22 +27,44 @@ if(empty($userList)) { ...@@ -28,22 +27,44 @@ if(empty($userList)) {
$userMst = $userList[0]; $userMst = $userList[0];
//判断用户的观看权限
$result = array(); $result = array();
//每页显示条数 //判断视频是否存在
$courseMst = CourseMst::getById($courseId); $courseMediaDat = CourseMediaDat::getById($mediaId);
if(empty($courseMst)) { if(empty($courseMediaDat)) {
$result["message"] = "参数错误!"; $result["message"] = "视频不存在!";
responseNG($result); responseNG($result);
} }
//获取对应的媒体列表 //如果为合集视频获取对应的媒体列表
$courseTitle = "";
$teacherName = "";
$teacherProfile = "";
$frontImage = "";
$courseMediaList = array(); $courseMediaList = array();
$param = array(); //单个视频
$param['course_id'] = $courseId; if($courseMediaDat->course_id == 0) {
$param['delete_flg'] = false; $courseMediaList[] = $courseMediaDat;
$tmpList = CourseMediaDat::getList($param,'id','asc'); $courseTitle = $courseMediaDat->title;
if(!empty($tmpList)) { $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) { foreach($tmpList as $tmp) {
$tmp->haveBuy = false; $tmp->haveBuy = false;
if(!$tmp->is_free) { if(!$tmp->is_free) {
...@@ -59,18 +80,19 @@ if(!empty($tmpList)) { ...@@ -59,18 +80,19 @@ if(!empty($tmpList)) {
if(!empty($userBuyList)) { if(!empty($userBuyList)) {
$tmp->haveBuy = true; $tmp->haveBuy = true;
} }
} }
$courseMediaList[] = $tmp; $courseMediaList[] = $tmp;
} }
}
} }
//接口返回数据 //接口返回数据
$result["teacherName"] = $courseMst->teacher_name; $result["courseTitle"] = $courseTitle;
$result["teacherProfile"] = $courseMst->teacher_profile; $result["teacherName"] = $teacherName;
$result["mediaCount"] = $courseMst->media_count; $result["teacherProfile"] = $teacherProfile;
$result["list"] = $courseMediaList; $result["frontImage"] = $teacherProfile;
$result["mediaCount"] = count($courseMediaList);
$result["mediaList"] = $courseMediaList;
ErrorLogger::doOutput("Compass...ajax_get_course_detail.php....End.", 0); ErrorLogger::doOutput("Compass...ajax_get_course_detail.php....End.", 0);
......
...@@ -54,7 +54,7 @@ $volunteerEventList = VolunteerEventDat::getList($param,'id','desc', 0, 1); ...@@ -54,7 +54,7 @@ $volunteerEventList = VolunteerEventDat::getList($param,'id','desc', 0, 1);
//亲子活动 //亲子活动
if($userMst->role == 1) { if($userMst->role == 1) {
//亲子活动 //本校亲子活动
$param = array(); $param = array();
$param['school_no'] = $userMst->school_no; $param['school_no'] = $userMst->school_no;
$param['original_source'] = $userMst->school_no; $param['original_source'] = $userMst->school_no;
...@@ -71,6 +71,23 @@ if($userMst->role == 2) { ...@@ -71,6 +71,23 @@ if($userMst->role == 2) {
$socialEventList = SocialEventDat::getList($param,'id','desc', 0, 1); $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(); $param = array();
......
...@@ -15,7 +15,7 @@ $result = array(); ...@@ -15,7 +15,7 @@ $result = array();
//参数检查 //参数检查
if(empty($unionId)) { if(empty($unionId)) {
$result["message"] = "参数错误!"; $result["message"] = "参数错误!";
responseNG($result); responseNG1($result);
} }
//判断用户是否存在 //判断用户是否存在
...@@ -24,14 +24,16 @@ $param['unionid'] = $unionId; ...@@ -24,14 +24,16 @@ $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"] = "未注册用户!";
responseNG($result); responseNG2($result);
} }
$userMst = $userList[0]; $userMst = $userList[0];
//接口返回数据 //接口返回数据
$result["role"] = $userMst->role; $result["role"] = $userMst->role;
$result["isMember"] = $userMst->is_member;
$result["childAge"] = $userMst->child_age;
$result["schoolOwner"] = $userMst->school_owner; $result["schoolOwner"] = $userMst->school_owner;
$result["classOwner"] = $userMst->class_owner; $result["classOwner"] = $userMst->class_owner;
$result["governmentId"] = $userMst->government_id; $result["governmentId"] = $userMst->government_id;
...@@ -43,13 +45,15 @@ $lbsUrl = 'https://apis.map.qq.com/ws/geocoder/v1?key=' . LBS_KEY . '&location=' ...@@ -43,13 +45,15 @@ $lbsUrl = 'https://apis.map.qq.com/ws/geocoder/v1?key=' . LBS_KEY . '&location='
$lbsObj = file_get_contents($lbsUrl); $lbsObj = file_get_contents($lbsUrl);
$jsonObj = json_decode($lbsObj); //对JSON格式的字符串进行编码 $jsonObj = json_decode($lbsObj); //对JSON格式的字符串进行编码
$lbsArray = get_object_vars($jsonObj);//转换成数组 $lbsArray = get_object_vars($jsonObj);//转换成数组
$resultObj = $lbsArray['result']; if(isset($lbsArray['result'])) {
//地理位置获取正常的情况下设定。 156:中国代码 $resultObj = $lbsArray['result'];
if($lbsArray['status'] == "0" && $resultObj->ad_info->nation_code==156) { //地理位置获取正常的情况下设定。 156:中国代码
if($lbsArray['status'] == "0" && $resultObj->ad_info->nation_code==156) {
//保存到用户当前地理位置中 //保存到用户当前地理位置中
$result["province"] = $resultObj->address_component->province; $result["province"] = $resultObj->address_component->province;
$result["city"] = $resultObj->address_component->city; $result["city"] = $resultObj->address_component->city;
$result["district"] = $resultObj->address_component->district; $result["district"] = $resultObj->address_component->district;
}
} }
ErrorLogger::doOutput("Compass...ajax_get_user_role.php....End.", 0); ErrorLogger::doOutput("Compass...ajax_get_user_role.php....End.", 0);
...@@ -57,11 +61,16 @@ 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); responseOK($result);
function responseNG($result) { function responseNG1($result) {
$result = array("status"=>"NG", "result"=>$result); $result = array("status"=>"NG", "result"=>$result);
print json_encode($result); print json_encode($result);
exit; exit;
} }
function responseNG2($result) {
$result = array("status"=>"REGIST", "result"=>$result);
print json_encode($result);
exit;
}
function responseOK($result) { function responseOK($result) {
$result = array("status"=>"OK", "result"=>$result); $result = array("status"=>"OK", "result"=>$result);
print json_encode($result); print json_encode($result);
......
<?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
...@@ -54,7 +54,7 @@ if($circleDat->need_check) { ...@@ -54,7 +54,7 @@ if($circleDat->need_check) {
$userMessageDat = new UserMessageDat(); $userMessageDat = new UserMessageDat();
$userMessageDat->user_id = $circleDat->owner_id; $userMessageDat->user_id = $circleDat->owner_id;
$userMessageDat->title = "您的圈子有一条加入申请"; $userMessageDat->title = "您的圈子有一条加入申请";
$userMessageDat->comment = "嘀嘀嘀!有个好友申请加入您的圈子!"; $userMessageDat->comment = "嘀嘀嘀!" . $userMst->name . "申请加入您的圈子!";
//添加附件附件 //添加附件附件
$userMessageDat->attach_dat_type = "CIRCLE"; $userMessageDat->attach_dat_type = "CIRCLE";
......
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