1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-07-17 13:46:21 +08:00

Merge branch 'develop' into demo

This commit is contained in:
xiaochong0302 2020-09-08 10:58:45 +08:00
commit 8a924009fa
58 changed files with 127 additions and 215 deletions

View File

@ -73,7 +73,7 @@ class ConsultList extends Builder
$users = $userRepo->findByIds($ids, ['id', 'name', 'avatar']); $users = $userRepo->findByIds($ids, ['id', 'name', 'avatar']);
$baseUrl = kg_ss_url(); $baseUrl = kg_cos_url();
$result = []; $result = [];

View File

@ -45,7 +45,7 @@ class CourseFavoriteList extends Builder
$courses = $courseRepo->findByIds($ids, $columns); $courses = $courseRepo->findByIds($ids, $columns);
$baseUrl = kg_ss_url(); $baseUrl = kg_cos_url();
$result = []; $result = [];
@ -69,7 +69,7 @@ class CourseFavoriteList extends Builder
$users = $userRepo->findByIds($ids, ['id', 'name', 'avatar']); $users = $userRepo->findByIds($ids, ['id', 'name', 'avatar']);
$baseUrl = kg_ss_url(); $baseUrl = kg_cos_url();
$result = []; $result = [];

View File

@ -61,7 +61,7 @@ class CourseList extends Builder
$users = $userRepo->findByIds($ids, ['id', 'name', 'avatar']); $users = $userRepo->findByIds($ids, ['id', 'name', 'avatar']);
$baseUrl = kg_ss_url(); $baseUrl = kg_cos_url();
$result = []; $result = [];

View File

@ -45,7 +45,7 @@ class CourseTopicList extends Builder
$courses = $courseRepo->findByIds($ids, $columns); $courses = $courseRepo->findByIds($ids, $columns);
$baseUrl = kg_ss_url(); $baseUrl = kg_cos_url();
$result = []; $result = [];

View File

@ -45,7 +45,7 @@ class CourseUserList extends Builder
$courses = $courseRepo->findByIds($ids, $columns); $courses = $courseRepo->findByIds($ids, $columns);
$baseUrl = kg_ss_url(); $baseUrl = kg_cos_url();
$result = []; $result = [];
@ -66,7 +66,7 @@ class CourseUserList extends Builder
$users = $userRepo->findByIds($ids, ['id', 'name', 'avatar']); $users = $userRepo->findByIds($ids, ['id', 'name', 'avatar']);
$baseUrl = kg_ss_url(); $baseUrl = kg_cos_url();
$result = []; $result = [];

View File

@ -84,7 +84,7 @@ class DanmuList extends Builder
$users = $userRepo->findByIds($ids, ['id', 'name', 'avatar']); $users = $userRepo->findByIds($ids, ['id', 'name', 'avatar']);
$baseUrl = kg_ss_url(); $baseUrl = kg_cos_url();
$result = []; $result = [];

View File

@ -31,7 +31,7 @@ class ImFriendUserList extends Builder
$users = $userRepo->findByIds($ids, $columns); $users = $userRepo->findByIds($ids, $columns);
$baseUrl = kg_ss_url(); $baseUrl = kg_cos_url();
$result = []; $result = [];

View File

@ -55,7 +55,7 @@ class ImGroupList extends Builder
$users = $userRepo->findByIds($ids, ['id', 'name', 'avatar']); $users = $userRepo->findByIds($ids, ['id', 'name', 'avatar']);
$baseUrl = kg_ss_url(); $baseUrl = kg_cos_url();
$result = []; $result = [];

View File

@ -40,7 +40,7 @@ class ImGroupUserList extends Builder
$users = $userRepo->findByIds($ids, $columns); $users = $userRepo->findByIds($ids, $columns);
$baseUrl = kg_ss_url(); $baseUrl = kg_cos_url();
$result = []; $result = [];
@ -64,7 +64,7 @@ class ImGroupUserList extends Builder
$users = $this->getGroupOwners($groups->toArray()); $users = $this->getGroupOwners($groups->toArray());
$baseUrl = kg_ss_url(); $baseUrl = kg_cos_url();
$result = []; $result = [];

View File

@ -26,7 +26,7 @@ class ImMessageList extends Builder
$users = $userRepo->findByIds($ids, ['id', 'name', 'avatar']); $users = $userRepo->findByIds($ids, ['id', 'name', 'avatar']);
$baseUrl = kg_ss_url(); $baseUrl = kg_cos_url();
$result = []; $result = [];

View File

