目前,许多行业已经开始向直播领域靠拢,例如直播带货、教育直播、娱乐直播等领域,想要在此分一杯羹,以在线教育系统来说,在2020年以后便进入了“白热化”,更多的直播、教育展现在大众视野中。在粉丝经济的时代,小编推荐有需求的教培机构着手转型在线教育,扩大自己的影响力。
随着技术的不断增强,在线教育系统所实现的功能更加多样,不仅具有师生互动形式、课堂练习、随堂测试、抢答、白板(相当于线下课堂的黑板)等,还原真实线下上课场景,而且还具有多种营销工具和变现形式,让教育培训机构以及企业共享知识付费带来的红利。
下文,小编为大家分析一下在线教育系统代码。
// ±---------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\model\CourseModel;
use app\admin\model\UsersModel;
use cmf\controller\AdminBaseController;
use think\Db;
protected function getStatus($k = ‘’)
{
$status = [
‘-2’ => ‘管理员下架’,
‘-1’ => ‘暂时下架’,
‘0’ => ‘审核中’,
‘1’ => ‘上架中’,
‘2’ => ‘定时上架’,
];
if ($k === ‘’) {
return $status;
}
return s t a t u s [ status[ status[k] ?? ‘’;
}
protected function getSort($k = ‘’)
{
s o r t = [ ′ 0 ′ = > ′ 内 容 ′ , ′ 1 ′ = > ′ 课 程 ′ , ′ 2 ′ = > ′ 直 播 ′ , ] ; i f ( sort = [ '0' => '内容', '1' => '课程', '2' => '直播', ]; if ( sort=[′0′=>′内容′,′1′=>′课程′,′2′=>′直播′,];if(k === ‘’) {
return $sort;
}
return s o r t [ sort[ sort[k] ?? ‘’;
}
protected function getTypes($k = ‘’)
{
t y p e = [ ′ 1 ′ = > ′ 图 文 ′ , ′ 2 ′ = > ′ 视 频 ′ , ′ 3 ′ = > ′ 音 频 ′ , ] ; i f ( type = [ '1' => '图文', '2' => '视频', '3' => '音频', ]; if ( type=[′1′=>′图文′,′2′=>′视频′,′3′=>′音频′,];if(k === ‘’) {
return $type;
}
return t y p e [ type[ type[k] ?? ‘’;
}
protected function getLiveTypes($k = ‘’)
{
t y p e = [ ′ 1 ′ = > ′ P P T ′ , ′ 2 ′ = > ′ 视 频 ′ , ′ 3 ′ = > ′ 音 频 ′ , ] ; i f ( type = [ '1' => 'PPT', '2' => '视频', '3' => '音频', ]; if ( type=[′1′=>′PPT′,′2′=>′视频′,′3′=>′音频′,];if(k === ‘’) {
return $type;
}
return t y p e [ type[ type[k] ?? ‘’;
}
protected function getPayTypes($k = ‘’)
{
p a y t y p e = [ ′ 0 ′ = > ′ 免 费 ′ , ′ 1 ′ = > ′ 收 费 ′ , ′ 2 ′ = > ′ 密 码 ′ , ] ; i f ( paytype = [ '0' => '免费', '1' => '收费', '2' => '密码', ]; if ( paytype=[′0′=>′免费′,′1′=>′收费′,′2′=>′密码′,];if(k === ‘’) {
return $paytype;
}
return p a y t y p e [ paytype[ paytype[k] ?? ‘’;
}
protected function getTrialTypes($k = ‘’)
{
t r i a l t y p e = [ ′ 0 ′ = > ′ 否 ′ , ′ 2 ′ = > ′ 进 度 ′ , ] ; i f ( trialtype = [ '0' => '否', '2' => '进度', ]; if ( trialtype=[′0′=>′否′,′2′=>′进度′,];if(k === ‘’) {
return $trialtype;
}
return t r i a l t y p e [ trialtype[ trialtype[k] ?? ‘’;
}
protected function getModes($k = ‘’)
{
m o d e = [ ′ 0 ′ = > ′ 自 由 ′ , ′ 1 ′ = > ′ 解 锁 ′ , ] ; i f ( mode = [ '0' => '自由', '1' => '解锁', ]; if ( mode=[′0′=>′自由′,′1′=>′解锁′,];if(k === ‘’) {
return $mode;
}
return m o d e [ mode[ mode[k] ?? ‘’;
}
/* 科目分类 /
protected function getClass()
{
$list = Db::name(‘course_class’)
->order(“list_order asc”)
->column('',‘id’);
return $list;
}
/**
-
学级分类
-
@return array
/
protected function getGrade()
{
$list = Db::name(‘course_grade’)
->order(“pid asc,list_order asc”)
->column('', ‘id’);
l i s t 2 = [ ] ; f o r e a c h ( list2 = []; foreach ( list2=[];foreach(list as $k => KaTeX parse error: Expected '}', got 'EOF' at end of input: v) { if (v[‘pid’] != 0) {
$name = l i s t [ list[ list[v[‘pid’]][‘name’] . ’ - ’ . $v[‘name’];
$v[‘name’] = $name;$list2[$k] = $v; }
}
return $list2;
}
/**
-
学级分类2 排序
-
@return array
/
protected function getGradeTwo()
{
$list = Db::name(‘course_grade’)
->order(“pid asc,list_order asc”)
->column('', ‘id’);
$list2 = [];foreach ($list as $k => KaTeX parse error: Expected '}', got 'EOF' at end of input: v) { if (v[‘pid’] == 0) {
foreach ($list as $k1 => KaTeX parse error: Expected '}', got 'EOF' at end of input: … if (v1[‘pid’] == $v[‘id’]) {
$name = $v[‘name’] . ’ - ’ . $v1[‘name’];
$v1[‘name’] = $name;$list2[] = $v1; unset($list[$k1]); } } unset($list[$k]); }
}
return $list2;
}
受限于篇幅问题,剩下的代码以后再为大家发布。作为专业的软件开发商,对教育市场充分调研,搭建出满足教育培训机构以及教育领域需求的在线教育系统。如果您对在线教育系统开发或者是相关项目感兴趣,请关注我!
来源地址:https://blog.csdn.net/vx17661296331/article/details/128305740