mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-23 20:00:27 +08:00
v1.5.1 beta
This commit is contained in:
parent
d697a7bf97
commit
4345bdeb26
@ -1,5 +1,14 @@
|
|||||||
### [v1.5.1](https://gitee.com/koogua/course-tencent-cloud/releases/v1.5.1)(2022-03-17)
|
### [v1.5.1](https://gitee.com/koogua/course-tencent-cloud/releases/v1.5.1)(2022-03-17)
|
||||||
|
|
||||||
|
- 推荐课程等列表补充属性
|
||||||
|
- 修正后台评价列表中的搜索链接
|
||||||
|
- 修正后台点播设置视频码率后500错误问题
|
||||||
|
- 修正多码率远程播放地址部分为空播放问题
|
||||||
|
- 修正更新套餐课程缓存传参数据类型问题
|
||||||
|
- 修正第三方登录解除绑定失败问题
|
||||||
|
- 使用ServiceTrait归纳获取服务代码
|
||||||
|
- 优化anonymous隐藏部分字符函数
|
||||||
|
- 去除js_vars中关于IM客服的配置
|
||||||
- 增加验证码开关
|
- 增加验证码开关
|
||||||
|
|
||||||
### [v1.5.0](https://gitee.com/koogua/course-tencent-cloud/releases/v1.5.0)(2022-02-17)
|
### [v1.5.0](https://gitee.com/koogua/course-tencent-cloud/releases/v1.5.0)(2022-02-17)
|
||||||
|
@ -57,12 +57,15 @@ class CourseRecommendedList extends Cache
|
|||||||
'id' => $course->id,
|
'id' => $course->id,
|
||||||
'title' => $course->title,
|
'title' => $course->title,
|
||||||
'cover' => $course->cover,
|
'cover' => $course->cover,
|
||||||
'market_price' => $course->market_price,
|
|
||||||
'vip_price' => $course->vip_price,
|
|
||||||
'model' => $course->model,
|
'model' => $course->model,
|
||||||
'level' => $course->level,
|
'level' => $course->level,
|
||||||
|
'rating' => round($course->rating, 1),
|
||||||
|
'market_price' => (float)$course->market_price,
|
||||||
|
'vip_price' => (float)$course->vip_price,
|
||||||
'user_count' => $userCount,
|
'user_count' => $userCount,
|
||||||
'lesson_count' => $course->lesson_count,
|
'lesson_count' => $course->lesson_count,
|
||||||
|
'review_count' => $course->review_count,
|
||||||
|
'favorite_count' => $course->favorite_count,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,12 +58,15 @@ class CourseRelatedList extends Cache
|
|||||||
'id' => $course->id,
|
'id' => $course->id,
|
||||||
'title' => $course->title,
|
'title' => $course->title,
|
||||||
'cover' => $course->cover,
|
'cover' => $course->cover,
|
||||||
'market_price' => $course->market_price,
|
|
||||||
'vip_price' => $course->vip_price,
|
|
||||||
'model' => $course->model,
|
'model' => $course->model,
|
||||||
'level' => $course->level,
|
'level' => $course->level,
|
||||||
|
'rating' => round($course->rating, 1),
|
||||||
|
'market_price' => (float)$course->market_price,
|
||||||
|
'vip_price' => (float)$course->vip_price,
|
||||||
'user_count' => $userCount,
|
'user_count' => $userCount,
|
||||||
'lesson_count' => $course->lesson_count,
|
'lesson_count' => $course->lesson_count,
|
||||||
|
'review_count' => $course->review_count,
|
||||||
|
'favorite_count' => $course->favorite_count,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,12 +76,15 @@ class IndexFeaturedCourseList extends Cache
|
|||||||
'id' => $course->id,
|
'id' => $course->id,
|
||||||
'title' => $course->title,
|
'title' => $course->title,
|
||||||
'cover' => $course->cover,
|
'cover' => $course->cover,
|
||||||
'market_price' => $course->market_price,
|
|
||||||
'vip_price' => $course->vip_price,
|
|
||||||
'model' => $course->model,
|
'model' => $course->model,
|
||||||
'level' => $course->level,
|
'level' => $course->level,
|
||||||
|
'rating' => round($course->rating, 1),
|
||||||
|
'market_price' => (float)$course->market_price,
|
||||||
|
'vip_price' => (float)$course->vip_price,
|
||||||
'user_count' => $userCount,
|
'user_count' => $userCount,
|
||||||
'lesson_count' => $course->lesson_count,
|
'lesson_count' => $course->lesson_count,
|
||||||
|
'review_count' => $course->review_count,
|
||||||
|
'favorite_count' => $course->favorite_count,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,12 +76,15 @@ class IndexFreeCourseList extends Cache
|
|||||||
'id' => $course->id,
|
'id' => $course->id,
|
||||||
'title' => $course->title,
|
'title' => $course->title,
|
||||||
'cover' => $course->cover,
|
'cover' => $course->cover,
|
||||||
'market_price' => $course->market_price,
|
|
||||||
'vip_price' => $course->vip_price,
|
|
||||||
'model' => $course->model,
|
'model' => $course->model,
|
||||||
'level' => $course->level,
|
'level' => $course->level,
|
||||||
|
'rating' => round($course->rating, 1),
|
||||||
|
'market_price' => (float)$course->market_price,
|
||||||
|
'vip_price' => (float)$course->vip_price,
|
||||||
'user_count' => $userCount,
|
'user_count' => $userCount,
|
||||||
'lesson_count' => $course->lesson_count,
|
'lesson_count' => $course->lesson_count,
|
||||||
|
'review_count' => $course->review_count,
|
||||||
|
'favorite_count' => $course->favorite_count,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,12 +76,15 @@ class IndexNewCourseList extends Cache
|
|||||||
'id' => $course->id,
|
'id' => $course->id,
|
||||||
'title' => $course->title,
|
'title' => $course->title,
|
||||||
'cover' => $course->cover,
|
'cover' => $course->cover,
|
||||||
'market_price' => $course->market_price,
|
|
||||||
'vip_price' => $course->vip_price,
|
|
||||||
'model' => $course->model,
|
'model' => $course->model,
|
||||||
'level' => $course->level,
|
'level' => $course->level,
|
||||||
|
'rating' => round($course->rating, 1),
|
||||||
|
'market_price' => (float)$course->market_price,
|
||||||
|
'vip_price' => (float)$course->vip_price,
|
||||||
'user_count' => $userCount,
|
'user_count' => $userCount,
|
||||||
'lesson_count' => $course->lesson_count,
|
'lesson_count' => $course->lesson_count,
|
||||||
|
'review_count' => $course->review_count,
|
||||||
|
'favorite_count' => $course->favorite_count,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,12 +53,15 @@ class IndexSimpleFeaturedCourseList extends Cache
|
|||||||
'id' => $course->id,
|
'id' => $course->id,
|
||||||
'title' => $course->title,
|
'title' => $course->title,
|
||||||
'cover' => $course->cover,
|
'cover' => $course->cover,
|
||||||
'market_price' => $course->market_price,
|
|
||||||
'vip_price' => $course->vip_price,
|
|
||||||
'model' => $course->model,
|
'model' => $course->model,
|
||||||
'level' => $course->level,
|
'level' => $course->level,
|
||||||
|
'rating' => round($course->rating, 1),
|
||||||
|
'market_price' => (float)$course->market_price,
|
||||||
|
'vip_price' => (float)$course->vip_price,
|
||||||
'user_count' => $userCount,
|
'user_count' => $userCount,
|
||||||
'lesson_count' => $course->lesson_count,
|
'lesson_count' => $course->lesson_count,
|
||||||
|
'review_count' => $course->review_count,
|
||||||
|
'favorite_count' => $course->favorite_count,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,12 +53,15 @@ class IndexSimpleFreeCourseList extends Cache
|
|||||||
'id' => $course->id,
|
'id' => $course->id,
|
||||||
'title' => $course->title,
|
'title' => $course->title,
|
||||||
'cover' => $course->cover,
|
'cover' => $course->cover,
|
||||||
'market_price' => $course->market_price,
|
|
||||||
'vip_price' => $course->vip_price,
|
|
||||||
'model' => $course->model,
|
'model' => $course->model,
|
||||||
'level' => $course->level,
|
'level' => $course->level,
|
||||||
|
'rating' => round($course->rating, 1),
|
||||||
|
'market_price' => (float)$course->market_price,
|
||||||
|
'vip_price' => (float)$course->vip_price,
|
||||||
'user_count' => $userCount,
|
'user_count' => $userCount,
|
||||||
'lesson_count' => $course->lesson_count,
|
'lesson_count' => $course->lesson_count,
|
||||||
|
'review_count' => $course->review_count,
|
||||||
|
'favorite_count' => $course->favorite_count,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,12 +53,15 @@ class IndexSimpleNewCourseList extends Cache
|
|||||||
'id' => $course->id,
|
'id' => $course->id,
|
||||||
'title' => $course->title,
|
'title' => $course->title,
|
||||||
'cover' => $course->cover,
|
'cover' => $course->cover,
|
||||||
'market_price' => $course->market_price,
|
|
||||||
'vip_price' => $course->vip_price,
|
|
||||||
'model' => $course->model,
|
'model' => $course->model,
|
||||||
'level' => $course->level,
|
'level' => $course->level,
|
||||||
|
'rating' => round($course->rating, 1),
|
||||||
|
'market_price' => (float)$course->market_price,
|
||||||
|
'vip_price' => (float)$course->vip_price,
|
||||||
'user_count' => $userCount,
|
'user_count' => $userCount,
|
||||||
'lesson_count' => $course->lesson_count,
|
'lesson_count' => $course->lesson_count,
|
||||||
|
'review_count' => $course->review_count,
|
||||||
|
'favorite_count' => $course->favorite_count,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,12 +53,15 @@ class IndexSimpleVipCourseList extends Cache
|
|||||||
'id' => $course->id,
|
'id' => $course->id,
|
||||||
'title' => $course->title,
|
'title' => $course->title,
|
||||||
'cover' => $course->cover,
|
'cover' => $course->cover,
|
||||||
'market_price' => $course->market_price,
|
|
||||||
'vip_price' => $course->vip_price,
|
|
||||||
'model' => $course->model,
|
'model' => $course->model,
|
||||||
'level' => $course->level,
|
'level' => $course->level,
|
||||||
|
'rating' => round($course->rating, 1),
|
||||||
|
'market_price' => (float)$course->market_price,
|
||||||
|
'vip_price' => (float)$course->vip_price,
|
||||||
'user_count' => $userCount,
|
'user_count' => $userCount,
|
||||||
'lesson_count' => $course->lesson_count,
|
'lesson_count' => $course->lesson_count,
|
||||||
|
'review_count' => $course->review_count,
|
||||||
|
'favorite_count' => $course->favorite_count,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,12 +76,15 @@ class IndexVipCourseList extends Cache
|
|||||||
'id' => $course->id,
|
'id' => $course->id,
|
||||||
'title' => $course->title,
|
'title' => $course->title,
|
||||||
'cover' => $course->cover,
|
'cover' => $course->cover,
|
||||||
'market_price' => $course->market_price,
|
|
||||||
'vip_price' => $course->vip_price,
|
|
||||||
'model' => $course->model,
|
'model' => $course->model,
|
||||||
'level' => $course->level,
|
'level' => $course->level,
|
||||||
|
'rating' => round($course->rating, 1),
|
||||||
|
'market_price' => (float)$course->market_price,
|
||||||
|
'vip_price' => (float)$course->vip_price,
|
||||||
'user_count' => $userCount,
|
'user_count' => $userCount,
|
||||||
'lesson_count' => $course->lesson_count,
|
'lesson_count' => $course->lesson_count,
|
||||||
|
'review_count' => $course->review_count,
|
||||||
|
'favorite_count' => $course->favorite_count,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,13 +58,15 @@ class PackageCourseList extends Cache
|
|||||||
'id' => $course->id,
|
'id' => $course->id,
|
||||||
'title' => $course->title,
|
'title' => $course->title,
|
||||||
'cover' => $course->cover,
|
'cover' => $course->cover,
|
||||||
'origin_price' => $course->origin_price,
|
|
||||||
'market_price' => $course->market_price,
|
|
||||||
'vip_price' => $course->vip_price,
|
|
||||||
'model' => $course->model,
|
'model' => $course->model,
|
||||||
'level' => $course->level,
|
'level' => $course->level,
|
||||||
|
'rating' => round($course->rating, 1),
|
||||||
|
'market_price' => (float)$course->market_price,
|
||||||
|
'vip_price' => (float)$course->vip_price,
|
||||||
'user_count' => $userCount,
|
'user_count' => $userCount,
|
||||||
'lesson_count' => $course->lesson_count,
|
'lesson_count' => $course->lesson_count,
|
||||||
|
'review_count' => $course->review_count,
|
||||||
|
'favorite_count' => $course->favorite_count,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,46 +7,9 @@
|
|||||||
|
|
||||||
namespace App\Console\Tasks;
|
namespace App\Console\Tasks;
|
||||||
|
|
||||||
use App\Services\Service as AppService;
|
use App\Traits\Service as ServiceTrait;
|
||||||
|
|
||||||
|
|
||||||
class Task extends \Phalcon\Cli\Task
|
class Task extends \Phalcon\Cli\Task
|
||||||
{
|
{
|
||||||
|
use ServiceTrait;
|
||||||
public function getConfig()
|
|
||||||
{
|
|
||||||
$appService = new AppService();
|
|
||||||
|
|
||||||
return $appService->getConfig();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public function getCache()
|
|
||||||
{
|
|
||||||
$appService = new AppService();
|
|
||||||
|
|
||||||
return $appService->getCache();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getRedis()
|
|
||||||
{
|
|
||||||
$appService = new AppService();
|
|
||||||
|
|
||||||
return $appService->getRedis();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getLogger($channel = 'console')
|
|
||||||
{
|
|
||||||
$appService = new AppService();
|
|
||||||
|
|
||||||
return $appService->getLogger($channel);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getSettings($section)
|
|
||||||
{
|
|
||||||
$appService = new AppService();
|
|
||||||
|
|
||||||
return $appService->getSettings($section);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ class Package extends Service
|
|||||||
|
|
||||||
$package->create($data);
|
$package->create($data);
|
||||||
|
|
||||||
$this->rebuildPackageCache($package);
|
$this->rebuildPackageCache($package->id);
|
||||||
|
|
||||||
return $package;
|
return $package;
|
||||||
}
|
}
|
||||||
@ -151,9 +151,9 @@ class Package extends Service
|
|||||||
|
|
||||||
$package->update($data);
|
$package->update($data);
|
||||||
|
|
||||||
$this->handlePackagedCourses($package);
|
$this->handlePackagedCourses($package->id);
|
||||||
$this->updatePackageCourseCount($package);
|
$this->updatePackageCourseCount($package->id);
|
||||||
$this->rebuildPackageCache($package);
|
$this->rebuildPackageCache($package->id);
|
||||||
|
|
||||||
return $package;
|
return $package;
|
||||||
}
|
}
|
||||||
@ -166,8 +166,8 @@ class Package extends Service
|
|||||||
|
|
||||||
$package->update();
|
$package->update();
|
||||||
|
|
||||||
$this->handlePackagedCourses($package);
|
$this->handlePackagedCourses($package->id);
|
||||||
$this->rebuildPackageCache($package);
|
$this->rebuildPackageCache($package->id);
|
||||||
|
|
||||||
return $package;
|
return $package;
|
||||||
}
|
}
|
||||||
@ -180,8 +180,8 @@ class Package extends Service
|
|||||||
|
|
||||||
$package->update();
|
$package->update();
|
||||||
|
|
||||||
$this->handlePackagedCourses($package);
|
$this->handlePackagedCourses($package->id);
|
||||||
$this->rebuildPackageCache($package);
|
$this->rebuildPackageCache($package->id);
|
||||||
|
|
||||||
return $package;
|
return $package;
|
||||||
}
|
}
|
||||||
@ -228,25 +228,27 @@ class Package extends Service
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function handlePackagedCourses(PackageModel $package)
|
protected function handlePackagedCourses($packageId)
|
||||||
{
|
{
|
||||||
$packageRepo = new PackageRepo();
|
$packageRepo = new PackageRepo();
|
||||||
|
|
||||||
$courses = $packageRepo->findCourses($package->id);
|
$courses = $packageRepo->findCourses($packageId);
|
||||||
|
|
||||||
if ($courses->count() == 0) return;
|
if ($courses->count() == 0) return;
|
||||||
|
|
||||||
foreach ($courses as $course) {
|
foreach ($courses as $course) {
|
||||||
$this->rebuildCoursePackageCache($course);
|
$this->rebuildCoursePackageCache($course->id);
|
||||||
$this->recountCoursePackages($course);
|
$this->recountCoursePackages($course->id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function updatePackageCourseCount(PackageModel $package)
|
protected function updatePackageCourseCount($packageId)
|
||||||
{
|
{
|
||||||
$packageRepo = new PackageRepo();
|
$packageRepo = new PackageRepo();
|
||||||
|
|
||||||
$courseCount = $packageRepo->countCourses($package->id);
|
$package = $packageRepo->findById($packageId);
|
||||||
|
|
||||||
|
$courseCount = $packageRepo->countCourses($packageId);
|
||||||
|
|
||||||
$package->course_count = $courseCount;
|
$package->course_count = $courseCount;
|
||||||
|
|
||||||
@ -266,29 +268,31 @@ class Package extends Service
|
|||||||
$course->update();
|
$course->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function rebuildPackageCache(PackageModel $package)
|
protected function rebuildPackageCache($packageId)
|
||||||
{
|
{
|
||||||
$cache = new PackageCache();
|
$cache = new PackageCache();
|
||||||
|
|
||||||
$cache->rebuild($package->id);
|
$cache->rebuild($packageId);
|
||||||
|
|
||||||
$cache = new PackageCourseListCache();
|
$cache = new PackageCourseListCache();
|
||||||
|
|
||||||
$cache->rebuild($package->id);
|
$cache->rebuild($packageId);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function rebuildCoursePackageCache(CourseModel $course)
|
protected function rebuildCoursePackageCache($courseId)
|
||||||
{
|
{
|
||||||
$cache = new CoursePackageListCache();
|
$cache = new CoursePackageListCache();
|
||||||
|
|
||||||
$cache->rebuild($course->id);
|
$cache->rebuild($courseId);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function recountCoursePackages(CourseModel $course)
|
protected function recountCoursePackages($courseId)
|
||||||
{
|
{
|
||||||
$courseRepo = new CourseRepo();
|
$courseRepo = new CourseRepo();
|
||||||
|
|
||||||
$course->package_count = $courseRepo->countPackages($course->id);
|
$course = $courseRepo->findById($courseId);
|
||||||
|
|
||||||
|
$course->package_count = $courseRepo->countPackages($courseId);
|
||||||
|
|
||||||
$course->update();
|
$course->update();
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
{% set search_url = url({'for':'admin.consult.search'}) %}
|
{% set search_url = url({'for':'admin.review.search'}) %}
|
||||||
|
|
||||||
<div class="kg-nav">
|
<div class="kg-nav">
|
||||||
<div class="kg-nav-left">
|
<div class="kg-nav-left">
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
{{ partial('macros/review') }}
|
{{ partial('macros/review') }}
|
||||||
|
|
||||||
{% set search_url = url({'for':'admin.consult.search'}) %}
|
{% set search_url = url({'for':'admin.review.search'}) %}
|
||||||
|
|
||||||
<div class="kg-nav">
|
<div class="kg-nav">
|
||||||
<div class="kg-nav-left">
|
<div class="kg-nav-left">
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
{% set storage_region_display = vod.storage_type == 'fixed' ? 'display:block' : 'display:none' %}
|
{% set storage_region_display = vod.storage_type == 'fixed' ? 'display:block' : 'display:none' %}
|
||||||
{% set wmk_tpl_display = vod.wmk_enabled == 1 ? 'display:block' : 'display:none' %}
|
{% set wmk_tpl_display = vod.wmk_enabled == 1 ? 'display:block' : 'display:none' %}
|
||||||
{% set key_anti_display = vod.key_anti_enabled == 1 ? 'display:block': 'display:none' %}
|
{% set key_anti_display = vod.key_anti_enabled == 1 ? 'display:block': 'display:none' %}
|
||||||
{% set video_quality = vod.video_quality|json_decode %}
|
{% set video_quality = vod.video_quality|json_decode(true) %}
|
||||||
|
|
||||||
<form class="layui-form kg-form" method="POST" action="{{ url({'for':'admin.setting.vod'}) }}">
|
<form class="layui-form kg-form" method="POST" action="{{ url({'for':'admin.setting.vod'}) }}">
|
||||||
<fieldset class="layui-elem-field layui-field-title">
|
<fieldset class="layui-elem-field layui-field-title">
|
||||||
|
@ -70,7 +70,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% set show_sidebar_teachers = 1 %}
|
|
||||||
{% set show_sidebar_topics = 1 %}
|
{% set show_sidebar_topics = 1 %}
|
||||||
{% set show_sidebar_recommended = 1 %}
|
{% set show_sidebar_recommended = 1 %}
|
||||||
{% set show_sidebar_related = 1 %}
|
{% set show_sidebar_related = 1 %}
|
||||||
|
@ -13,8 +13,6 @@
|
|||||||
<div class="info">
|
<div class="info">
|
||||||
<p><a href="{{ course_url }}" target="_blank">{{ course.title }}</a></p>
|
<p><a href="{{ course_url }}" target="_blank">{{ course.title }}</a></p>
|
||||||
<p>
|
<p>
|
||||||
<span class="key">原始价格</span>
|
|
||||||
<span class="value origin-price">{{ '¥%0.2f'|format(course.origin_price) }}</span>
|
|
||||||
<span class="key">优惠价格</span>
|
<span class="key">优惠价格</span>
|
||||||
<span class="price">{{ '¥%0.2f'|format(course.market_price) }}</span>
|
<span class="price">{{ '¥%0.2f'|format(course.market_price) }}</span>
|
||||||
<span class="key">会员价格</span>
|
<span class="key">会员价格</span>
|
||||||
|
@ -29,9 +29,6 @@
|
|||||||
tool_video_enabled: '{{ im_info.main.tool_video_enabled }}',
|
tool_video_enabled: '{{ im_info.main.tool_video_enabled }}',
|
||||||
msg_max_length: '{{ im_info.main.msg_max_length }}',
|
msg_max_length: '{{ im_info.main.msg_max_length }}',
|
||||||
},
|
},
|
||||||
cs: {
|
|
||||||
enabled: '{{ im_info.cs.enabled }}'
|
|
||||||
},
|
|
||||||
ws: {
|
ws: {
|
||||||
connect_url: '{{ im_info.ws.connect_url }}',
|
connect_url: '{{ im_info.ws.connect_url }}',
|
||||||
ping_interval: '{{ im_info.ws.ping_interval }}'
|
ping_interval: '{{ im_info.ws.ping_interval }}'
|
||||||
|
@ -499,8 +499,8 @@ function kg_anonymous($str)
|
|||||||
$start = 3;
|
$start = 3;
|
||||||
$end = $length - 4;
|
$end = $length - 4;
|
||||||
} else {
|
} else {
|
||||||
$start = 1;
|
$start = ceil($length / 4);
|
||||||
$end = $length - 2;
|
$end = $length - $start - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$list = [];
|
$list = [];
|
||||||
|
@ -25,14 +25,18 @@ class Connect extends Repository
|
|||||||
|
|
||||||
$query->where('1 = 1');
|
$query->where('1 = 1');
|
||||||
|
|
||||||
if (isset($where['user_id'])) {
|
if (!empty($where['user_id'])) {
|
||||||
$query->andWhere('user_id = :user_id:', ['user_id' => $where['user_id']]);
|
$query->andWhere('user_id = :user_id:', ['user_id' => $where['user_id']]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($where['provider'])) {
|
if (!empty($where['provider'])) {
|
||||||
$query->andWhere('provider = :provider:', ['provider' => $where['provider']]);
|
$query->andWhere('provider = :provider:', ['provider' => $where['provider']]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($where['deleted'])) {
|
||||||
|
$query->andWhere('deleted = :deleted:', ['deleted' => $where['deleted']]);
|
||||||
|
}
|
||||||
|
|
||||||
$query->orderBy('id DESC');
|
$query->orderBy('id DESC');
|
||||||
|
|
||||||
return $query->execute();
|
return $query->execute();
|
||||||
|
@ -23,12 +23,19 @@ class ChapterVod extends Service
|
|||||||
* 腾讯云点播优先
|
* 腾讯云点播优先
|
||||||
*/
|
*/
|
||||||
if ($vod->file_id) {
|
if ($vod->file_id) {
|
||||||
$result = $this->getCosPlayUrls($chapterId);
|
$playUrls = $this->getCosPlayUrls($chapterId);
|
||||||
} else {
|
} else {
|
||||||
$result = $this->getRemotePlayUrls($chapterId);
|
$playUrls = $this->getRemotePlayUrls($chapterId);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
/**
|
||||||
|
*过滤播放地址为空的条目
|
||||||
|
*/
|
||||||
|
foreach ($playUrls as $key => $value) {
|
||||||
|
if (empty($value['url'])) unset($playUrls[$key]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $playUrls;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCosPlayUrls($chapterId)
|
public function getCosPlayUrls($chapterId)
|
||||||
|
@ -46,9 +46,9 @@ class BasicInfo extends LogicService
|
|||||||
'summary' => $course->summary,
|
'summary' => $course->summary,
|
||||||
'details' => $details,
|
'details' => $details,
|
||||||
'keywords' => $course->keywords,
|
'keywords' => $course->keywords,
|
||||||
'origin_price' => $course->origin_price,
|
'origin_price' => (float)$course->origin_price,
|
||||||
'market_price' => $course->market_price,
|
'market_price' => (float)$course->market_price,
|
||||||
'vip_price' => $course->vip_price,
|
'vip_price' => (float)$course->vip_price,
|
||||||
'study_expiry' => $course->study_expiry,
|
'study_expiry' => $course->study_expiry,
|
||||||
'refund_expiry' => $course->refund_expiry,
|
'refund_expiry' => $course->refund_expiry,
|
||||||
'teachers' => $teachers,
|
'teachers' => $teachers,
|
||||||
|
@ -82,11 +82,11 @@ class CourseList extends LogicService
|
|||||||
'id' => $course['id'],
|
'id' => $course['id'],
|
||||||
'title' => $course['title'],
|
'title' => $course['title'],
|
||||||
'cover' => $course['cover'],
|
'cover' => $course['cover'],
|
||||||
'market_price' => (float)$course['market_price'],
|
|
||||||
'vip_price' => (float)$course['vip_price'],
|
|
||||||
'rating' => round($course['rating'], 1),
|
|
||||||
'model' => $course['model'],
|
'model' => $course['model'],
|
||||||
'level' => $course['level'],
|
'level' => $course['level'],
|
||||||
|
'rating' => round($course['rating'], 1),
|
||||||
|
'market_price' => (float)$course['market_price'],
|
||||||
|
'vip_price' => (float)$course['vip_price'],
|
||||||
'user_count' => $course['user_count'],
|
'user_count' => $course['user_count'],
|
||||||
'lesson_count' => $course['lesson_count'],
|
'lesson_count' => $course['lesson_count'],
|
||||||
'review_count' => $course['review_count'],
|
'review_count' => $course['review_count'],
|
||||||
|
@ -43,7 +43,7 @@ class PackageList extends LogicService
|
|||||||
|
|
||||||
if ($courses) {
|
if ($courses) {
|
||||||
foreach ($courses as $course) {
|
foreach ($courses as $course) {
|
||||||
$package['origin_price'] += $course['origin_price'];
|
$package['origin_price'] += $course['market_price'];
|
||||||
}
|
}
|
||||||
$package['courses'] = $this->sortCourses($courses, $firstCourseId);
|
$package['courses'] = $this->sortCourses($courses, $firstCourseId);
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ class OrderConfirm extends LogicService
|
|||||||
|
|
||||||
$result['item_info']['course'] = $this->handleCourseInfo($course);
|
$result['item_info']['course'] = $this->handleCourseInfo($course);
|
||||||
|
|
||||||
$result['total_amount'] = $course->origin_price;
|
$result['total_amount'] = $course->market_price;
|
||||||
$result['pay_amount'] = $user->vip ? $course->vip_price : $course->market_price;
|
$result['pay_amount'] = $user->vip ? $course->vip_price : $course->market_price;
|
||||||
$result['discount_amount'] = $result['total_amount'] - $result['pay_amount'];
|
$result['discount_amount'] = $result['total_amount'] - $result['pay_amount'];
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ class OrderConfirm extends LogicService
|
|||||||
$result['total_amount'] = 0;
|
$result['total_amount'] = 0;
|
||||||
|
|
||||||
foreach ($result['item_info']['package']['courses'] as $course) {
|
foreach ($result['item_info']['package']['courses'] as $course) {
|
||||||
$result['total_amount'] += $course['origin_price'];
|
$result['total_amount'] += $course['market_price'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$result['pay_amount'] = $user->vip ? $package->vip_price : $package->market_price;
|
$result['pay_amount'] = $user->vip ? $package->vip_price : $package->market_price;
|
||||||
|
@ -23,7 +23,9 @@ class ConnectDelete extends LogicService
|
|||||||
|
|
||||||
$validator->checkOwner($user->id, $connect->user_id);
|
$validator->checkOwner($user->id, $connect->user_id);
|
||||||
|
|
||||||
$connect->delete();
|
$connect->deleted = 1;
|
||||||
|
|
||||||
|
$connect->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,8 @@ class UserInfo extends LogicService
|
|||||||
'comment_count' => $user->comment_count,
|
'comment_count' => $user->comment_count,
|
||||||
'friend_count' => $imUser->friend_count,
|
'friend_count' => $imUser->friend_count,
|
||||||
'group_count' => $imUser->group_count,
|
'group_count' => $imUser->group_count,
|
||||||
|
'vip_expiry_time' => $user->vip_expiry_time,
|
||||||
|
'lock_expiry_time' => $user->lock_expiry_time,
|
||||||
'active_time' => $user->active_time,
|
'active_time' => $user->active_time,
|
||||||
'create_time' => $user->create_time,
|
'create_time' => $user->create_time,
|
||||||
'update_time' => $user->update_time,
|
'update_time' => $user->update_time,
|
||||||
|
@ -7,69 +7,12 @@
|
|||||||
|
|
||||||
namespace App\Services;
|
namespace App\Services;
|
||||||
|
|
||||||
use App\Caches\Setting as SettingCache;
|
|
||||||
use App\Library\Cache\Backend\Redis as RedisCache;
|
|
||||||
use App\Library\Logger as AppLogger;
|
|
||||||
use App\Traits\Auth as AuthTrait;
|
use App\Traits\Auth as AuthTrait;
|
||||||
use Phalcon\Config as PhConfig;
|
use App\Traits\Service as ServiceTrait;
|
||||||
use Phalcon\Logger\Adapter\File as PhLogger;
|
|
||||||
use Phalcon\Mvc\User\Component;
|
use Phalcon\Mvc\User\Component;
|
||||||
|
|
||||||
class Service extends Component
|
class Service extends Component
|
||||||
{
|
{
|
||||||
|
|
||||||
use AuthTrait;
|
use AuthTrait;
|
||||||
|
use ServiceTrait;
|
||||||
/**
|
|
||||||
* @return PhConfig
|
|
||||||
*/
|
|
||||||
public function getConfig()
|
|
||||||
{
|
|
||||||
return $this->getDI()->getShared('config');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return RedisCache
|
|
||||||
*/
|
|
||||||
public function getCache()
|
|
||||||
{
|
|
||||||
return $this->getDI()->getShared('cache');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return \Redis
|
|
||||||
*/
|
|
||||||
public function getRedis()
|
|
||||||
{
|
|
||||||
return $this->getCache()->getRedis();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取Logger
|
|
||||||
*
|
|
||||||
* @param string $channel
|
|
||||||
* @return PhLogger
|
|
||||||
*/
|
|
||||||
public function getLogger($channel = null)
|
|
||||||
{
|
|
||||||
$logger = new AppLogger();
|
|
||||||
|
|
||||||
$channel = $channel ?: 'common';
|
|
||||||
|
|
||||||
return $logger->getInstance($channel);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取某组配置项
|
|
||||||
*
|
|
||||||
* @param string $section
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function getSettings($section)
|
|
||||||
{
|
|
||||||
$cache = new SettingCache();
|
|
||||||
|
|
||||||
return $cache->get($section);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
72
app/Traits/Service.php
Normal file
72
app/Traits/Service.php
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @copyright Copyright (c) 2021 深圳市酷瓜软件有限公司
|
||||||
|
* @license https://opensource.org/licenses/GPL-2.0
|
||||||
|
* @link https://www.koogua.com
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\Traits;
|
||||||
|
|
||||||
|
use App\Caches\Setting as SettingCache;
|
||||||
|
use App\Library\Cache\Backend\Redis as RedisCache;
|
||||||
|
use App\Library\Logger as AppLogger;
|
||||||
|
use Phalcon\Config as PhConfig;
|
||||||
|
use Phalcon\Di as Di;
|
||||||
|
use Phalcon\Logger\Adapter\File as PhLogger;
|
||||||
|
|
||||||
|
trait Service
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return PhConfig
|
||||||
|
*/
|
||||||
|
public function getConfig()
|
||||||
|
{
|
||||||
|
return Di::getDefault()->getShared('config');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return RedisCache
|
||||||
|
*/
|
||||||
|
public function getCache()
|
||||||
|
{
|
||||||
|
return Di::getDefault()->getShared('cache');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Redis
|
||||||
|
*/
|
||||||
|
public function getRedis()
|
||||||
|
{
|
||||||
|
return $this->getCache()->getRedis();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取Logger
|
||||||
|
*
|
||||||
|
* @param string $channel
|
||||||
|
* @return PhLogger
|
||||||
|
*/
|
||||||
|
public function getLogger($channel = null)
|
||||||
|
{
|
||||||
|
$logger = new AppLogger();
|
||||||
|
|
||||||
|
$channel = $channel ?: 'common';
|
||||||
|
|
||||||
|
return $logger->getInstance($channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取某组配置项
|
||||||
|
*
|
||||||
|
* @param string $section
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getSettings($section)
|
||||||
|
{
|
||||||
|
$cache = new SettingCache();
|
||||||
|
|
||||||
|
return $cache->get($section);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1505,6 +1505,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.cart-course-card .price {
|
.cart-course-card .price {
|
||||||
|
margin-right: 5px;
|
||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user