@ -12,7 +12,7 @@ class OrderList extends Builder
public function __construct() public function __construct()
{ {
$this->imgBaseUrl = kg_ss_url(); $this->imgBaseUrl = kg_cos_url();
} }
/** /**

View File

@ -55,7 +55,7 @@ class ReviewList extends Builder
$users = $userRepo->findByIds($ids, ['id', 'name', 'avatar']); $users = $userRepo->findByIds($ids, ['id', 'name', 'avatar']);
$baseUrl = kg_ss_url(); $baseUrl = kg_cos_url();
$result = []; $result = [];

View File

@ -10,7 +10,7 @@ class UserList extends Builder
public function handleUsers(array $users) public function handleUsers(array $users)
{ {
$baseUrl = kg_ss_url(); $baseUrl = kg_cos_url();
foreach ($users as $key => $user) { foreach ($users as $key => $user) {
$users[$key]['avatar'] = $baseUrl . $user['avatar']; $users[$key]['avatar'] = $baseUrl . $user['avatar'];

View File

@ -14,11 +14,11 @@ class VodController extends Controller
/** /**
* @Post("/upload/sign", name="admin.vod.upload_sign") * @Post("/upload/sign", name="admin.vod.upload_sign")
*/ */
public function uploadSignAction() public function uploadSignatureAction()
{ {
$service = new VodService(); $service = new VodService();
$sign = $service->getUploadSign(); $sign = $service->getUploadSignature();
return $this->jsonSuccess(['sign' => $sign]); return $this->jsonSuccess(['sign' => $sign]);
} }

View File

@ -43,7 +43,7 @@ class Category extends Service
public function getChildCategories($parentId) public function getChildCategories($parentId)
{ {
$deleted = $this->request->getQuery('deleted', ['int'], 0); $deleted = $this->request->getQuery('deleted', 'int', 0);
$categoryRepo = new CategoryRepo(); $categoryRepo = new CategoryRepo();

View File

@ -35,7 +35,7 @@ class Nav extends Service
return $navRepo->findAll([ return $navRepo->findAll([
'position' => NavModel::POS_TOP, 'position' => NavModel::POS_TOP,
'parent_id' => 0, 'parent_id' => 0,
'published' => 1, 'deleted' => 0,
]); ]);
} }
@ -45,7 +45,7 @@ class Nav extends Service
return $navRepo->findAll([ return $navRepo->findAll([
'parent_id' => $parentId, 'parent_id' => $parentId,
'published' => 1, 'deleted' => 0,
]); ]);
} }

View File

@ -121,20 +121,7 @@ class Setting extends Service
public function updateSmserSettings($section, $settings) public function updateSmserSettings($section, $settings)
{ {
$template = $settings['template']; $settings['template'] = kg_json_encode($settings['template']);
$keys = array_keys($template['id']);
$myTemplate = [];
foreach ($keys as $key) {
$myTemplate[$key] = [
'id' => $template['id'][$key],
'content' => $template['content'][$key],
];
}
$settings['template'] = kg_json_encode($myTemplate);
$this->updateSectionSettings($section, $settings); $this->updateSectionSettings($section, $settings);
} }

View File

@ -2,9 +2,9 @@
{% block content %} {% block content %}
{% set back_url = url({'for':'admin.category.list'}) %} {% set back_url = url({'for':'admin.category.list'},{'type':type}) %}
{% set add_url = url({'for':'admin.category.add'},{'type':type,'parent_id':parent.id}) %} {% set add_url = url({'for':'admin.category.add'},{'type':type,'parent_id':parent.id}) %}
{% set allow_add = (type == 'course' and parent.level < 2) or (type == 'help' and parent.level < 1) %} {% set allow_add = (type == 1 and parent.level < 2) or (type == 2 and parent.level < 1) %}
<div class="kg-nav"> <div class="kg-nav">
<div class="kg-nav-left"> <div class="kg-nav-left">
@ -46,7 +46,6 @@
</thead> </thead>
<tbody> <tbody>
{% for item in categories %} {% for item in categories %}
{% set show_child_url = item.type == 'course' and item.level < 2 %}
{% set child_url = url({'for':'admin.category.list'},{'type':item.type,'parent_id':item.id}) %} {% set child_url = url({'for':'admin.category.list'},{'type':item.type,'parent_id':item.id}) %}
{% set edit_url = url({'for':'admin.category.edit','id':item.id}) %} {% set edit_url = url({'for':'admin.category.edit','id':item.id}) %}
{% set update_url = url({'for':'admin.category.update','id':item.id}) %} {% set update_url = url({'for':'admin.category.update','id':item.id}) %}
@ -54,10 +53,10 @@
{% set restore_url = url({'for':'admin.category.restore','id':item.id}) %} {% set restore_url = url({'for':'admin.category.restore','id':item.id}) %}
<tr> <tr>
<td>{{ item.id }}</td> <td>{{ item.id }}</td>
{% if show_child_url %} {% if item.type == 1 and item.level < 2 %}
<td><a href="{{ child_url }}">{{ item.name }}</a></td> <td><a href="{{ child_url }}">{{ item.name }}</a></td>
{% else %} {% else %}
<td>{{ item.name }}</td> <td><a href="{{ edit_url }}">{{ item.name }}</a></td>
{% endif %} {% endif %}
<td><span class="layui-badge layui-bg-gray">{{ item.level }}</span></td> <td><span class="layui-badge layui-bg-gray">{{ item.level }}</span></td>
<td><span class="layui-badge layui-bg-gray">{{ item.child_count }}</span></td> <td><span class="layui-badge layui-bg-gray">{{ item.child_count }}</span></td>

View File

