mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-26 20:52:44 +08:00
Merge branch 'koogua/v1.7.1' into demo
This commit is contained in:
commit
2b240678a9
19
CHANGELOG.md
19
CHANGELOG.md
@ -1,4 +1,21 @@
|
||||
### [v1.7.1](https://gitee.com/koogua/course-tencent-cloud/releases/v1.7.1)(2024-06-15)
|
||||
### [v1.7.1](https://gitee.com/koogua/course-tencent-cloud/releases/v1.7.1)(2024-06-31)
|
||||
|
||||
- 更新layui-v2.9.10
|
||||
- 更新docker国内镜像地址
|
||||
- 增加导入镜像构建容器的方式
|
||||
- 调整微信公众号模板消息
|
||||
- 移除加载富文本编辑器初始化的语言文件
|
||||
- 移除consult中多余的chapter_id属性
|
||||
- 修正课程列表顶部过滤条件区块不能收缩问题
|
||||
- 用户中心第三方登录列表增加过滤条件
|
||||
- 后台增加打开/关闭左侧菜单提示
|
||||
- 优化整理文件mimeType
|
||||
- iconfont资源本地化
|
||||
- 优化UploadController
|
||||
- 优化富文本内容显示样式
|
||||
- 简化内容图片放大监听
|
||||
- 去除课程打赏相关内容
|
||||
- 课程增加能否发布检查
|
||||
|
||||
### [v1.7.0](https://gitee.com/koogua/course-tencent-cloud/releases/v1.7.0)(2024-05-15)
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
友情提示:
|
||||
|
||||
- 演示系统配置低(1Core,1G,1M 跑多个容器)切莫压测
|
||||
- 演示系统配置低(2核,2G,1M 跑多个容器)切莫压测
|
||||
- 课程数据来源于网络(无实质内容)切莫购买
|
||||
- 管理后台已禁止数据提交,私密配置已过滤
|
||||
|
||||
@ -49,7 +49,7 @@ Tips: 请用手机注册一个新账号,用户中心 -> 关注订阅,扫码
|
||||
### 项目组件
|
||||
|
||||
- 后台框架:[phalcon 3.4.5](https://phalcon.io)
|
||||
- 前端框架:[layui 2.9.3](https://layui.dev)
|
||||
- 前端框架:[layui 2.9.10](https://layui.dev)
|
||||
- 全文检索:[xunsearch 1.4.17](http://www.xunsearch.com)
|
||||
- 基础依赖:[php7.3](https://php.net), [mysql5.7](https://mysql.com), [redis5.0](https://redis.io)
|
||||
|
||||
|
@ -113,8 +113,13 @@ class OrderList extends Builder
|
||||
$me['allow_refund'] = $refundStatusOk && $refundTimeOk ? 1 : 0;
|
||||
}
|
||||
|
||||
$me['allow_pay'] = $payStatusOk;
|
||||
$me['allow_cancel'] = $cancelStatusOk;
|
||||
if ($payStatusOk == 1) {
|
||||
$me['allow_pay'] = 1;
|
||||
}
|
||||
|
||||
if ($cancelStatusOk == 1) {
|
||||
$me['allow_cancel'] = 1;
|
||||
}
|
||||
|
||||
return $me;
|
||||
}
|
||||
@ -149,20 +154,6 @@ class OrderList extends Builder
|
||||
return $itemInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $itemInfo
|
||||
* @return mixed
|
||||
*/
|
||||
protected function handleRewardInfo($itemInfo)
|
||||
{
|
||||
if (!empty($itemInfo) && is_string($itemInfo)) {
|
||||
$itemInfo = json_decode($itemInfo, true);
|
||||
$itemInfo['course']['cover'] = $this->imgBaseUrl . $itemInfo['course']['cover'];
|
||||
}
|
||||
|
||||
return $itemInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $itemInfo
|
||||
* @return mixed
|
||||
|
48
app/Console/Migrations/V20240608145810.php
Normal file
48
app/Console/Migrations/V20240608145810.php
Normal file
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2024 深圳市酷瓜软件有限公司
|
||||
* @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Console\Migrations;
|
||||
|
||||
use App\Models\Chapter as ChapterModel;
|
||||
use App\Models\Course as CourseModel;
|
||||
use Phalcon\Mvc\Model\Resultset;
|
||||
|
||||
class V20240608145810 extends Migration
|
||||
{
|
||||
|
||||
public function run()
|
||||
{
|
||||
$this->handleReadChapters();
|
||||
}
|
||||
|
||||
protected function handleReadChapters()
|
||||
{
|
||||
/**
|
||||
* @var $chapters Resultset|ChapterModel[]
|
||||
*/
|
||||
$chapters = ChapterModel::query()
|
||||
->where('model = :model:', ['model' => CourseModel::MODEL_READ])
|
||||
->andWhere('parent_id > 0')
|
||||
->execute();
|
||||
|
||||
if ($chapters->count() == 0) return;
|
||||
|
||||
foreach ($chapters as $chapter) {
|
||||
|
||||
$attrs = $chapter->attrs;
|
||||
|
||||
if (isset($attrs['format'])) continue;
|
||||
|
||||
$attrs['format'] = 'html';
|
||||
|
||||
$chapter->attrs = $attrs;
|
||||
|
||||
$chapter->update();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -7,8 +7,8 @@
|
||||
|
||||
namespace App\Console\Tasks;
|
||||
|
||||
use App\Caches\CategoryList as CategoryListCache;
|
||||
use App\Caches\CategoryAllList as CategoryAllListCache;
|
||||
use App\Caches\CategoryList as CategoryListCache;
|
||||
use App\Caches\CategoryTreeList as CategoryTreeListCache;
|
||||
use App\Caches\IndexSlideList as IndexSlideListCache;
|
||||
use App\Models\Account as AccountModel;
|
||||
@ -39,8 +39,8 @@ class CleanDemoDataTask extends Task
|
||||
echo '------ start truncate tables ------' . PHP_EOL;
|
||||
|
||||
$excludeTables = [
|
||||
'kg_area', 'kg_migration', 'kg_migration_task', 'kg_nav', 'kg_page',
|
||||
'kg_reward', 'kg_role', 'kg_setting', 'kg_vip',
|
||||
'kg_area', 'kg_migration', 'kg_migration_task', 'kg_nav',
|
||||
'kg_page', 'kg_role', 'kg_setting', 'kg_vip',
|
||||
];
|
||||
|
||||
$tables = $this->db->listTables();
|
||||
|
@ -151,9 +151,6 @@ class RefundTask extends Task
|
||||
case OrderModel::ITEM_VIP:
|
||||
$this->handleVipOrderRefund($order);
|
||||
break;
|
||||
case OrderModel::ITEM_REWARD:
|
||||
$this->handleRewardOrderRefund($order);
|
||||
break;
|
||||
case OrderModel::ITEM_TEST:
|
||||
$this->handleTestOrderRefund($order);
|
||||
break;
|
||||
@ -230,16 +227,6 @@ class RefundTask extends Task
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理赞赏订单退款
|
||||
*
|
||||
* @param OrderModel $order
|
||||
*/
|
||||
protected function handleRewardOrderRefund(OrderModel $order)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理测试订单退款
|
||||
*
|
||||
|
@ -163,6 +163,9 @@ class Course extends Service
|
||||
|
||||
if (isset($post['published'])) {
|
||||
$data['published'] = $validator->checkPublishStatus($post['published']);
|
||||
if ($post['published'] == 1) {
|
||||
$validator->checkPublishAbility($course);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($post['category_id']) && !empty($post['category_id'])) {
|
||||
|
@ -29,7 +29,6 @@
|
||||
{% block include_js %}
|
||||
|
||||
{{ js_include('lib/kindeditor/kindeditor.min.js') }}
|
||||
{{ js_include('lib/kindeditor/lang/zh-CN.js') }}
|
||||
{{ js_include('admin/js/content.editor.js') }}
|
||||
|
||||
{% endblock %}
|
@ -39,7 +39,6 @@
|
||||
{% block include_js %}
|
||||
|
||||
{{ js_include('lib/kindeditor/kindeditor.min.js') }}
|
||||
{{ js_include('lib/kindeditor/lang/zh-CN.js') }}
|
||||
{{ js_include('admin/js/content.editor.js') }}
|
||||
|
||||
{% endblock %}
|
@ -33,7 +33,6 @@
|
||||
|
||||
{{ js_include('lib/xm-select.js') }}
|
||||
{{ js_include('lib/kindeditor/kindeditor.min.js') }}
|
||||
{{ js_include('lib/kindeditor/lang/zh-CN.js') }}
|
||||
{{ js_include('admin/js/content.editor.js') }}
|
||||
{{ js_include('admin/js/cover.upload.js') }}
|
||||
|
||||
|
@ -48,7 +48,6 @@
|
||||
{% if chapter.model == 3 %}
|
||||
|
||||
{{ js_include('lib/kindeditor/kindeditor.min.js') }}
|
||||
{{ js_include('lib/kindeditor/lang/zh-CN.js') }}
|
||||
{{ js_include('admin/js/content.editor.js') }}
|
||||
|
||||
{% elseif chapter.model == 1 %}
|
||||
|
@ -50,7 +50,6 @@
|
||||
{{ js_include('lib/xm-select.js') }}
|
||||
{{ js_include('lib/cos-js-sdk-v5.min.js') }}
|
||||
{{ js_include('lib/kindeditor/kindeditor.min.js') }}
|
||||
{{ js_include('lib/kindeditor/lang/zh-CN.js') }}
|
||||
{{ js_include('admin/js/content.editor.js') }}
|
||||
{{ js_include('admin/js/cover.upload.js') }}
|
||||
{{ js_include('admin/js/course.resource.js') }}
|
||||
|
@ -49,7 +49,6 @@
|
||||
{% block include_js %}
|
||||
|
||||
{{ js_include('lib/kindeditor/kindeditor.min.js') }}
|
||||
{{ js_include('lib/kindeditor/lang/zh-CN.js') }}
|
||||
{{ js_include('admin/js/content.editor.js') }}
|
||||
|
||||
{% endblock %}
|
@ -62,7 +62,6 @@
|
||||
{% block include_js %}
|
||||
|
||||
{{ js_include('lib/kindeditor/kindeditor.min.js') }}
|
||||
{{ js_include('lib/kindeditor/lang/zh-CN.js') }}
|
||||
{{ js_include('admin/js/content.editor.js') }}
|
||||
|
||||
{% endblock %}
|
@ -34,13 +34,6 @@
|
||||
</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% elseif order.item_type == 3 %}
|
||||
{% set course = order.item_info['course'] %}
|
||||
{% set reward = order.item_info['reward'] %}
|
||||
<div class="kg-order-item">
|
||||
<p>商品名称:{{ order.subject }}</p>
|
||||
<p>商品价格:{{ '¥%0.2f'|format(order.amount) }}</p>
|
||||
</div>
|
||||
{% elseif order.item_type == 4 %}
|
||||
{% set vip = order.item_info['vip'] %}
|
||||
<div class="kg-order-item">
|
||||
|
@ -32,7 +32,6 @@
|
||||
{% block include_js %}
|
||||
|
||||
{{ js_include('lib/kindeditor/kindeditor.min.js') }}
|
||||
{{ js_include('lib/kindeditor/lang/zh-CN.js') }}
|
||||
{{ js_include('admin/js/content.editor.js') }}
|
||||
|
||||
{% endblock %}
|
@ -51,7 +51,6 @@
|
||||
{% block include_js %}
|
||||
|
||||
{{ js_include('lib/kindeditor/kindeditor.min.js') }}
|
||||
{{ js_include('lib/kindeditor/lang/zh-CN.js') }}
|
||||
{{ js_include('admin/js/content.editor.js') }}
|
||||
|
||||
{% endblock %}
|
@ -18,7 +18,6 @@
|
||||
|
||||
{% if gift.type == 2 %}
|
||||
{{ js_include('lib/kindeditor/kindeditor.min.js') }}
|
||||
{{ js_include('lib/kindeditor/lang/zh-CN.js') }}
|
||||
{{ js_include('admin/js/content.editor.js') }}
|
||||
{{ js_include('admin/js/cover.upload.js') }}
|
||||
{% endif %}
|
||||
|
@ -33,7 +33,6 @@
|
||||
|
||||
{{ js_include('lib/xm-select.js') }}
|
||||
{{ js_include('lib/kindeditor/kindeditor.min.js') }}
|
||||
{{ js_include('lib/kindeditor/lang/zh-CN.js') }}
|
||||
{{ js_include('admin/js/content.editor.js') }}
|
||||
|
||||
{% endblock %}
|
||||
|
@ -21,13 +21,6 @@
|
||||
<p>退款金额:{{ '¥%0.2f'|format(course.refund_amount) }},退款比例:{{ 100 * course.refund_percent }}%</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% elseif confirm.item_type == 3 %}
|
||||
{% set course = confirm.item_info.course %}
|
||||
{% set reward = confirm.item_info.reward %}
|
||||
<div class="kg-order-item">
|
||||
<p>课程名称:{{ course.title }}</p>
|
||||
<p>赞赏金额:{{ '¥%0.2f'|format(reward.price) }}</p>
|
||||
</div>
|
||||
{% elseif confirm.item_type == 4 %}
|
||||
{% set vip = confirm.item_info.vip %}
|
||||
<div class="kg-order-item">
|
||||
|
@ -7,7 +7,6 @@
|
||||
|
||||
namespace App\Http\Api\Controllers;
|
||||
|
||||
use App\Services\Logic\Reward\OptionList as RewardOptionList;
|
||||
use App\Services\Logic\Vip\OptionList as VipOptionList;
|
||||
use App\Services\Service as AppService;
|
||||
use App\Traits\Response as ResponseTrait;
|
||||
@ -94,18 +93,6 @@ class PublicController extends Controller
|
||||
return $this->jsonSuccess($content);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Get("/reward/options", name="api.public.reward_options")
|
||||
*/
|
||||
public function rewardOptionsAction()
|
||||
{
|
||||
$service = new RewardOptionList();
|
||||
|
||||
$options = $service->handle();
|
||||
|
||||
return $this->jsonSuccess(['options' => $options]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Get("/vip/options", name="api.public.vip_options")
|
||||
*/
|
||||
|
@ -18,7 +18,6 @@ use App\Services\Logic\Course\RelatedList as CourseRelatedListService;
|
||||
use App\Services\Logic\Course\ResourceList as CourseResourceListService;
|
||||
use App\Services\Logic\Course\ReviewList as CourseReviewListService;
|
||||
use App\Services\Logic\Course\TopicList as CourseTopicListService;
|
||||
use App\Services\Logic\Reward\OptionList as RewardOptionList;
|
||||
use App\Services\Logic\Url\FullH5Url as FullH5UrlService;
|
||||
use Phalcon\Mvc\View;
|
||||
|
||||
@ -104,17 +103,12 @@ class CourseController extends Controller
|
||||
|
||||
$chapters = $service->handle($id);
|
||||
|
||||
$service = new RewardOptionList();
|
||||
|
||||
$rewards = $service->handle();
|
||||
|
||||
$this->seo->prependTitle(['课程', $course['title']]);
|
||||
$this->seo->setKeywords($course['keywords']);
|
||||
$this->seo->setDescription($course['summary']);
|
||||
|
||||
$this->view->setVar('course', $course);
|
||||
$this->view->setVar('chapters', $chapters);
|
||||
$this->view->setVar('rewards', $rewards);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -40,7 +40,6 @@
|
||||
{% block include_js %}
|
||||
|
||||
{{ js_include('lib/kindeditor/kindeditor.min.js') }}
|
||||
{{ js_include('lib/kindeditor/lang/zh-CN.js') }}
|
||||
{{ js_include('home/js/content.editor.js') }}
|
||||
{{ js_include('home/js/answer.edit.js') }}
|
||||
|
||||
|
@ -39,7 +39,6 @@
|
||||
{% block include_js %}
|
||||
|
||||
{{ js_include('lib/kindeditor/kindeditor.min.js') }}
|
||||
{{ js_include('lib/kindeditor/lang/zh-CN.js') }}
|
||||
{{ js_include('home/js/content.editor.js') }}
|
||||
{{ js_include('home/js/answer.edit.js') }}
|
||||
|
||||
|
@ -88,7 +88,6 @@
|
||||
|
||||
{{ js_include('lib/xm-select.js') }}
|
||||
{{ js_include('lib/kindeditor/kindeditor.min.js') }}
|
||||
{{ js_include('lib/kindeditor/lang/zh-CN.js') }}
|
||||
{{ js_include('home/js/content.editor.js') }}
|
||||
{{ js_include('home/js/article.edit.js') }}
|
||||
|
||||
|
@ -8,21 +8,4 @@
|
||||
<div class="sidebar wrap">
|
||||
<button class="layui-btn layui-btn-fluid layui-btn-danger btn-buy" data-url="{{ order_url }}">立即购买</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if course.me.allow_reward == 1 %}
|
||||
<div class="sidebar">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">赞赏支持</div>
|
||||
<div class="layui-card-body">
|
||||
<div class="sidebar-order">
|
||||
{% for reward in rewards %}
|
||||
{% set item_id = [course.id,reward.id]|join('-') %}
|
||||
{% set order_url = url({'for':'home.order.confirm'},{'item_id':item_id,'item_type':3}) %}
|
||||
<button class="layui-btn layui-btn-xs btn-reward" data-url="{{ order_url }}">{{ reward.title }}</button>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
@ -34,13 +34,6 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% elseif order.item_type == 3 %}
|
||||
{% set course = order.item_info.course %}
|
||||
{% set reward = order.item_info.reward %}
|
||||
<div class="order-item">
|
||||
<p>课程名称:{{ course.title }}</p>
|
||||
<p>赞赏金额:<em class="price">{{ '¥%0.2f'|format(reward.price) }}</em></p>
|
||||
</div>
|
||||
{% elseif order.item_type == 4 %}
|
||||
{% set vip = order.item_info.vip %}
|
||||
<div class="order-item">
|
||||
|
@ -42,32 +42,6 @@
|
||||
</div>
|
||||
{%- endmacro %}
|
||||
|
||||
{%- macro cart_reward_card(item_info) %}
|
||||
{% set course = item_info.course %}
|
||||
{% set reward = item_info.reward %}
|
||||
{% set course_url = url({'for':'home.course.show','id':course.id}) %}
|
||||
<div class="cart-item-card">
|
||||
<div class="cover">
|
||||
<img src="{{ course.cover }}!cover_270" alt="{{ course.title }}">
|
||||
</div>
|
||||
<div class="info">
|
||||
<p><a href="{{ course_url }}" target="_blank">{{ course.title }}</a></p>
|
||||
<p>
|
||||
<span class="key">赞赏金额</span>
|
||||
<span class="price">{{ '¥%0.2f'|format(reward.price) }}</span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="key">难度</span>
|
||||
<span class="value">{{ level_type(course.level) }}</span>
|
||||
<span class="key">课时</span>
|
||||
<span class="value">{{ course.lesson_count }}</span>
|
||||
<span class="key">学员</span>
|
||||
<span class="value">{{ course.user_count }}</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{%- endmacro %}
|
||||
|
||||
{%- macro cart_vip_card(item_info) %}
|
||||
{% set vip = item_info.vip %}
|
||||
<div class="cart-item-card">
|
||||
@ -102,8 +76,6 @@
|
||||
{% for course in package.courses %}
|
||||
{{ cart_course_card(course) }}
|
||||
{% endfor %}
|
||||
{% elseif confirm.item_type == 3 %}
|
||||
{{ cart_reward_card(confirm.item_info) }}
|
||||
{% elseif confirm.item_type == 4 %}
|
||||
{{ cart_vip_card(confirm.item_info) }}
|
||||
{% endif %}
|
||||
|
@ -68,7 +68,6 @@
|
||||
|
||||
{{ js_include('lib/xm-select.js') }}
|
||||
{{ js_include('lib/kindeditor/kindeditor.min.js') }}
|
||||
{{ js_include('lib/kindeditor/lang/zh-CN.js') }}
|
||||
{{ js_include('home/js/content.editor.js') }}
|
||||
{{ js_include('home/js/question.edit.js') }}
|
||||
|
||||
|
@ -92,8 +92,8 @@ class FileInfo
|
||||
'svg' => ['image/svg+xml'],
|
||||
'psd' => ['image/vnd.adobe.photoshop'],
|
||||
|
||||
'rar' => ['application/x-rar', 'application/x-rar-compressed','application/vnd.rar'],
|
||||
'zip' => ['application/zip','application/x-zip-compressed','multipart/x-zip'],
|
||||
'rar' => ['application/x-rar', 'application/x-rar-compressed', 'application/vnd.rar'],
|
||||
'zip' => ['application/zip', 'application/x-zip-compressed', 'multipart/x-zip'],
|
||||
'tar' => ['application/x-tar'],
|
||||
'7z' => ['application/x-7z-compressed'],
|
||||
'bz' => ['application/x-bzip'],
|
||||
@ -102,17 +102,43 @@ class FileInfo
|
||||
|
||||
'txt' => ['text/plain'],
|
||||
'csv' => ['text/csv'],
|
||||
'pdf' => ['application/pdf'],
|
||||
'json' => ['application/json'],
|
||||
'xml' => ['application/xml'],
|
||||
|
||||
'ofd' => ['application/octet-stream'],
|
||||
'pdf' => ['application/pdf'],
|
||||
'doc' => ['application/msword', 'application/CDFV2'],
|
||||
'docm' => ['application/vnd.ms-word.document.macroenabled.12'],
|
||||
'docx' => ['application/vnd.openxmlformats-officedocument.wordprocessingml.document'],
|
||||
'dot' => ['application/msword'],
|
||||
'dotm' => ['application/vnd.ms-word.template.macroenabled.12'],
|
||||
'dotx' => ['application/vnd.openxmlformats-officedocument.wordprocessingml.template'],
|
||||
|
||||
'ppt' => ['application/vnd.ms-powerpoint'],
|
||||
'pptm' => ['application/vnd.ms-powerpoint.presentation.macroenabled.12'],
|
||||
'pptx' => ['application/vnd.openxmlformats-officedocument.presentationml.presentation'],
|
||||
'pot' => ['application/vnd.ms-powerpoint'],
|
||||
'potm' => ['application/vnd.ms-powerpoint.template.macroenabled.12'],
|
||||
'potx' => ['application/vnd.openxmlformats-officedocument.presentationml.template'],
|
||||
'pps' => ['application/vnd.ms-powerpoint'],
|
||||
'ppsm' => ['application/vnd.ms-powerpoint.slideshow.macroenabled.12'],
|
||||
'ppsx' => ['application/vnd.openxmlformats-officedocument.presentationml.slideshow'],
|
||||
|
||||
'xls' => ['application/vnd.ms-excel'],
|
||||
'xlsb' => ['application/vnd.ms-excel.sheet.binary.macroenabled.12'],
|
||||
'xlsm' => ['application/vnd.ms-excel.sheet.macroenabled.12'],
|
||||
'xlsx' => ['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],
|
||||
'xlt' => ['application/vnd.ms-excel'],
|
||||
'xltm' => ['application/vnd.ms-excel.template.macroenabled.12'],
|
||||
'xltx' => ['application/vnd.openxmlformats-officedocument.spreadsheetml.template'],
|
||||
|
||||
'wps' => ['application/msword'],
|
||||
'wpt' => ['application/msword'],
|
||||
'dpt' => ['application/vnd.ms-powerpoint'],
|
||||
'dps' => ['application/vnd.ms-powerpoint'],
|
||||
'et' => ['application/vnd.ms-excel'],
|
||||
'ett' => ['application/vnd.ms-excel'],
|
||||
|
||||
'ofd' => ['application/octet-stream'],
|
||||
'swf' => ['application/x-shockwave-flash'],
|
||||
'vsd' => ['application/vnd.visio'],
|
||||
'rtf' => ['application/rtf'],
|
||||
|
@ -56,6 +56,7 @@ class Chapter extends Model
|
||||
* 图文扩展属性
|
||||
*/
|
||||
protected $_read_attrs = [
|
||||
'format' => 'html',
|
||||
'duration' => 0,
|
||||
'word_count' => 0,
|
||||
];
|
||||
|
@ -17,7 +17,7 @@ class Order extends Model
|
||||
*/
|
||||
const ITEM_COURSE = 1; // 课程
|
||||
const ITEM_PACKAGE = 2; // 套餐
|
||||
const ITEM_REWARD = 3; // 赞赏
|
||||
const ITEM_REWARD = 3; // 赞赏(已弃用)
|
||||
const ITEM_VIP = 4; // 会员
|
||||
const ITEM_TEST = 99; // 测试
|
||||
|
||||
@ -190,7 +190,6 @@ class Order extends Model
|
||||
return [
|
||||
self::ITEM_COURSE => '课程',
|
||||
self::ITEM_PACKAGE => '套餐',
|
||||
self::ITEM_REWARD => '赞赏',
|
||||
self::ITEM_VIP => '会员',
|
||||
self::ITEM_TEST => '测试',
|
||||
];
|
||||
|
@ -1,89 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 深圳市酷瓜软件有限公司
|
||||
* @license https://opensource.org/licenses/GPL-2.0
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Phalcon\Mvc\Model\Behavior\SoftDelete;
|
||||
|
||||
class Reward extends Model
|
||||
{
|
||||
|
||||
/**
|
||||
* 主键编号
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $id = 0;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $title = '';
|
||||
|
||||
/**
|
||||
* 价格
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
public $price = 0.00;
|
||||
|
||||
/**
|
||||
* 删除标识
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $deleted = 0;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $create_time = 0;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $update_time = 0;
|
||||
|
||||
public function getSource(): string
|
||||
{
|
||||
return 'kg_reward';
|
||||
}
|
||||
|
||||
public function initialize()
|
||||
{
|
||||
parent::initialize();
|
||||
|
||||
$this->addBehavior(
|
||||
new SoftDelete([
|
||||
'field' => 'deleted',
|
||||
'value' => 1,
|
||||
])
|
||||
);
|
||||
}
|
||||
|
||||
public function beforeCreate()
|
||||
{
|
||||
$this->create_time = time();
|
||||
}
|
||||
|
||||
public function beforeUpdate()
|
||||
{
|
||||
$this->update_time = time();
|
||||
}
|
||||
|
||||
public function afterFetch()
|
||||
{
|
||||
$this->price = (float)$this->price;
|
||||
}
|
||||
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 深圳市酷瓜软件有限公司
|
||||
* @license https://opensource.org/licenses/GPL-2.0
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Repos;
|
||||
|
||||
use App\Models\Reward as RewardModel;
|
||||
use Phalcon\Mvc\Model;
|
||||
use Phalcon\Mvc\Model\Resultset;
|
||||
use Phalcon\Mvc\Model\ResultsetInterface;
|
||||
|
||||
class Reward extends Repository
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array $where
|
||||
* @return ResultsetInterface|Resultset|RewardModel[]
|
||||
*/
|
||||
public function findAll($where = [])
|
||||
{
|
||||
$query = RewardModel::query();
|
||||
|
||||
$query->where('1 = 1');
|
||||
|
||||
if (isset($where['deleted'])) {
|
||||
$query->andWhere('deleted = :deleted:', ['deleted' => $where['deleted']]);
|
||||
}
|
||||
|
||||
return $query->execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @return RewardModel|Model|bool
|
||||
*/
|
||||
public function findById($id)
|
||||
{
|
||||
return RewardModel::findFirst([
|
||||
'conditions' => 'id = :id:',
|
||||
'bind' => ['id' => $id],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $ids
|
||||
* @param array|string $columns
|
||||
* @return ResultsetInterface|Resultset|RewardModel[]
|
||||
*/
|
||||
public function findByIds($ids, $columns = '*')
|
||||
{
|
||||
return RewardModel::query()
|
||||
->columns($columns)
|
||||
->inWhere('id', $ids)
|
||||
->execute();
|
||||
}
|
||||
|
||||
}
|
@ -45,8 +45,8 @@ class CourseInfo extends LogicService
|
||||
{
|
||||
$me = [
|
||||
'plan_id' => 0,
|
||||
'allow_study' => 0,
|
||||
'allow_order' => 0,
|
||||
'allow_reward' => 0,
|
||||
'progress' => 0,
|
||||
'logged' => 0,
|
||||
'joined' => 0,
|
||||
@ -66,14 +66,6 @@ class CourseInfo extends LogicService
|
||||
$caseModel = $course->attrs['end_date'] < date('Y-m-d');
|
||||
}
|
||||
|
||||
if ($caseOwned && $casePrice && $caseModel) {
|
||||
$me['allow_order'] = 1;
|
||||
}
|
||||
|
||||
if ($course->market_price == 0) {
|
||||
$me['allow_reward'] = 1;
|
||||
}
|
||||
|
||||
if ($user->id > 0) {
|
||||
|
||||
$me['logged'] = 1;
|
||||
@ -82,8 +74,8 @@ class CourseInfo extends LogicService
|
||||
$me['allow_order'] = 1;
|
||||
}
|
||||
|
||||
if ($course->market_price == 0) {
|
||||
$me['allow_reward'] = 1;
|
||||
if ($this->ownedCourse && $course->model != CourseModel::MODEL_OFFLINE) {
|
||||
$me['allow_study'] = 1;
|
||||
}
|
||||
|
||||
if ($this->joinedCourse) {
|
||||
|
@ -10,7 +10,6 @@ namespace App\Services\Logic\Order;
|
||||
use App\Models\Course as CourseModel;
|
||||
use App\Models\Order as OrderModel;
|
||||
use App\Models\Package as PackageModel;
|
||||
use App\Models\Reward as RewardModel;
|
||||
use App\Models\Vip as VipModel;
|
||||
use App\Repos\Package as PackageRepo;
|
||||
use App\Services\Logic\Service as LogicService;
|
||||
@ -66,20 +65,6 @@ class OrderConfirm extends LogicService
|
||||
$result['total_amount'] = $vip->price;
|
||||
$result['pay_amount'] = $vip->price;
|
||||
$result['discount_amount'] = 0;
|
||||
|
||||
} elseif ($itemType == OrderModel::ITEM_REWARD) {
|
||||
|
||||
list($courseId, $rewardId) = explode('-', $itemId);
|
||||
|
||||
$course = $validator->checkCourse($courseId);
|
||||
$reward = $validator->checkReward($rewardId);
|
||||
|
||||
$result['item_info']['course'] = $this->handleCourseInfo($course);
|
||||
$result['item_info']['reward'] = $this->handleRewardInfo($reward);
|
||||
|
||||
$result['total_amount'] = $reward->price;
|
||||
$result['pay_amount'] = $reward->price;
|
||||
$result['discount_amount'] = 0;
|
||||
}
|
||||
|
||||
$validator->checkAmount($result['pay_amount']);
|
||||
@ -123,15 +108,6 @@ class OrderConfirm extends LogicService
|
||||
];
|
||||
}
|
||||
|
||||
protected function handleRewardInfo(RewardModel $reward)
|
||||
{
|
||||
return [
|
||||
'id' => $reward->id,
|
||||
'title' => $reward->title,
|
||||
'price' => $reward->price,
|
||||
];
|
||||
}
|
||||
|
||||
protected function formatCourseInfo(CourseModel $course)
|
||||
{
|
||||
return [
|
||||
|
@ -10,7 +10,6 @@ namespace App\Services\Logic\Order;
|
||||
use App\Models\Course as CourseModel;
|
||||
use App\Models\Order as OrderModel;
|
||||
use App\Models\Package as PackageModel;
|
||||
use App\Models\Reward as RewardModel;
|
||||
use App\Models\User as UserModel;
|
||||
use App\Models\Vip as VipModel;
|
||||
use App\Repos\Package as PackageRepo;
|
||||
@ -69,19 +68,6 @@ class OrderCreate extends LogicService
|
||||
|
||||
$order = $this->createPackageOrder($package, $user);
|
||||
|
||||
} elseif ($post['item_type'] == OrderModel::ITEM_REWARD) {
|
||||
|
||||
list($courseId, $rewardId) = explode('-', $post['item_id']);
|
||||
|
||||
$course = $orderValidator->checkCourse($courseId);
|
||||
$reward = $orderValidator->checkReward($rewardId);
|
||||
|
||||
$this->amount = $reward->price;
|
||||
|
||||
$orderValidator->checkAmount($this->amount);
|
||||
|
||||
$order = $this->createRewardOrder($course, $reward, $user);
|
||||
|
||||
} elseif ($post['item_type'] == OrderModel::ITEM_VIP) {
|
||||
|
||||
$vip = $orderValidator->checkVip($post['item_id']);
|
||||
@ -186,33 +172,6 @@ class OrderCreate extends LogicService
|
||||
return $order;
|
||||
}
|
||||
|
||||
protected function createRewardOrder(CourseModel $course, RewardModel $reward, UserModel $user)
|
||||
{
|
||||
$itemInfo = [
|
||||
'course' => $this->handleCourseInfo($course),
|
||||
'reward' => [
|
||||
'id' => $reward->id,
|
||||
'title' => $reward->title,
|
||||
'price' => $reward->price,
|
||||
]
|
||||
];
|
||||
|
||||
$order = new OrderModel();
|
||||
|
||||
$order->owner_id = $user->id;
|
||||
$order->item_id = $course->id;
|
||||
$order->item_type = OrderModel::ITEM_REWARD;
|
||||
$order->item_info = $itemInfo;
|
||||
$order->client_type = $this->getClientType();
|
||||
$order->client_ip = $this->getClientIp();
|
||||
$order->subject = "赞赏 - {$course->title}";
|
||||
$order->amount = $this->amount;
|
||||
|
||||
$order->create();
|
||||
|
||||
return $order;
|
||||
}
|
||||
|
||||
protected function handleCourseInfo(CourseModel $course)
|
||||
{
|
||||
$studyExpiryTime = strtotime("+{$course->study_expiry} months");
|
||||
|
@ -140,9 +140,6 @@ class OrderInfo extends LogicService
|
||||
case OrderModel::ITEM_VIP:
|
||||
$result = $this->handleVipInfo($itemInfo);
|
||||
break;
|
||||
case OrderModel::ITEM_REWARD:
|
||||
$result = $this->handleRewardInfo($itemInfo);
|
||||
break;
|
||||
case OrderModel::ITEM_TEST:
|
||||
$result = $this->handleTestInfo($itemInfo);
|
||||
break;
|
||||
@ -174,11 +171,6 @@ class OrderInfo extends LogicService
|
||||
return $itemInfo;
|
||||
}
|
||||
|
||||
protected function handleRewardInfo($itemInfo)
|
||||
{
|
||||
return $itemInfo;
|
||||
}
|
||||
|
||||
protected function handleTestInfo($itemInfo)
|
||||
{
|
||||
return $itemInfo;
|
||||
|
@ -1,39 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 深圳市酷瓜软件有限公司
|
||||
* @license https://opensource.org/licenses/GPL-2.0
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Reward;
|
||||
|
||||
use App\Repos\Reward as RewardRepo;
|
||||
use App\Services\Logic\Service as LogicService;
|
||||
|
||||
class OptionList extends LogicService
|
||||
{
|
||||
|
||||
public function handle()
|
||||
{
|
||||
$rewardRepo = new RewardRepo();
|
||||
|
||||
$rewards = $rewardRepo->findAll(['deleted' => 0]);
|
||||
|
||||
if ($rewards->count() == 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$result = [];
|
||||
|
||||
foreach ($rewards as $reward) {
|
||||
$result[] = [
|
||||
'id' => $reward->id,
|
||||
'title' => $reward->title,
|
||||
'price' => $reward->price,
|
||||
];
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
@ -33,9 +33,6 @@ class Refund extends Service
|
||||
case OrderModel::ITEM_PACKAGE:
|
||||
$result = $this->previewPackageRefund($order);
|
||||
break;
|
||||
case OrderModel::ITEM_REWARD:
|
||||
$result = $this->previewRewardRefund($order);
|
||||
break;
|
||||
case OrderModel::ITEM_VIP:
|
||||
$result = $this->previewVipRefund($order);
|
||||
break;
|
||||
@ -121,11 +118,6 @@ class Refund extends Service
|
||||
];
|
||||
}
|
||||
|
||||
protected function previewRewardRefund(OrderModel $order)
|
||||
{
|
||||
return $this->previewOtherRefund($order);
|
||||
}
|
||||
|
||||
protected function previewVipRefund(OrderModel $order)
|
||||
{
|
||||
return $this->previewOtherRefund($order);
|
||||
|
@ -258,4 +258,25 @@ class Course extends Validator
|
||||
return $status;
|
||||
}
|
||||
|
||||
public function checkPublishAbility(CourseModel $course)
|
||||
{
|
||||
$courseRepo = new CourseRepo();
|
||||
|
||||
$lessons = $courseRepo->findLessons($course->id);
|
||||
|
||||
$ability = false;
|
||||
|
||||
if ($lessons->count() > 0) {
|
||||
foreach ($lessons as $lesson) {
|
||||
if ($lesson->published == 1) {
|
||||
$ability = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$ability) {
|
||||
throw new BadRequestException('course.content_not_ready');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ use App\Models\Trade as TradeModel;
|
||||
use App\Repos\Course as CourseRepo;
|
||||
use App\Repos\Order as OrderRepo;
|
||||
use App\Repos\Package as PackageRepo;
|
||||
use App\Repos\Reward as RewardRepo;
|
||||
use App\Repos\Vip as VipRepo;
|
||||
|
||||
class Order extends Validator
|
||||
@ -101,19 +100,6 @@ class Order extends Validator
|
||||
return $vip;
|
||||
}
|
||||
|
||||
public function checkReward($itemId)
|
||||
{
|
||||
$rewardRepo = new RewardRepo();
|
||||
|
||||
$reward = $rewardRepo->findById($itemId);
|
||||
|
||||
if (!$reward) {
|
||||
throw new BadRequestException('order.item_not_found');
|
||||
}
|
||||
|
||||
return $reward;
|
||||
}
|
||||
|
||||
public function checkAmount($amount)
|
||||
{
|
||||
$value = $this->filter->sanitize($amount, ['trim', 'float']);
|
||||
|
@ -1,57 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 深圳市酷瓜软件有限公司
|
||||
* @license https://opensource.org/licenses/GPL-2.0
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Validators;
|
||||
|
||||
use App\Exceptions\BadRequest as BadRequestException;
|
||||
use App\Repos\Reward as RewardRepo;
|
||||
|
||||
class Reward extends Validator
|
||||
{
|
||||
|
||||
public function checkReward($id)
|
||||
{
|
||||
$rewardRepo = new RewardRepo();
|
||||
|
||||
$reward = $rewardRepo->findById($id);
|
||||
|
||||
if (!$reward) {
|
||||
throw new BadRequestException('reward.not_found');
|
||||
}
|
||||
|
||||
return $reward;
|
||||
}
|
||||
|
||||
public function checkTitle($title)
|
||||
{
|
||||
$value = $this->filter->sanitize($title, ['trim', 'string']);
|
||||
|
||||
$length = kg_strlen($value);
|
||||
|
||||
if ($length < 2) {
|
||||
throw new BadRequestException('reward.title_too_short');
|
||||
}
|
||||
|
||||
if ($length > 30) {
|
||||
throw new BadRequestException('reward.title_too_long');
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function checkPrice($price)
|
||||
{
|
||||
$value = $this->filter->sanitize($price, ['trim', 'float']);
|
||||
|
||||
if ($value < 0.01 || $value > 10000) {
|
||||
throw new BadRequestException('reward.invalid_price');
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
}
|
@ -5,9 +5,9 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
define('ENV_DEV', 'dev');
|
||||
define('ENV_TEST', 'test');
|
||||
define('ENV_PRO', 'pro');
|
||||
const ENV_DEV = 'dev';
|
||||
const ENV_TEST = 'test';
|
||||
const ENV_PRO = 'pro';
|
||||
|
||||
/**
|
||||
* Get the root path.
|
||||
|
@ -187,7 +187,7 @@ $error['course.invalid_study_expiry'] = '无效的学习期限';
|
||||
$error['course.invalid_refund_expiry'] = '无效的退款期限';
|
||||
$error['course.invalid_feature_status'] = '无效的推荐状态';
|
||||
$error['course.invalid_publish_status'] = '无效的发布状态';
|
||||
$error['course.teacher_not_assigned'] = '尚未指定授课教师';
|
||||
$error['course.content_not_ready'] = '课程内容未就绪';
|
||||
|
||||
/**
|
||||
* 面授课程相关
|
||||
@ -220,14 +220,6 @@ $error['package.invalid_market_price'] = '无效的优惠价格';
|
||||
$error['package.invalid_vip_price'] = '无效的会员价格';
|
||||
$error['package.invalid_publish_status'] = '无效的发布状态';
|
||||
|
||||
/**
|
||||
* 赞赏相关
|
||||
*/
|
||||
$error['reward.not_found'] = '赞赏不存在';
|
||||
$error['reward.title_too_short'] = '标题太短(少于5个字符)';
|
||||
$error['reward.title_too_long'] = '标题太长(多于30个字符)';
|
||||
$error['reward.invalid_price'] = '无效的金额(范围:0.01-10000)';
|
||||
|
||||
/**
|
||||
* 会员相关
|
||||
*/
|
||||
|
@ -64,7 +64,6 @@ final class V20210324064239 extends AbstractMigration
|
||||
$this->createResourceTable();
|
||||
$this->createReviewTable();
|
||||
$this->createReviewLikeTable();
|
||||
$this->createRewardTable();
|
||||
$this->createRoleTable();
|
||||
$this->createSettingTable();
|
||||
$this->createSlideTable();
|
||||
@ -5571,72 +5570,6 @@ final class V20210324064239 extends AbstractMigration
|
||||
->create();
|
||||
}
|
||||
|
||||
protected function createRewardTable()
|
||||
{
|
||||
$tableName = 'kg_reward';
|
||||
|
||||
if ($this->table($tableName)->exists()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->table($tableName, [
|
||||
'id' => false,
|
||||
'primary_key' => ['id'],
|
||||
'engine' => 'InnoDB',
|
||||
'encoding' => 'utf8mb4',
|
||||
'collation' => 'utf8mb4_general_ci',
|
||||
'comment' => '',
|
||||
'row_format' => 'DYNAMIC',
|
||||
])
|
||||
->addColumn('id', 'integer', [
|
||||
'null' => false,
|
||||
'limit' => MysqlAdapter::INT_SMALL,
|
||||
'comment' => '主键编号',
|
||||
])
|
||||
->addColumn('title', 'string', [
|
||||
'null' => false,
|
||||
'default' => '',
|
||||
'limit' => 100,
|
||||
'collation' => 'utf8mb4_general_ci',
|
||||
'encoding' => 'utf8mb4',
|
||||
'comment' => '标题',
|
||||
'after' => 'id',
|
||||
])
|
||||
->addColumn('price', 'decimal', [
|
||||
'null' => false,
|
||||
'default' => '0.00',
|
||||
'precision' => '10',
|
||||
'scale' => '2',
|
||||
'comment' => '价格',
|
||||
'after' => 'title',
|
||||
])
|
||||
->addColumn('deleted', 'integer', [
|
||||
'null' => false,
|
||||
'default' => '0',
|
||||
'limit' => MysqlAdapter::INT_REGULAR,
|
||||
'signed' => false,
|
||||
'comment' => '删除标识',
|
||||
'after' => 'price',
|
||||
])
|
||||
->addColumn('create_time', 'integer', [
|
||||
'null' => false,
|
||||
'default' => '0',
|
||||
'limit' => MysqlAdapter::INT_REGULAR,
|
||||
'signed' => false,
|
||||
'comment' => '创建时间',
|
||||
'after' => 'deleted',
|
||||
])
|
||||
->addColumn('update_time', 'integer', [
|
||||
'null' => false,
|
||||
'default' => '0',
|
||||
'limit' => MysqlAdapter::INT_REGULAR,
|
||||
'signed' => false,
|
||||
'comment' => '更新时间',
|
||||
'after' => 'create_time',
|
||||
])
|
||||
->create();
|
||||
}
|
||||
|
||||
protected function createRoleTable()
|
||||
{
|
||||
$tableName = 'kg_role';
|
||||
|
@ -15,7 +15,6 @@ final class V20210403184518 extends AbstractMigration
|
||||
$this->initSettingData();
|
||||
$this->initUserData();
|
||||
$this->initRoleData();
|
||||
$this->initRewardData();
|
||||
$this->initNavData();
|
||||
$this->initVipData();
|
||||
}
|
||||
@ -285,52 +284,6 @@ final class V20210403184518 extends AbstractMigration
|
||||
$this->table('kg_vip')->insert($rows)->save();
|
||||
}
|
||||
|
||||
protected function initRewardData()
|
||||
{
|
||||
$now = time();
|
||||
|
||||
$rows = [
|
||||
[
|
||||
'id' => 1,
|
||||
'title' => '2元',
|
||||
'price' => 2.00,
|
||||
'create_time' => $now,
|
||||
],
|
||||
[
|
||||
'id' => 2,
|
||||
'title' => '5元',
|
||||
'price' => 5.00,
|
||||
'create_time' => $now,
|
||||
],
|
||||
[
|
||||
'id' => 3,
|
||||
'title' => '10元',
|
||||
'price' => 10.00,
|
||||
'create_time' => $now,
|
||||
],
|
||||
[
|
||||
'id' => 4,
|
||||
'title' => '20元',
|
||||
'price' => 20.00,
|
||||
'create_time' => $now,
|
||||
],
|
||||
[
|
||||
'id' => 5,
|
||||
'title' => '50元',
|
||||
'price' => 50.00,
|
||||
'create_time' => $now,
|
||||
],
|
||||
[
|
||||
'id' => 6,
|
||||
'title' => '100元',
|
||||
'price' => 100.00,
|
||||
'create_time' => $now,
|
||||
],
|
||||
];
|
||||
|
||||
$this->table('kg_reward')->insert($rows)->save();
|
||||
}
|
||||
|
||||
protected function initSettingData()
|
||||
{
|
||||
$rows = [
|
||||
|
27
db/migrations/20240608110418.php
Normal file
27
db/migrations/20240608110418.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2024 深圳市酷瓜软件有限公司
|
||||
* @license https://opensource.org/licenses/GPL-2.0
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class V20240608110418 extends AbstractMigration
|
||||
{
|
||||
|
||||
public function up()
|
||||
{
|
||||
$this->dropRewardTable();
|
||||
}
|
||||
|
||||
protected function dropRewardTable()
|
||||
{
|
||||
$table = $this->table('kg_reward');
|
||||
|
||||
if ($table->exists()) {
|
||||
$table->drop()->save();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1185,11 +1185,6 @@
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.sidebar-order .btn-reward {
|
||||
width: 84px;
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.sidebar-user-card {
|
||||
display: flex;
|
||||
margin-bottom: 10px;
|
||||
|
@ -49,16 +49,6 @@ layui.use(['jquery', 'layer', 'helper'], function () {
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* 打赏
|
||||
*/
|
||||
$('.btn-reward').on('click', function () {
|
||||
var url = $(this).data('url');
|
||||
helper.checkLogin(function () {
|
||||
window.location.href = url;
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* 购买(课程|套餐)
|
||||
*/
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user