@ -1,4 +1,5 @@
{% set free = course.market_price == 0 %} {% set free = course.market_price == 0 %}
{% set price_display = course.market_price > 0 ? 'display:block' : 'display:none' %}
<form class="layui-form kg-form" method="POST" action="{{ url({'for':'admin.course.update','id':course.id}) }}"> <form class="layui-form kg-form" method="POST" action="{{ url({'for':'admin.course.update','id':course.id}) }}">
<div class="layui-form-item"> <div class="layui-form-item">
@ -8,7 +9,7 @@
<input type="radio" name="price_mode" value="charge" title="收费" lay-filter="price_mode" {% if not free %}checked="checked"{% endif %}> <input type="radio" name="price_mode" value="charge" title="收费" lay-filter="price_mode" {% if not free %}checked="checked"{% endif %}>
</div> </div>
</div> </div>
<div id="price-block" {% if free %}style="display:none;"{% endif %}> <div id="price-block" style="{{ price_display }}">
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">市场价格</label> <label class="layui-form-label">市场价格</label>

View File

@ -72,10 +72,10 @@
{% set restore_url = url({'for':'admin.nav.restore','id':item.id}) %} {% set restore_url = url({'for':'admin.nav.restore','id':item.id}) %}
<tr> <tr>
<td>{{ item.id }}</td> <td>{{ item.id }}</td>
{% if item.position == 'top' and item.level < 2 %} {% if item.position == 1 and item.level < 2 %}
<td><a href="{{ child_url }}">{{ item.name }}</a></td> <td><a href="{{ child_url }}">{{ item.name }}</a></td>
{% else %} {% else %}
<td>{{ item.name }}</td> <td><a href="{{ edit_url }}">{{ item.name }}</a></td>
{% endif %} {% endif %}
<td><span class="layui-badge layui-bg-gray">{{ item.level }}</span></td> <td><span class="layui-badge layui-bg-gray">{{ item.level }}</span></td>
<td><span class="layui-badge layui-bg-gray">{{ item.child_count }}</span></td> <td><span class="layui-badge layui-bg-gray">{{ item.child_count }}</span></td>

View File

@ -52,7 +52,7 @@
}); });
form.on('radio(pull_trans_enabled)', function (data) { form.on('radio(pull_trans_enabled)', function (data) {
var block = $('#ptt-block'); var block = $('#pull-trans-tpl-block');
if (data.value === '1') { if (data.value === '1') {
block.show(); block.show();
} else { } else {

View File

@ -1,5 +1,5 @@
{% set auth_display = pull.auth_enabled == 0 ? 'style="display:none;"' : '' %} {% set pull_auth_display = pull.auth_enabled == 1 ? 'display:block' : 'display:none' %}
{% set ppt_display = pull.trans_enabled == 0 ? 'style="display:none;"' : '' %} {% set pull_trans_tpl_display = pull.trans_enabled == 1 ? 'display:block' : 'display:none' %}
<form class="layui-form kg-form" method="POST" action="{{ url({'for':'admin.setting.live'}) }}"> <form class="layui-form kg-form" method="POST" action="{{ url({'for':'admin.setting.live'}) }}">
<fieldset class="layui-elem-field layui-field-title"> <fieldset class="layui-elem-field layui-field-title">
@ -28,7 +28,7 @@
<input type="radio" name="auth_enabled" value="0" title="否" lay-filter="pull_auth_enabled" {% if pull.auth_enabled == 0 %}checked{% endif %}> <input type="radio" name="auth_enabled" value="0" title="否" lay-filter="pull_auth_enabled" {% if pull.auth_enabled == 0 %}checked{% endif %}>
</div> </div>
</div> </div>
<div id="pull-auth-block" {{ auth_display }}> <div id="pull-auth-block" style="{{ pull_auth_display }}">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">鉴权密钥</label> <label class="layui-form-label">鉴权密钥</label>
<div class="layui-input-block"> <div class="layui-input-block">
@ -52,7 +52,7 @@
<input type="radio" name="trans_enabled" value="0" title="否" lay-filter="pull_trans_enabled" {% if pull.trans_enabled == 0 %}checked{% endif %}> <input type="radio" name="trans_enabled" value="0" title="否" lay-filter="pull_trans_enabled" {% if pull.trans_enabled == 0 %}checked{% endif %}>
</div> </div>
</div> </div>
<div id="ptt-block" {{ ppt_display }}> <div id="pull-trans-tpl-block" style="{{ pull_trans_tpl_display }}">
<div class="layui-form-item"> <div class="layui-form-item">
<table class="layui-table"> <table class="layui-table">
<colgroup> <colgroup>

View File

@ -1,4 +1,4 @@
{% set auth_display = push.auth_enabled == 0 ? 'style="display:none;"' : '' %} {% set push_auth_display = push.auth_enabled == 1 ? 'display:block' : 'display:none' %}
<form class="layui-form kg-form" method="POST" action="{{ url({'for':'admin.setting.live'}) }}"> <form class="layui-form kg-form" method="POST" action="{{ url({'for':'admin.setting.live'}) }}">
<fieldset class="layui-elem-field layui-field-title"> <fieldset class="layui-elem-field layui-field-title">
@ -16,11 +16,11 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">开启鉴权</label> <label class="layui-form-label">开启鉴权</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="radio" name="auth_enabled" value="1" title="是" lay-filter="auth_enabled" {% if push.auth_enabled == 1 %}checked{% endif %}> <input type="radio" name="auth_enabled" value="1" title="是" lay-filter="push_auth_enabled" {% if push.auth_enabled == 1 %}checked{% endif %}>
<input type="radio" name="auth_enabled" value="0" title="否" lay-filter="auth_enabled" {% if push.auth_enabled == 0 %}checked{% endif %}> <input type="radio" name="auth_enabled" value="0" title="否" lay-filter="push_auth_enabled" {% if push.auth_enabled == 0 %}checked{% endif %}>
</div> </div>
</div> </div>
<div id="push-auth-block" {{ auth_display }}> <div id="push-auth-block" style="{{ push_auth_display }}">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">鉴权密钥</label> <label class="layui-form-label">鉴权密钥</label>
<div class="layui-input-block"> <div class="layui-input-block">

View File

@ -2,7 +2,7 @@
{% block content %} {% block content %}
{% set closed_tips_display = site.enabled == 1 ? 'style="display:none;"' : '' %} {% set closed_tips_display = site.enabled == 0 ? 'display:block' : 'display:none' %}
<form class="layui-form kg-form" method="POST" action="{{ url({'for':'admin.setting.site'}) }}"> <form class="layui-form kg-form" method="POST" action="{{ url({'for':'admin.setting.site'}) }}">
<fieldset class="layui-elem-field layui-field-title"> <fieldset class="layui-elem-field layui-field-title">
@ -15,7 +15,7 @@
<input type="radio" name="enabled" value="0" title="关闭" lay-filter="status" {% if site.enabled == 0 %}checked{% endif %}> <input type="radio" name="enabled" value="0" title="关闭" lay-filter="status" {% if site.enabled == 0 %}checked{% endif %}>
</div> </div>
</div> </div>
<div id="closed-tips-block" {{ closed_tips_display }}> <div id="closed-tips-block" style="{{ closed_tips_display }}">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">关闭原因</label> <label class="layui-form-label">关闭原因</label>
<div class="layui-input-block"> <div class="layui-input-block">

View File

@ -47,26 +47,26 @@
<tbody> <tbody>
<tr> <tr>
<td>身份验证</td> <td>身份验证</td>
<td><input class="layui-input" type="text" name="template[id][verify]" value="{{ template.verify.id }}" lay-verify="required"></td> <td><input class="layui-input" type="text" name="template[verify]" value="{{ template.verify }}" lay-verify="required"></td>
<td><input id="tc-verify" class="layui-input" type="text" name="template[content][verify]" value="{{ template.verify.content }}" readonly="readonly" lay-verify="required"></td> <td><input id="tc-verify" class="layui-input" type="text" value="验证码:{1}{2} 分钟内有效,如非本人操作请忽略。" readonly="readonly"></td>
<td><span class="kg-copy layui-btn" data-clipboard-target="#tc-verify">复制</span></td> <td><span class="kg-copy layui-btn" data-clipboard-target="#tc-verify">复制</span></td>
</tr> </tr>
<tr> <tr>
<td>订单通知</td> <td>订单通知</td>
<td><input class="layui-input" type="text" name="template[id][order]" value="{{ template.order.id }}" lay-verify="required"></td> <td><input class="layui-input" type="text" name="template[order]" value="{{ template.order }}" lay-verify="required"></td>
<td><input id="tc-order" class="layui-input" type="text" name="template[content][order]" value="{{ template.order.content }}" readonly="readonly" lay-verify="required"></td> <td><input id="tc-order" class="layui-input" type="text" value="下单成功,商品名称:{1},订单序号:{2},订单金额:¥{3}" readonly="readonly"></td>
<td><span class="kg-copy layui-btn" data-clipboard-target="#tc-order">复制</span></td> <td><span class="kg-copy layui-btn" data-clipboard-target="#tc-order">复制</span></td>
</tr> </tr>
<tr> <tr>
<td>退款通知</td> <td>退款通知</td>
<td><input class="layui-input" type="text" name="template[id][refund]" value="{{ template.refund.id }}" lay-verify="required"></td> <td><input class="layui-input" type="text" name="template[refund]" value="{{ template.refund }}" lay-verify="required"></td>
<td><input id="tc-refund" class="layui-input" type="text" name="template[content][refund]" value="{{ template.refund.content }}" readonly="readonly" lay-verify="required"></td> <td><input id="tc-refund" class="layui-input" type="text" value="退款成功,商品名称:{1},订单序号:{2},退款金额:¥{3}" readonly="readonly"></td>
<td><span class="kg-copy layui-btn" data-clipboard-target="#tc-refund">复制</span></td> <td><span class="kg-copy layui-btn" data-clipboard-target="#tc-refund">复制</span></td>
</tr> </tr>
<tr> <tr>
<td>直播通知</td> <td>直播通知</td>
<td><input class="layui-input" type="text" name="template[id][live]" value="{{ template.live.id }}" lay-verify="required"></td> <td><input class="layui-input" type="text" name="template[live]" value="{{ template.live }}" lay-verify="required"></td>
<td><input id="tc-live" class="layui-input" type="text" name="template[content][live]" value="{{ template.live.content }}" readonly="readonly" lay-verify="required"></td> <td><input id="tc-live" class="layui-input" type="text" value="直播预告,课程名称:{1},章节名称:{2},开播时间:{3}" readonly="readonly"></td>
<td><span class="kg-copy layui-btn" data-clipboard-target="#tc-live">复制</span></td> <td><span class="kg-copy layui-btn" data-clipboard-target="#tc-live">复制</span></td>
</tr> </tr>
</tbody> </tbody>

View File

@ -2,9 +2,9 @@
{% block content %} {% block content %}
{% set storage_region_display = vod.storage_type == 'nearby' ? 'style="display:none;"' : '' %} {% set storage_region_display = vod.storage_type == 'fixed' ? 'display:block' : 'display:none' %}
{% set watermark_tpl_display = vod.watermark_enabled == 0 ? 'style="display:none;"' : '' %} {% set watermark_template_display = vod.watermark_enabled == 1 ? 'display:block' : 'display:none' %}
{% set key_anti_display = vod.key_anti_enabled == 0 ? 'style="display:none;"' : '' %} {% set key_anti_display = vod.key_anti_enabled == 1 ? 'display:block': 'display:none' %}
<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">
@ -17,7 +17,7 @@
<input type="radio" name="storage_type" value="fixed" title="固定区域" lay-filter="storage_type" {% if vod.storage_type == "fixed" %}checked{% endif %}> <input type="radio" name="storage_type" value="fixed" title="固定区域" lay-filter="storage_type" {% if vod.storage_type == "fixed" %}checked{% endif %}>
</div> </div>
</div> </div>
<div id="storage-region-block" {{ storage_region_display }}> <div id="storage-region-block" style="{{ storage_region_display }}">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">所在区域</label> <label class="layui-form-label">所在区域</label>
<div class="layui-input-block"> <div class="layui-input-block">
@ -49,7 +49,7 @@
<input type="radio" name="watermark_enabled" value="0" title="否" lay-filter="watermark_enabled" {% if vod.watermark_enabled == 0 %}checked{% endif %}> <input type="radio" name="watermark_enabled" value="0" title="否" lay-filter="watermark_enabled" {% if vod.watermark_enabled == 0 %}checked{% endif %}>
</div> </div>
</div> </div>
<div id="watermark-template-block" {{ watermark_tpl_display }}> <div id="watermark-template-block" style="{{ watermark_template_display }}">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">水印模板ID</label> <label class="layui-form-label">水印模板ID</label>
<div class="layui-input-block"> <div class="layui-input-block">
@ -63,14 +63,14 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">分发协议</label> <label class="layui-form-label">分发协议</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="radio" name="dist_protocol" value="https" title="HTTPS" {% if vod.dist_protocol == "https" %}checked{% endif %}> <input type="radio" name="protocol" value="https" title="HTTPS" {% if vod.protocol == "https" %}checked{% endif %}>
<input type="radio" name="dist_protocol" value="http" title="HTTP" {% if vod.dist_protocol == "http" %}checked{% endif %}> <input type="radio" name="protocol" value="http" title="HTTP" {% if vod.protocol == "http" %}checked{% endif %}>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">分发域名</label> <label class="layui-form-label">分发域名</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input class="layui-input" type="text" name="dist_domain" value="{{ vod.dist_domain }}" lay-verify="required"> <input class="layui-input" type="text" name="domain" value="{{ vod.domain }}" lay-verify="required">
</div> </div>
</div> </div>
<fieldset class="layui-elem-field layui-field-title"> <fieldset class="layui-elem-field layui-field-title">

View File

@ -2,6 +2,8 @@
{% block content %} {% block content %}
{% set lock_expiry_display = user.locked == 1 ? 'display:block': 'display:none' %}
<form class="layui-form kg-form" method="POST" action="{{ url({'for':'admin.user.update','id':user.id}) }}"> <form class="layui-form kg-form" method="POST" action="{{ url({'for':'admin.user.update','id':user.id}) }}">
<fieldset class="layui-elem-field layui-field-title"> <fieldset class="layui-elem-field layui-field-title">
<legend>编辑用户</legend> <legend>编辑用户</legend>
@ -51,7 +53,8 @@
<input type="radio" name="locked" value="0" title="否" lay-filter="locked" {% if user.locked == 0 %}checked="checked"{% endif %}> <input type="radio" name="locked" value="0" title="否" lay-filter="locked" {% if user.locked == 0 %}checked="checked"{% endif %}>
</div> </div>
</div> </div>
<div class="layui-form-item" id="lock-expiry-block" {% if user.locked == 0 %}style="display:none;"{% endif %}> <div id="lock-expiry-block" style="{{ lock_expiry_display }}">
<div class="layui-form-item">
<label class="layui-form-label">锁定期限</label> <label class="layui-form-label">锁定期限</label>
<div class="layui-input-block"> <div class="layui-input-block">
{% if user.lock_expiry_time > 0 %} {% if user.lock_expiry_time > 0 %}
@ -61,6 +64,7 @@
{% endif %} {% endif %}
</div> </div>
</div> </div>
</div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label"></label> <label class="layui-form-label"></label>
<div class="layui-input-block"> <div class="layui-input-block">

View File

@ -59,7 +59,7 @@ class Im extends Service
return []; return [];
} }
$baseUrl = kg_ss_url(); $baseUrl = kg_cos_url();
$result = []; $result = [];
@ -252,7 +252,7 @@ class Im extends Service
$users = $userRepo->findByIds($ids); $users = $userRepo->findByIds($ids);
$baseUrl = kg_ss_url(); $baseUrl = kg_cos_url();
$mapping = []; $mapping = [];
@ -303,7 +303,7 @@ class Im extends Service
$groups = $groupRepo->findByIds($ids); $groups = $groupRepo->findByIds($ids);
$baseUrl = kg_ss_url(); $baseUrl = kg_cos_url();
$mapping = []; $mapping = [];

View File

@ -188,7 +188,7 @@ class ImGroup extends Service
$users = $builder->getUsers($groups); $users = $builder->getUsers($groups);
$baseUrl = kg_ss_url(); $baseUrl = kg_cos_url();
$items = []; $items = [];

View File

@ -172,7 +172,7 @@ function kg_default_cover_path()
* *
* @return string * @return string
*/ */
function kg_ss_url() function kg_cos_url()
{ {
$storage = new StorageService(); $storage = new StorageService();
@ -186,7 +186,7 @@ function kg_ss_url()
* @param string $style * @param string $style
* @return string * @return string
*/ */
function kg_ss_img_url($path, $style = null) function kg_cos_img_url($path, $style = null)
{ {
if (!$path) return ''; if (!$path) return '';
@ -206,11 +206,11 @@ function kg_ss_img_url($path, $style = null)
* @param string $style * @param string $style
* @return string * @return string
*/ */
function kg_ss_avatar_url($path, $style = null) function kg_cos_avatar_url($path, $style = null)
{ {
$path = $path ?: kg_default_avatar_path(); $path = $path ?: kg_default_avatar_path();
return kg_ss_img_url($path, $style); return kg_cos_img_url($path, $style);
} }
/** /**
@ -220,11 +220,11 @@ function kg_ss_avatar_url($path, $style = null)
* @param string $style * @param string $style
* @return string * @return string
*/ */
function kg_ss_cover_url($path, $style = null) function kg_cos_cover_url($path, $style = null)
{ {
$path = $path ?: kg_default_cover_path(); $path = $path ?: kg_default_cover_path();
return kg_ss_img_url($path, $style); return kg_cos_img_url($path, $style);
} }
/** /**

View File

@ -158,7 +158,7 @@ class Carousel extends Model
public function afterFetch() public function afterFetch()
{ {
if (!Text::startsWith($this->cover, 'http')) { if (!Text::startsWith($this->cover, 'http')) {
$this->cover = kg_ss_cover_url($this->cover); $this->cover = kg_cos_cover_url($this->cover);
} }
if (is_string($this->style) && !empty($this->style)) { if (is_string($this->style) && !empty($this->style)) {

View File

@ -338,7 +338,7 @@ class Course extends Model
$this->score = (float)$this->score; $this->score = (float)$this->score;
if (!Text::startsWith($this->cover, 'http')) { if (!Text::startsWith($this->cover, 'http')) {
$this->cover = kg_ss_cover_url($this->cover); $this->cover = kg_cos_cover_url($this->cover);
} }
if (is_string($this->attrs) && !empty($this->attrs)) { if (is_string($this->attrs) && !empty($this->attrs)) {

View File

@ -156,7 +156,7 @@ class ImGroup extends Model
public function afterFetch() public function afterFetch()
{ {
if (!Text::startsWith($this->avatar, 'http')) { if (!Text::startsWith($this->avatar, 'http')) {
$this->avatar = kg_ss_avatar_url($this->avatar); $this->avatar = kg_cos_avatar_url($this->avatar);
} }
} }

View File

@ -133,7 +133,7 @@ class ImUser extends Model
public function afterFetch() public function afterFetch()
{ {
if (!Text::startsWith($this->avatar, 'http')) { if (!Text::startsWith($this->avatar, 'http')) {
$this->avatar = kg_ss_avatar_url($this->avatar); $this->avatar = kg_cos_avatar_url($this->avatar);
} }
} }

View File

@ -221,7 +221,7 @@ class User extends Model
public function afterFetch() public function afterFetch()
{ {
if (!Text::startsWith($this->avatar, 'http')) { if (!Text::startsWith($this->avatar, 'http')) {
$this->avatar = kg_ss_avatar_url($this->avatar); $this->avatar = kg_cos_avatar_url($this->avatar);
} }
} }

View File

@ -46,8 +46,8 @@ class Volt extends Provider
return 'kg_js_include(' . $resolvedArgs . ')'; return 'kg_js_include(' . $resolvedArgs . ')';
}); });
$compiler->addFunction('ss_img_url', function ($resolvedArgs) { $compiler->addFunction('cos_img_url', function ($resolvedArgs) {
return 'kg_ss_img_url(' . $resolvedArgs . ')'; return 'kg_cos_img_url(' . $resolvedArgs . ')';
}); });
$compiler->addFunction('substr', function ($resolvedArgs) { $compiler->addFunction('substr', function ($resolvedArgs) {

View File

@ -57,7 +57,7 @@ class CourseList extends FrontendService
$items = []; $items = [];
$baseUrl = kg_ss_url(); $baseUrl = kg_cos_url();
foreach ($courses as $course) { foreach ($courses as $course) {

View File

@ -62,7 +62,7 @@ class GroupList extends FrontendService
$users = $builder->getUsers($groups); $users = $builder->getUsers($groups);
$baseUrl = kg_ss_url(); $baseUrl = kg_cos_url();
$items = []; $items = [];

View File

@ -17,7 +17,7 @@ class ProfileInfo extends FrontendService
protected function handleUser(UserModel $user) protected function handleUser(UserModel $user)
{ {
$user->avatar = kg_ss_avatar_url($user->avatar); $user->avatar = kg_cos_avatar_url($user->avatar);
$user->area = $this->handleArea($user->area); $user->area = $this->handleArea($user->area);

View File

@ -91,14 +91,14 @@ class OrderInfo extends FrontendService
protected function handleCourseInfo($itemInfo) protected function handleCourseInfo($itemInfo)
{ {
$itemInfo['course']['cover'] = kg_ss_cover_url($itemInfo['course']['cover']); $itemInfo['course']['cover'] = kg_cos_cover_url($itemInfo['course']['cover']);
return $itemInfo; return $itemInfo;
} }
protected function handlePackageInfo($itemInfo) protected function handlePackageInfo($itemInfo)
{ {
$baseUrl = kg_ss_url(); $baseUrl = kg_cos_url();
foreach ($itemInfo['courses'] as &$course) { foreach ($itemInfo['courses'] as &$course) {
$course['cover'] = $baseUrl . $course['cover']; $course['cover'] = $baseUrl . $course['cover'];

View File

@ -55,7 +55,12 @@ class Course extends FrontendService
$items = []; $items = [];
$baseUrl = kg_cos_url();
foreach ($pager->items as $item) { foreach ($pager->items as $item) {
$item['cover'] = $baseUrl . $item['cover'];
$items[] = [ $items[] = [
'id' => (int)$item['id'], 'id' => (int)$item['id'],
'title' => $item['title'], 'title' => $item['title'],

View File

@ -1,18 +0,0 @@
<?php
namespace App\Services\Frontend\Search;
use App\Services\Frontend\Service as FrontendService;
use App\Services\Search\CourseSearcher as CourseSearcherService;
class CourseHotQuery extends FrontendService
{
public function handle($limit = 10, $type = 'total')
{
$searcher = new CourseSearcherService();
return $searcher->getHotQuery($limit, $type);
}
}

View File

@ -1,68 +0,0 @@
<?php
namespace App\Services\Frontend\Search;
use App\Library\Paginator\Adapter\XunSearch as XunSearchPaginator;
use App\Library\Paginator\Query as PagerQuery;
use App\Services\Frontend\Service as FrontendService;
use App\Services\Search\CourseSearcher as CourseSearcherService;
class CourseList extends FrontendService
{
public function handle()
{
$pagerQuery = new PagerQuery();
$params = $pagerQuery->getParams();
$page = $pagerQuery->getPage();
$limit = $pagerQuery->getLimit();
$courseSearcher = new CourseSearcherService();
$paginator = new XunSearchPaginator([
'xs' => $courseSearcher->getXS(),
'highlight' => $courseSearcher->getHighlightFields(),
'query' => $params['query'],
'page' => $page,
'limit' => $limit,
]);
$pager = $paginator->getPaginate();
return $this->handleCourses($pager);
}
public function handleCourses($pager)
{
if ($pager->total_items == 0) {
return $pager;
}
$items = [];
foreach ($pager->items as $course) {
$items[] = [
'id' => (int)$course['id'],
'title' => $course['title'],
'cover' => $course['cover'],
'summary' => $course['summary'],
'market_price' => (float)$course['market_price'],
'vip_price' => (float)$course['vip_price'],
'model' => $course['model'],
'level' => $course['level'],
'user_count' => (int)$course['user_count'],
'lesson_count' => (int)$course['lesson_count'],
'review_count' => (int)$course['review_count'],
'favorite_count' => (int)$course['favorite_count'],
'teacher' => json_decode($course['teacher']),
'category' => json_decode($course['category']),
];
}
$pager->items = $items;
return $pager;
}
}

View File

@ -1,18 +0,0 @@
<?php
namespace App\Services\Frontend\Search;
use App\Services\Frontend\Service as FrontendService;
use App\Services\Search\CourseSearcher as CourseSearcherService;
class CourseRelatedQuery extends FrontendService
{
public function handle($query, $limit = 10)
{
$searcher = new CourseSearcherService();
return $searcher->getRelatedQuery($query, $limit);
}
}

View File

@ -55,7 +55,12 @@ class Group extends FrontendService
$items = []; $items = [];
$baseUrl = kg_cos_url();
foreach ($pager->items as $item) { foreach ($pager->items as $item) {
$item['avatar'] = $baseUrl . $item['avatar'];
$items[] = [ $items[] = [
'id' => (int)$item['id'], 'id' => (int)$item['id'],
'type' => $item['type'], 'type' => $item['type'],

View File

@ -55,7 +55,12 @@ class User extends FrontendService
$items = []; $items = [];
$baseUrl = kg_cos_url();
foreach ($pager->items as $item) { foreach ($pager->items as $item) {
$item['avatar'] = $baseUrl . $item['avatar'];
$items[] = [ $items[] = [
'id' => (int)$item['id'], 'id' => (int)$item['id'],
'name' => $item['name'], 'name' => $item['name'],

View File

@ -40,7 +40,7 @@ class TeacherList extends FrontendService
$items = []; $items = [];
$baseUrl = kg_ss_url(); $baseUrl = kg_cos_url();
foreach ($users as $user) { foreach ($users as $user) {

View File

@ -33,7 +33,7 @@ class CourseList extends FrontendService
$items = []; $items = [];
$baseUrl = kg_ss_url(); $baseUrl = kg_cos_url();
foreach ($pager->items->toArray() as $course) { foreach ($pager->items->toArray() as $course) {

View File

@ -37,7 +37,7 @@ class CourseList extends FrontendService
$courses = $pager->items->toArray(); $courses = $pager->items->toArray();
$baseUrl = kg_ss_url(); $baseUrl = kg_cos_url();
$items = []; $items = [];

View File

@ -37,7 +37,7 @@ class UserList extends FrontendService
$users = $pager->items->toArray(); $users = $pager->items->toArray();
$baseUrl = kg_ss_url(); $baseUrl = kg_cos_url();
$items = []; $items = [];

View File

@ -32,7 +32,7 @@ class Refund extends Service
*/ */
$itemInfo = $order->item_info; $itemInfo = $order->item_info;
$itemInfo['course']['cover'] = kg_ss_cover_url($itemInfo['course']['cover']); $itemInfo['course']['cover'] = kg_cos_cover_url($itemInfo['course']['cover']);
$refundPercent = 0.00; $refundPercent = 0.00;
$refundAmount = 0.00; $refundAmount = 0.00;
@ -72,7 +72,7 @@ class Refund extends Service
*/ */
foreach ($itemInfo['courses'] as &$course) { foreach ($itemInfo['courses'] as &$course) {
$course['cover'] = kg_ss_cover_url($course['cover']); $course['cover'] = kg_cos_cover_url($course['cover']);
$refundPercent = 0.00; $refundPercent = 0.00;
$refundAmount = 0.00; $refundAmount = 0.00;

View File

@ -63,6 +63,8 @@ class CourseDocument extends Component
]); ]);
} }
$course->cover = CourseModel::getCoverPath($course->cover);
return [ return [
'id' => $course->id, 'id' => $course->id,
'title' => $course->title, 'title' => $course->title,

View File

@ -46,6 +46,8 @@ class GroupDocument extends Component
]); ]);
} }
$group->avatar = GroupModel::getAvatarPath($group->avatar);
return [ return [
'id' => $group->id, 'id' => $group->id,
'type' => $group->type, 'type' => $group->type,

View File

@ -33,6 +33,8 @@ class UserDocument extends Component
*/ */
public function formatDocument(UserModel $user) public function formatDocument(UserModel $user)
{ {
$user->avatar = UserModel::getAvatarPath($user->avatar);
return [ return [
'id' => $user->id, 'id' => $user->id,
'name' => $user->name, 'name' => $user->name,

View File

@ -84,7 +84,7 @@ class Vod extends Service
* *
* @return string * @return string
*/ */
public function getUploadSign() public function getUploadSignature()
{ {
$secret = $this->getSectionSettings('secret'); $secret = $this->getSectionSettings('secret');

2
config/cert/alipay/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

2
config/cert/wxpay/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

View File

@ -343,12 +343,12 @@ final class InsertSettingData extends AbstractMigration
[ [
'section' => 'smser', 'section' => 'smser',
'item_key' => 'signature', 'item_key' => 'signature',
'item_value' => 'abc', 'item_value' => '酷瓜云课堂',
], ],
[ [
'section' => 'smser', 'section' => 'smser',
'item_key' => 'template', 'item_key' => 'template',
'item_value' => '{"verify":{"id":"561282","content":"验证码:{1}{2} 分钟内有效,如非本人操作请忽略。"},"order":{"id":"561954","content":"下单成功,商品名称:{1},订单序号:{2},订单金额:¥{3}"},"refund":{"id":"561286","content":"退款成功,商品名称:{1},订单序号:{2},退款金额:¥{3}"},"live":{"id":"561288","content":"直播预告,课程名称:{1},章节名称:{2},开播时间:{3}"}}', 'item_value' => '{"verify":"561282","order":"561954","refund":"561286","live":"561288"}',
], ],
[ [
'section' => 'cos', 'section' => 'cos',
@ -402,12 +402,12 @@ final class InsertSettingData extends AbstractMigration
], ],
[ [
'section' => 'vod', 'section' => 'vod',
'item_key' => 'dist_protocol', 'item_key' => 'protocol',
'item_value' => 'https', 'item_value' => 'https',
], ],
[ [
'section' => 'vod', 'section' => 'vod',
'item_key' => 'dist_domain', 'item_key' => 'domain',
'item_value' => '', 'item_value' => '',
], ],
[ [