From 840457e5afcdcaf8af804f3a2e2e9c245aba8579 Mon Sep 17 00:00:00 2001 From: winzer Date: Tue, 26 Jan 2021 17:13:07 +0800 Subject: [PATCH 01/16] =?UTF-8?q?course=E5=92=8Cchapter=E5=A2=9E=E5=8A=A0r?= =?UTF-8?q?esource=5Fcount=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20210126081614_schema_202101261615.php | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 db/migrations/20210126081614_schema_202101261615.php diff --git a/db/migrations/20210126081614_schema_202101261615.php b/db/migrations/20210126081614_schema_202101261615.php new file mode 100644 index 00000000..b2207b52 --- /dev/null +++ b/db/migrations/20210126081614_schema_202101261615.php @@ -0,0 +1,85 @@ +table('kg_course'); + + if ($courseTable->hasColumn('resource_count') == false) { + $courseTable->addColumn('resource_count', 'integer', [ + 'null' => false, + 'default' => '0', + 'limit' => MysqlAdapter::INT_REGULAR, + 'signed' => false, + 'comment' => '资源数', + 'after' => 'deleted', + ])->save(); + } + + $chapterTable = $this->table('kg_chapter'); + + if ($chapterTable->hasColumn('resource_count') == false) { + $chapterTable->addColumn('resource_count', 'integer', [ + 'null' => false, + 'default' => '0', + 'limit' => MysqlAdapter::INT_REGULAR, + 'signed' => false, + 'comment' => '资源数', + 'after' => 'deleted', + ])->save(); + } + + /** + * 补救前期遗漏,重新统计数据 + */ + $this->recount(); + } + + protected function recount() + { + $resources = $this->getQueryBuilder()->select('*')->from('kg_resource')->execute(); + + $courseMappings = []; + $chapterMappings = []; + + if ($resources->count() > 0) { + foreach ($resources as $resource) { + $courseId = $resource['course_id']; + $chapterId = $resource['chapter_id']; + $courseMappings[$courseId] = isset($courseMappings[$courseId]) ? $courseMappings[$courseId] + 1 : 1; + $chapterMappings[$chapterId] = isset($chapterMappings[$chapterId]) ? $chapterMappings[$chapterId] + 1 : 1; + } + $this->recountCourseResource($courseMappings); + $this->recountChapterResource($chapterMappings); + } + } + + protected function recountCourseResource($mappings) + { + $builder = $this->getQueryBuilder(); + + foreach ($mappings as $courseId => $resourceCount) { + $builder->update('kg_course') + ->set('resource_count', $resourceCount) + ->where(['id' => $courseId]) + ->execute(); + } + } + + protected function recountChapterResource($mappings) + { + $builder = $this->getQueryBuilder(); + + foreach ($mappings as $chapterId => $resourceCount) { + $builder->update('kg_chapter') + ->set('resource_count', $resourceCount) + ->where(['id' => $chapterId]) + ->execute(); + } + } + +} From 098595b98178528bed674197e3feeb59a52deb95 Mon Sep 17 00:00:00 2001 From: winzer Date: Fri, 29 Jan 2021 15:17:12 +0800 Subject: [PATCH 02/16] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=95=99=E5=B8=88?= =?UTF-8?q?=E7=9B=B4=E6=92=AD=E9=A1=B5=E9=9D=A2=E6=8E=A8=E6=B5=81=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E6=97=A0=E5=8F=8D=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Home/Views/teacher/console/lives.volt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Home/Views/teacher/console/lives.volt b/app/Http/Home/Views/teacher/console/lives.volt index f247765d..0cf15df1 100644 --- a/app/Http/Home/Views/teacher/console/lives.volt +++ b/app/Http/Home/Views/teacher/console/lives.volt @@ -61,6 +61,6 @@ {% block include_js %} - {{ js_include('home/js/console.js') }} + {{ js_include('home/js/teacher.console.js') }} {% endblock %} \ No newline at end of file From 491c5d36882c6ff9d5afeabe2443e284a0a65cab Mon Sep 17 00:00:00 2001 From: winzer Date: Wed, 3 Feb 2021 12:41:19 +0800 Subject: [PATCH 03/16] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8E=9F=E5=A7=8B?= =?UTF-8?q?=E4=BB=B7=E6=A0=BC=EF=BC=8C=E5=B8=82=E5=9C=BA=E4=BB=B7=E6=94=B9?= =?UTF-8?q?=E5=90=8D=E4=B8=BA=E4=BC=98=E6=83=A0=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Caches/PackageCourseList.php | 1 + app/Http/Admin/Services/Course.php | 1 + app/Http/Admin/Views/course/edit_sale.volt | 11 +++++++- app/Http/Admin/Views/course/list.volt | 5 ++-- app/Http/Admin/Views/order/macro.volt | 4 +-- app/Http/Admin/Views/package/edit.volt | 2 +- app/Http/Admin/Views/package/guiding.volt | 4 +-- app/Http/Admin/Views/package/list.volt | 2 +- app/Http/Home/Views/course/packages.volt | 2 +- app/Http/Home/Views/course/show_meta.volt | 5 ++-- app/Http/Home/Views/macros/order.volt | 4 +-- app/Http/Home/Views/order/confirm.volt | 3 ++- app/Models/Course.php | 14 +++++++++- app/Models/Package.php | 2 +- app/Services/Logic/Course/BasicInfo.php | 1 + app/Services/Logic/Course/PackageList.php | 2 +- app/Services/Logic/Order/OrderConfirm.php | 5 ++-- app/Validators/Course.php | 11 ++++++++ config/errors.php | 7 ++--- db/migrations/20200827063842_init_table.php | 4 +-- .../20210203081614_schema_202102031615.php | 27 +++++++++++++++++++ db/migrations/schema.php | 4 +-- public/static/admin/js/xm-course.js | 2 +- public/static/home/css/common.css | 8 ++++++ 24 files changed, 103 insertions(+), 28 deletions(-) create mode 100644 db/migrations/20210203081614_schema_202102031615.php diff --git a/app/Caches/PackageCourseList.php b/app/Caches/PackageCourseList.php index 74f005e5..144e4481 100644 --- a/app/Caches/PackageCourseList.php +++ b/app/Caches/PackageCourseList.php @@ -46,6 +46,7 @@ class PackageCourseList extends Cache 'id' => $course->id, 'title' => $course->title, 'cover' => $course->cover, + 'origin_price' => $course->origin_price, 'market_price' => $course->market_price, 'vip_price' => $course->vip_price, 'model' => $course->model, diff --git a/app/Http/Admin/Services/Course.php b/app/Http/Admin/Services/Course.php index 94525b17..59e06038 100644 --- a/app/Http/Admin/Services/Course.php +++ b/app/Http/Admin/Services/Course.php @@ -164,6 +164,7 @@ class Course extends Service $data['market_price'] = 0; $data['vip_price'] = 0; } else { + $data['origin_price'] = $validator->checkMarketPrice($post['origin_price']); $data['market_price'] = $validator->checkMarketPrice($post['market_price']); $data['vip_price'] = $validator->checkVipPrice($post['vip_price']); $validator->checkComparePrice($post['market_price'], $post['vip_price']); diff --git a/app/Http/Admin/Views/course/edit_sale.volt b/app/Http/Admin/Views/course/edit_sale.volt index 071da233..039907e7 100644 --- a/app/Http/Admin/Views/course/edit_sale.volt +++ b/app/Http/Admin/Views/course/edit_sale.volt @@ -12,7 +12,16 @@
- + +
+ +
+
+
+
+
+
+
diff --git a/app/Http/Admin/Views/course/list.volt b/app/Http/Admin/Views/course/list.volt index 4a2a84ce..ed9d18dc 100644 --- a/app/Http/Admin/Views/course/list.volt +++ b/app/Http/Admin/Views/course/list.volt @@ -100,8 +100,9 @@ -

市场:{{ '¥%0.2f'|format(item.market_price) }}

-

会员:{{ '¥%0.2f'|format(item.vip_price) }}

+

原始价:{{ '¥%0.2f'|format(item.origin_price) }}

+

优惠价:{{ '¥%0.2f'|format(item.market_price) }}

+

会员价:{{ '¥%0.2f'|format(item.vip_price) }}

diff --git a/app/Http/Admin/Views/order/macro.volt b/app/Http/Admin/Views/order/macro.volt index 6424d9f7..7aa625bc 100644 --- a/app/Http/Admin/Views/order/macro.volt +++ b/app/Http/Admin/Views/order/macro.volt @@ -3,7 +3,7 @@ {% set course = order.item_info['course'] %}

课程名称:{{ course['title'] }}

-

市场价格:{{ '¥%0.2f'|format(course['market_price']) }},会员价格:{{ '¥%0.2f'|format(course['vip_price']) }}

+

优惠价格:{{ '¥%0.2f'|format(course['market_price']) }},会员价格:{{ '¥%0.2f'|format(course['vip_price']) }}

学习期限:{{ date('Y-m-d H:i:s',course['study_expiry_time']) }},退款期限:{{ date('Y-m-d H:i:s',course['refund_expiry_time']) }}

{% elseif order.item_type == 2 %} @@ -11,7 +11,7 @@ {% for course in courses %}

课程名称:{{ course['title'] }}

-

市场价格:{{ '¥%0.2f'|format(course['market_price']) }},会员价格:{{ '¥%0.2f'|format(course['vip_price']) }}

+

优惠价格:{{ '¥%0.2f'|format(course['market_price']) }},会员价格:{{ '¥%0.2f'|format(course['vip_price']) }}

学习期限:{{ date('Y-m-d H:i:s',course['study_expiry_time']) }},退款期限:{{ date('Y-m-d H:i:s',course['refund_expiry_time']) }}

{% endfor %} diff --git a/app/Http/Admin/Views/package/edit.volt b/app/Http/Admin/Views/package/edit.volt index 61432b1d..deb2ceed 100644 --- a/app/Http/Admin/Views/package/edit.volt +++ b/app/Http/Admin/Views/package/edit.volt @@ -26,7 +26,7 @@
- +
diff --git a/app/Http/Admin/Views/package/guiding.volt b/app/Http/Admin/Views/package/guiding.volt index c3ab1c8d..5d881d72 100644 --- a/app/Http/Admin/Views/package/guiding.volt +++ b/app/Http/Admin/Views/package/guiding.volt @@ -26,7 +26,7 @@ {{ item.lesson_count }} {{ study_expiry_info(item.study_expiry) }} -

市场价:{{ '¥%0.2f'|format(item.market_price) }}

+

优惠价:{{ '¥%0.2f'|format(item.market_price) }}

会员价:{{ '¥%0.2f'|format(item.vip_price) }}

@@ -37,7 +37,7 @@
- 建议市场价:¥{{ guiding_price.market_price }} + 建议优惠价:¥{{ guiding_price.market_price }}    建议会员价:¥{{ guiding_price.vip_price }}
diff --git a/app/Http/Admin/Views/package/list.volt b/app/Http/Admin/Views/package/list.volt index e319bd11..e23a17d8 100644 --- a/app/Http/Admin/Views/package/list.volt +++ b/app/Http/Admin/Views/package/list.volt @@ -25,7 +25,7 @@ 编号 标题 课程数 - 市场价 + 优惠价 会员价 发布 操作 diff --git a/app/Http/Home/Views/course/packages.volt b/app/Http/Home/Views/course/packages.volt index 02230648..509a5edd 100644 --- a/app/Http/Home/Views/course/packages.volt +++ b/app/Http/Home/Views/course/packages.volt @@ -9,7 +9,7 @@ 总价 {{ '¥%0.2f'|format(package.origin_price) }}
- 市场价 {{ '¥%0.2f'|format(package.market_price) }} + 优惠价 {{ '¥%0.2f'|format(package.market_price) }}
会员价 {{ '¥%0.2f'|format(package.vip_price) }} diff --git a/app/Http/Home/Views/course/show_meta.volt b/app/Http/Home/Views/course/show_meta.volt index 201dc99b..6355000c 100644 --- a/app/Http/Home/Views/course/show_meta.volt +++ b/app/Http/Home/Views/course/show_meta.volt @@ -34,10 +34,11 @@ {%- macro meta_price_info(course) %}

+ 原始价格{{ '¥%0.2f'|format(course.origin_price) }} {% if course.market_price > 0 %} - 市场价格{{ '¥%0.2f'|format(course.market_price) }} + 优惠价格{{ '¥%0.2f'|format(course.market_price) }} {% else %} - 市场价格免费 + 优惠价格免费 {% endif %} {% if course.vip_price > 0 %} 会员价格{{ '¥%0.2f'|format(course.vip_price) }} diff --git a/app/Http/Home/Views/macros/order.volt b/app/Http/Home/Views/macros/order.volt index 1f963258..ed29ab31 100644 --- a/app/Http/Home/Views/macros/order.volt +++ b/app/Http/Home/Views/macros/order.volt @@ -3,7 +3,7 @@ {% set course = order.item_info.course %}

课程名称:{{ course.title }}

-

市场价格:{{ '¥%0.2f'|format(course.market_price) }}会员价格:{{ '¥%0.2f'|format(course.vip_price) }}

+

优惠价格:{{ '¥%0.2f'|format(course.market_price) }}会员价格:{{ '¥%0.2f'|format(course.vip_price) }}

学习期限:{{ date('Y-m-d',course.study_expiry_time) }}退款期限:{{ date('Y-m-d',course.refund_expiry_time) }}

{% elseif order.item_type == 2 %} @@ -11,7 +11,7 @@ {% for course in courses %}

课程名称:{{ course.title }}

-

市场价格:{{ '¥%0.2f'|format(course.market_price) }}会员价格:{{ '¥%0.2f'|format(course.vip_price) }}

+

优惠价格:{{ '¥%0.2f'|format(course.market_price) }}会员价格:{{ '¥%0.2f'|format(course.vip_price) }}

学习期限:{{ date('Y-m-d',course.study_expiry_time) }}退款期限:{{ date('Y-m-d',course.refund_expiry_time) }}

{% endfor %} diff --git a/app/Http/Home/Views/order/confirm.volt b/app/Http/Home/Views/order/confirm.volt index e0df3869..365c2a18 100644 --- a/app/Http/Home/Views/order/confirm.volt +++ b/app/Http/Home/Views/order/confirm.volt @@ -13,7 +13,8 @@

{{ course.title }}

- 市场价格 {{ '¥%0.2f'|format(course.market_price) }} + 原始价格 {{ '¥%0.2f'|format(course.origin_price) }} + 优惠价格 {{ '¥%0.2f'|format(course.market_price) }} 会员价格 {{ '¥%0.2f'|format(course.vip_price) }}

diff --git a/app/Models/Course.php b/app/Models/Course.php index 474ae0d8..f8420cc7 100644 --- a/app/Models/Course.php +++ b/app/Models/Course.php @@ -104,7 +104,14 @@ class Course extends Model public $teacher_id; /** - * 市场价格 + * 原始价格 + * + * @var float + */ + public $origin_price; + + /** + * 优惠价格 * * @var float */ @@ -323,6 +330,10 @@ class Course extends Model $this->attrs = kg_json_encode($this->attrs); } + if (empty($this->origin_price)) { + $this->origin_price = 1.5 * $this->market_price; + } + if ($this->deleted == 1) { $this->published = 0; } @@ -339,6 +350,7 @@ class Course extends Model public function afterFetch() { + $this->origin_price = (float)$this->origin_price; $this->market_price = (float)$this->market_price; $this->vip_price = (float)$this->vip_price; $this->rating = (float)$this->rating; diff --git a/app/Models/Package.php b/app/Models/Package.php index 9205112f..583a3c0a 100644 --- a/app/Models/Package.php +++ b/app/Models/Package.php @@ -30,7 +30,7 @@ class Package extends Model public $summary; /** - * 市场价格 + * 优惠价格 * * @var float */ diff --git a/app/Services/Logic/Course/BasicInfo.php b/app/Services/Logic/Course/BasicInfo.php index 8630c637..f0e6efad 100644 --- a/app/Services/Logic/Course/BasicInfo.php +++ b/app/Services/Logic/Course/BasicInfo.php @@ -34,6 +34,7 @@ class BasicInfo extends Service 'summary' => $course->summary, 'details' => $course->details, 'keywords' => $course->keywords, + 'origin_price' => $course->origin_price, 'market_price' => $course->market_price, 'vip_price' => $course->vip_price, 'study_expiry' => $course->study_expiry, diff --git a/app/Services/Logic/Course/PackageList.php b/app/Services/Logic/Course/PackageList.php index 5f220045..d7c5c2e4 100644 --- a/app/Services/Logic/Course/PackageList.php +++ b/app/Services/Logic/Course/PackageList.php @@ -40,7 +40,7 @@ class PackageList extends Service if ($courses) { foreach ($courses as $course) { - $package['origin_price'] += $course['market_price']; + $package['origin_price'] += $course['origin_price']; } $package['courses'] = $this->sortCourses($courses, $firstCourseId); } diff --git a/app/Services/Logic/Order/OrderConfirm.php b/app/Services/Logic/Order/OrderConfirm.php index 27198bd5..47870448 100644 --- a/app/Services/Logic/Order/OrderConfirm.php +++ b/app/Services/Logic/Order/OrderConfirm.php @@ -33,7 +33,7 @@ class OrderConfirm extends Service $result['item_info']['course'] = $this->handleCourseInfo($course); - $result['total_amount'] = $course->market_price; + $result['total_amount'] = $course->origin_price; $result['pay_amount'] = $user->vip ? $course->vip_price : $course->market_price; $result['discount_amount'] = $result['total_amount'] - $result['pay_amount']; @@ -46,7 +46,7 @@ class OrderConfirm extends Service $result['total_amount'] = 0; foreach ($result['item_info']['package']['courses'] as $course) { - $result['total_amount'] += $course['market_price']; + $result['total_amount'] += $course['origin_price']; } $result['pay_amount'] = $user->vip ? $package->vip_price : $package->market_price; @@ -138,6 +138,7 @@ class OrderConfirm extends Service 'lesson_count' => $course->lesson_count, 'study_expiry' => $course->study_expiry, 'refund_expiry' => $course->refund_expiry, + 'origin_price' => $course->origin_price, 'market_price' => $course->market_price, 'vip_price' => $course->vip_price, ]; diff --git a/app/Validators/Course.php b/app/Validators/Course.php index efa5288f..83c1ab08 100644 --- a/app/Validators/Course.php +++ b/app/Validators/Course.php @@ -161,6 +161,17 @@ class Course extends Validator return implode(',', $list); } + public function checkGuidePrice($price) + { + $value = $this->filter->sanitize($price, ['trim', 'float']); + + if ($value < 0 || $value > 10000) { + throw new BadRequestException('course.invalid_origin_price'); + } + + return $value; + } + public function checkMarketPrice($price) { $value = $this->filter->sanitize($price, ['trim', 'float']); diff --git a/config/errors.php b/config/errors.php index d599a268..ef52ac82 100644 --- a/config/errors.php +++ b/config/errors.php @@ -109,9 +109,10 @@ $error['course.details_too_long'] = '详情太长(多于5000个字符)'; $error['course.invalid_model'] = '无效的模型类别'; $error['course.invalid_level'] = '无效的难度级别'; $error['course.invalid_cover'] = '无效的封面'; -$error['course.invalid_market_price'] = '无效的市场价格(范围:0-10000)'; +$error['course.invalid_origin_price'] = '无效的指导价格(范围:0-10000)'; +$error['course.invalid_market_price'] = '无效的优惠价格(范围:0-10000)'; $error['course.invalid_vip_price'] = '无效的会员价格(范围:0-10000)'; -$error['course.invalid_compare_price'] = '无效的比较定价(会员价格高于市场价格)'; +$error['course.invalid_compare_price'] = '无效的比较定价(会员价格高于优惠价格)'; $error['course.invalid_study_expiry'] = '无效的学习期限'; $error['course.invalid_refund_expiry'] = '无效的退款期限'; $error['course.invalid_feature_status'] = '无效的推荐状态'; @@ -135,7 +136,7 @@ $error['package.not_found'] = '套餐不存在'; $error['package.title_too_short'] = '标题太短(少于5个字符)'; $error['package.title_too_long'] = '标题太长(多于50个字符)'; $error['package.summary_too_long'] = '简介太长(多于255个字符)'; -$error['package.invalid_market_price'] = '无效的市场价格'; +$error['package.invalid_market_price'] = '无效的优惠价格'; $error['package.invalid_vip_price'] = '无效的会员价格'; $error['package.invalid_publish_status'] = '无效的发布状态'; diff --git a/db/migrations/20200827063842_init_table.php b/db/migrations/20200827063842_init_table.php index 456501ef..182f7e73 100644 --- a/db/migrations/20200827063842_init_table.php +++ b/db/migrations/20200827063842_init_table.php @@ -1236,7 +1236,7 @@ class InitTable extends Phinx\Migration\AbstractMigration 'default' => '0.00', 'precision' => '10', 'scale' => '2', - 'comment' => '市场价格', + 'comment' => '优惠价格', 'after' => 'teacher_id', ]) ->addColumn('vip_price', 'decimal', [ @@ -3124,7 +3124,7 @@ class InitTable extends Phinx\Migration\AbstractMigration 'default' => '0.00', 'precision' => '10', 'scale' => '2', - 'comment' => '市场价格', + 'comment' => '优惠价格', 'after' => 'summary', ]) ->addColumn('vip_price', 'decimal', [ diff --git a/db/migrations/20210203081614_schema_202102031615.php b/db/migrations/20210203081614_schema_202102031615.php new file mode 100644 index 00000000..5ded7189 --- /dev/null +++ b/db/migrations/20210203081614_schema_202102031615.php @@ -0,0 +1,27 @@ +table('kg_course') + ->addColumn('origin_price', 'decimal', [ + 'null' => false, + 'default' => '0.00', + 'precision' => '10', + 'scale' => '2', + 'comment' => '原始价格', + 'after' => 'teacher_id', + ]) + ->save(); + + $this->updateOriginPrice(); + } + + protected function updateOriginPrice() + { + $this->execute("UPDATE kg_course SET origin_price = round(1.5 * market_price)"); + } + +} diff --git a/db/migrations/schema.php b/db/migrations/schema.php index e564699d..9ff9aefc 100644 --- a/db/migrations/schema.php +++ b/db/migrations/schema.php @@ -4130,7 +4130,7 @@ return array( 'COLUMN_KEY' => '', 'EXTRA' => '', 'PRIVILEGES' => 'select,insert,update,references', - 'COLUMN_COMMENT' => '市场价格', + 'COLUMN_COMMENT' => '优惠价格', 'GENERATION_EXPRESSION' => '', 'SRS_ID' => NULL, ), @@ -10669,7 +10669,7 @@ return array( 'COLUMN_KEY' => '', 'EXTRA' => '', 'PRIVILEGES' => 'select,insert,update,references', - 'COLUMN_COMMENT' => '市场价格', + 'COLUMN_COMMENT' => '优惠价格', 'GENERATION_EXPRESSION' => '', 'SRS_ID' => NULL, ), diff --git a/public/static/admin/js/xm-course.js b/public/static/admin/js/xm-course.js index 5e360cce..4b823dae 100644 --- a/public/static/admin/js/xm-course.js +++ b/public/static/admin/js/xm-course.js @@ -71,7 +71,7 @@ function xmCourse(data, url) { } }, { - field: 'market_price', title: '市场价', width: 50, templet: function (d) { + field: 'market_price', title: '优惠价', width: 50, templet: function (d) { return '¥' + d.market_price; } }, diff --git a/public/static/home/css/common.css b/public/static/home/css/common.css index 012b786f..25ffe190 100644 --- a/public/static/home/css/common.css +++ b/public/static/home/css/common.css @@ -501,6 +501,10 @@ color: red; } +.course-meta .info .origin-price { + text-decoration: line-through; +} + .course-meta .info .free { color: green; } @@ -1071,6 +1075,10 @@ margin: 0 5px; } +.cart-course-card .origin-price { + text-decoration: line-through; +} + .cart-course-card .price { color: red; } From 3d286baf91e1c6130ebb1db7831d4bb01c8b06e8 Mon Sep 17 00:00:00 2001 From: winzer Date: Wed, 3 Feb 2021 15:52:19 +0800 Subject: [PATCH 04/16] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BB=B7=E6=A0=BC?= =?UTF-8?q?=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Admin/Services/Course.php | 3 +-- app/Validators/Course.php | 9 +-------- config/errors.php | 3 +-- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/app/Http/Admin/Services/Course.php b/app/Http/Admin/Services/Course.php index 59e06038..1767f553 100644 --- a/app/Http/Admin/Services/Course.php +++ b/app/Http/Admin/Services/Course.php @@ -164,10 +164,9 @@ class Course extends Service $data['market_price'] = 0; $data['vip_price'] = 0; } else { - $data['origin_price'] = $validator->checkMarketPrice($post['origin_price']); + $data['origin_price'] = $validator->checkOriginPrice($post['origin_price']); $data['market_price'] = $validator->checkMarketPrice($post['market_price']); $data['vip_price'] = $validator->checkVipPrice($post['vip_price']); - $validator->checkComparePrice($post['market_price'], $post['vip_price']); $data['study_expiry'] = $validator->checkStudyExpiry($post['study_expiry']); $data['refund_expiry'] = $validator->checkRefundExpiry($post['refund_expiry']); } diff --git a/app/Validators/Course.php b/app/Validators/Course.php index 83c1ab08..24ed7e96 100644 --- a/app/Validators/Course.php +++ b/app/Validators/Course.php @@ -161,7 +161,7 @@ class Course extends Validator return implode(',', $list); } - public function checkGuidePrice($price) + public function checkOriginPrice($price) { $value = $this->filter->sanitize($price, ['trim', 'float']); @@ -194,13 +194,6 @@ class Course extends Validator return $value; } - public function checkComparePrice($marketPrice, $vipPrice) - { - if ($vipPrice > $marketPrice) { - throw new BadRequestException('course.invalid_compare_price'); - } - } - public function checkStudyExpiry($expiry) { $options = CourseModel::studyExpiryOptions(); diff --git a/config/errors.php b/config/errors.php index ef52ac82..16e5a804 100644 --- a/config/errors.php +++ b/config/errors.php @@ -109,10 +109,9 @@ $error['course.details_too_long'] = '详情太长(多于5000个字符)'; $error['course.invalid_model'] = '无效的模型类别'; $error['course.invalid_level'] = '无效的难度级别'; $error['course.invalid_cover'] = '无效的封面'; -$error['course.invalid_origin_price'] = '无效的指导价格(范围:0-10000)'; +$error['course.invalid_origin_price'] = '无效的原始价格(范围:0-10000)'; $error['course.invalid_market_price'] = '无效的优惠价格(范围:0-10000)'; $error['course.invalid_vip_price'] = '无效的会员价格(范围:0-10000)'; -$error['course.invalid_compare_price'] = '无效的比较定价(会员价格高于优惠价格)'; $error['course.invalid_study_expiry'] = '无效的学习期限'; $error['course.invalid_refund_expiry'] = '无效的退款期限'; $error['course.invalid_feature_status'] = '无效的推荐状态'; From 24f94088c3c56bd7ee50fd1c92d43bece147051e Mon Sep 17 00:00:00 2001 From: koogua Date: Thu, 4 Mar 2021 11:04:06 +0800 Subject: [PATCH 05/16] =?UTF-8?q?WechatOfficialAccountController.php?= =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...lAccountController.php => WeChatOfficialAccountController.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename app/Http/Home/Controllers/{WechatOfficialAccountController.php => WeChatOfficialAccountController.php} (100%) diff --git a/app/Http/Home/Controllers/WechatOfficialAccountController.php b/app/Http/Home/Controllers/WeChatOfficialAccountController.php similarity index 100% rename from app/Http/Home/Controllers/WechatOfficialAccountController.php rename to app/Http/Home/Controllers/WeChatOfficialAccountController.php From 8849f706b99467b0046e3df7f931a96f29155e28 Mon Sep 17 00:00:00 2001 From: koogua Date: Mon, 22 Mar 2021 16:08:16 +0800 Subject: [PATCH 06/16] =?UTF-8?q?=E4=BF=AE=E6=AD=A3IM=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=92=8C=E7=BE=A4=E7=BB=84=E5=A4=B4=E5=83=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/ImGroup.php | 2 +- app/Models/ImUser.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/ImGroup.php b/app/Models/ImGroup.php index 209d6d77..ca4f74af 100644 --- a/app/Models/ImGroup.php +++ b/app/Models/ImGroup.php @@ -128,7 +128,7 @@ class ImGroup extends Model public function beforeCreate() { if (empty($this->avatar)) { - $this->avatar = kg_default_avatar_path(); + $this->avatar = kg_default_group_avatar_path(); } elseif (Text::startsWith($this->avatar, 'http')) { $this->avatar = self::getAvatarPath($this->avatar); } diff --git a/app/Models/ImUser.php b/app/Models/ImUser.php index f3b9cb63..52b5e951 100644 --- a/app/Models/ImUser.php +++ b/app/Models/ImUser.php @@ -113,7 +113,7 @@ class ImUser extends Model public function beforeCreate() { if (empty($this->avatar)) { - $this->avatar = kg_default_avatar_path(); + $this->avatar = kg_default_user_avatar_path(); } elseif (Text::startsWith($this->avatar, 'http')) { $this->avatar = self::getAvatarPath($this->avatar); } From 252d3e70c5fb17e80d4554abce40cbc7eca137ef Mon Sep 17 00:00:00 2001 From: koogua Date: Mon, 22 Mar 2021 20:01:57 +0800 Subject: [PATCH 07/16] =?UTF-8?q?=E4=BF=AE=E6=AD=A3xm-select=E9=81=97?= =?UTF-8?q?=E6=BC=8F=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Admin/Views/course/edit.volt | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/app/Http/Admin/Views/course/edit.volt b/app/Http/Admin/Views/course/edit.volt index 2fac4899..b72b0181 100644 --- a/app/Http/Admin/Views/course/edit.volt +++ b/app/Http/Admin/Views/course/edit.volt @@ -53,23 +53,16 @@ xmSelect.render({ el: '#xm-category-ids', name: 'xm_category_ids', + filterable: true, max: 5, - prop: { - name: 'name', - value: 'id' - }, data: {{ xm_categories|json_encode }} }); xmSelect.render({ el: '#xm-teacher-ids', name: 'xm_teacher_ids', - paging: true, + filterable: true, max: 5, - prop: { - name: 'name', - value: 'id' - }, data: {{ xm_teachers|json_encode }} }); From 4e69f1b43e8f7762a44f9c453782312648206c04 Mon Sep 17 00:00:00 2001 From: koogua Date: Tue, 23 Mar 2021 10:43:15 +0800 Subject: [PATCH 08/16] =?UTF-8?q?=E4=BF=AE=E6=AD=A3chapter=20attrs?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=BA=8F=E5=88=97=E5=8C=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/Chapter.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Models/Chapter.php b/app/Models/Chapter.php index 9e59f89e..c8a772b3 100644 --- a/app/Models/Chapter.php +++ b/app/Models/Chapter.php @@ -214,9 +214,10 @@ class Chapter extends Model $this->attrs = $this->_read_attrs; } } - if (is_array($this->attrs)) { - $this->attrs = kg_json_encode($this->attrs); - } + } + + if (is_array($this->attrs)) { + $this->attrs = kg_json_encode($this->attrs); } $this->create_time = time(); From 0c964b85a66f25eadfa6f48fff1100b03cf19711 Mon Sep 17 00:00:00 2001 From: koogua Date: Fri, 26 Mar 2021 15:23:08 +0800 Subject: [PATCH 09/16] =?UTF-8?q?=E4=BF=AE=E6=AD=A3im=E5=A4=B4=E5=83=8F?= =?UTF-8?q?=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/ImGroup.php | 2 +- app/Models/ImUser.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/ImGroup.php b/app/Models/ImGroup.php index 47fb7694..ca4f74af 100644 --- a/app/Models/ImGroup.php +++ b/app/Models/ImGroup.php @@ -128,7 +128,7 @@ class ImGroup extends Model public function beforeCreate() { if (empty($this->avatar)) { - $this->avatar = kg_default_user_avatar_path(); + $this->avatar = kg_default_group_avatar_path(); } elseif (Text::startsWith($this->avatar, 'http')) { $this->avatar = self::getAvatarPath($this->avatar); } diff --git a/app/Models/ImUser.php b/app/Models/ImUser.php index 3898362b..52b5e951 100644 --- a/app/Models/ImUser.php +++ b/app/Models/ImUser.php @@ -113,7 +113,7 @@ class ImUser extends Model public function beforeCreate() { if (empty($this->avatar)) { - $this->avatar = kg_default_group_avatar_path(); + $this->avatar = kg_default_user_avatar_path(); } elseif (Text::startsWith($this->avatar, 'http')) { $this->avatar = self::getAvatarPath($this->avatar); } From ce84d79904f3719415d6a1920f9e1bffa6198835 Mon Sep 17 00:00:00 2001 From: koogua Date: Mon, 29 Mar 2021 17:21:03 +0800 Subject: [PATCH 10/16] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=85=AC=E4=BC=97=E5=8F=B7=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E4=B8=8D=E5=AD=98=E5=9C=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Admin/Services/Setting.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Admin/Services/Setting.php b/app/Http/Admin/Services/Setting.php index a1340246..421d910f 100644 --- a/app/Http/Admin/Services/Setting.php +++ b/app/Http/Admin/Services/Setting.php @@ -62,7 +62,7 @@ class Setting extends Service { $oa = $this->getSettings('wechat.oa'); - $oa['notify_url'] = $oa['notify_url'] ?: kg_full_url(['for' => 'home.wechat.oa.notify']); + $oa['notify_url'] = $oa['notify_url'] ?: kg_full_url(['for' => 'home.wechat_oa.notify']); $oa['menu'] = json_decode($oa['menu'], true); From 341168a9e1d652ebb186819ebe496e709fbdd4fd Mon Sep 17 00:00:00 2001 From: koogua Date: Tue, 30 Mar 2021 11:05:07 +0800 Subject: [PATCH 11/16] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=91=BD=E5=90=8D?= =?UTF-8?q?=E7=A9=BA=E9=97=B4=E5=88=AB=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Api/Controllers/UploadController.php | 1 + app/Http/Home/Controllers/VerifyController.php | 4 ++-- app/Services/Logic/Account/EmailUpdate.php | 4 ++-- app/Services/Logic/Account/OAuthProvider.php | 4 ++-- app/Services/Logic/Account/PasswordReset.php | 4 ++-- app/Services/Logic/Account/PasswordUpdate.php | 4 ++-- app/Services/Logic/Account/PhoneUpdate.php | 4 ++-- app/Services/Logic/Account/Register.php | 4 ++-- app/Services/Logic/Chapter/BasicInfo.php | 4 ++-- app/Services/Logic/Chapter/ChapterInfo.php | 4 ++-- app/Services/Logic/Chapter/ChapterLike.php | 4 ++-- app/Services/Logic/Chapter/ConsultList.php | 4 ++-- app/Services/Logic/Chapter/DanmuList.php | 4 ++-- app/Services/Logic/Chapter/Learning.php | 4 ++-- app/Services/Logic/Chapter/ResourceList.php | 4 ++-- app/Services/Logic/Consult/ConsultCreate.php | 4 ++-- app/Services/Logic/Consult/ConsultDelete.php | 4 ++-- app/Services/Logic/Consult/ConsultInfo.php | 4 ++-- app/Services/Logic/Consult/ConsultLike.php | 4 ++-- app/Services/Logic/Consult/ConsultList.php | 4 ++-- app/Services/Logic/Consult/ConsultUpdate.php | 4 ++-- app/Services/Logic/Course/BasicInfo.php | 4 ++-- app/Services/Logic/Course/CategoryList.php | 4 ++-- app/Services/Logic/Course/ChapterList.php | 4 ++-- app/Services/Logic/Course/ConsultList.php | 4 ++-- app/Services/Logic/Course/CourseFavorite.php | 4 ++-- app/Services/Logic/Course/CourseInfo.php | 4 ++-- app/Services/Logic/Course/CourseList.php | 4 ++-- app/Services/Logic/Course/PackageList.php | 4 ++-- app/Services/Logic/Course/RecommendedList.php | 4 ++-- app/Services/Logic/Course/RelatedList.php | 4 ++-- app/Services/Logic/Course/ReviewList.php | 4 ++-- app/Services/Logic/Course/TeacherList.php | 4 ++-- app/Services/Logic/Course/TopicList.php | 4 ++-- app/Services/Logic/Danmu/DanmuCreate.php | 4 ++-- app/Services/Logic/Danmu/DanmuInfo.php | 4 ++-- app/Services/Logic/FlashSale/Queue.php | 4 ++-- app/Services/Logic/FlashSale/SaleList.php | 4 ++-- app/Services/Logic/FlashSale/UserOrderCache.php | 4 ++-- app/Services/Logic/Help/HelpInfo.php | 4 ++-- app/Services/Logic/Help/HelpList.php | 4 ++-- app/Services/Logic/Im/GroupInfo.php | 1 - app/Services/Logic/Im/GroupList.php | 1 - app/Services/Logic/Im/GroupUserList.php | 1 - app/Services/Logic/Live/LiveChapter.php | 4 ++-- app/Services/Logic/Live/LiveList.php | 4 ++-- app/Services/Logic/Order/OrderCancel.php | 4 ++-- app/Services/Logic/Order/OrderConfirm.php | 4 ++-- app/Services/Logic/Order/OrderCreate.php | 4 ++-- app/Services/Logic/Order/OrderInfo.php | 4 ++-- app/Services/Logic/Order/PayProvider.php | 4 ++-- app/Services/Logic/Package/CourseList.php | 4 ++-- app/Services/Logic/Package/PackageInfo.php | 4 ++-- app/Services/Logic/Page/PageInfo.php | 4 ++-- app/Services/Logic/Point/GiftInfo.php | 4 ++-- app/Services/Logic/Point/GiftList.php | 4 ++-- app/Services/Logic/Point/HotGiftList.php | 4 ++-- app/Services/Logic/Point/PointHistory.php | 4 ++-- app/Services/Logic/Point/PointRedeem.php | 4 ++-- app/Services/Logic/Refund/RefundCancel.php | 4 ++-- app/Services/Logic/Refund/RefundConfirm.php | 4 ++-- app/Services/Logic/Refund/RefundCreate.php | 4 ++-- app/Services/Logic/Refund/RefundInfo.php | 4 ++-- app/Services/Logic/Review/ReviewCreate.php | 4 ++-- app/Services/Logic/Review/ReviewDelete.php | 4 ++-- app/Services/Logic/Review/ReviewInfo.php | 4 ++-- app/Services/Logic/Review/ReviewLike.php | 4 ++-- app/Services/Logic/Review/ReviewUpdate.php | 4 ++-- app/Services/Logic/Reward/OptionList.php | 4 ++-- app/Services/Logic/Search/Handler.php | 4 ++-- app/Services/Logic/Teacher/Console/ConsultList.php | 4 ++-- app/Services/Logic/Teacher/Console/CourseList.php | 4 ++-- app/Services/Logic/Teacher/Console/LiveList.php | 4 ++-- app/Services/Logic/Teacher/Console/LivePushUrl.php | 4 ++-- app/Services/Logic/Teacher/CourseList.php | 4 ++-- app/Services/Logic/Teacher/TeacherInfo.php | 4 ++-- app/Services/Logic/Teacher/TeacherList.php | 4 ++-- app/Services/Logic/Topic/CourseList.php | 4 ++-- app/Services/Logic/Topic/TopicInfo.php | 4 ++-- app/Services/Logic/Trade/TradeCreate.php | 4 ++-- app/Services/Logic/Trade/TradeInfo.php | 4 ++-- app/Services/Logic/User/Console/AccountInfo.php | 4 ++-- app/Services/Logic/User/Console/BalanceInfo.php | 4 ++-- app/Services/Logic/User/Console/ConnectDelete.php | 3 +-- app/Services/Logic/User/Console/ConnectList.php | 4 ++-- app/Services/Logic/User/Console/ConsultList.php | 3 +-- app/Services/Logic/User/Console/ContactInfo.php | 4 ++-- app/Services/Logic/User/Console/ContactUpdate.php | 4 ++-- app/Services/Logic/User/Console/CourseList.php | 4 ++-- app/Services/Logic/User/Console/FavoriteList.php | 3 +-- app/Services/Logic/User/Console/FriendList.php | 4 ++-- app/Services/Logic/User/Console/GroupList.php | 4 ++-- app/Services/Logic/User/Console/OrderList.php | 4 ++-- app/Services/Logic/User/Console/PointHistory.php | 4 ++-- app/Services/Logic/User/Console/PointRedeemList.php | 4 ++-- app/Services/Logic/User/Console/ProfileInfo.php | 4 ++-- app/Services/Logic/User/Console/ProfileUpdate.php | 4 ++-- app/Services/Logic/User/Console/RefundList.php | 4 ++-- app/Services/Logic/User/Console/ReviewList.php | 3 +-- app/Services/Logic/User/CourseList.php | 3 +-- app/Services/Logic/User/FavoriteList.php | 3 +-- app/Services/Logic/User/FriendList.php | 1 - app/Services/Logic/User/GroupList.php | 3 +-- app/Services/Logic/User/UserInfo.php | 4 ++-- app/Services/Logic/Verify/EmailCode.php | 6 +++--- app/Services/Logic/Verify/SmsCode.php | 4 ++-- app/Services/Logic/Vip/CourseList.php | 1 - app/Services/Logic/Vip/OptionList.php | 1 - app/Services/Logic/Vip/UserList.php | 2 +- app/Services/Pay/WxpayGateway.php | 2 +- app/Services/Sync/Learning.php | 4 ++-- app/Services/Utils/IndexCourseCache.php | 4 ++-- 112 files changed, 203 insertions(+), 215 deletions(-) diff --git a/app/Http/Api/Controllers/UploadController.php b/app/Http/Api/Controllers/UploadController.php index 40cf7a61..a0f7a878 100644 --- a/app/Http/Api/Controllers/UploadController.php +++ b/app/Http/Api/Controllers/UploadController.php @@ -37,6 +37,7 @@ class UploadController extends Controller */ public function uploadImImageAction() { + } /** diff --git a/app/Http/Home/Controllers/VerifyController.php b/app/Http/Home/Controllers/VerifyController.php index 1e1666a5..861f54ac 100644 --- a/app/Http/Home/Controllers/VerifyController.php +++ b/app/Http/Home/Controllers/VerifyController.php @@ -15,7 +15,7 @@ class VerifyController extends \Phalcon\Mvc\Controller use ResponseTrait; /** - * @Post("/sms/code", name="verify.sms_code") + * @Post("/sms/code", name="home.verify.sms_code") */ public function smsCodeAction() { @@ -27,7 +27,7 @@ class VerifyController extends \Phalcon\Mvc\Controller } /** - * @Post("/email/code", name="verify.email_code") + * @Post("/email/code", name="home.verify.email_code") */ public function emailCodeAction() { diff --git a/app/Services/Logic/Account/EmailUpdate.php b/app/Services/Logic/Account/EmailUpdate.php index a469855f..571595cd 100644 --- a/app/Services/Logic/Account/EmailUpdate.php +++ b/app/Services/Logic/Account/EmailUpdate.php @@ -3,11 +3,11 @@ namespace App\Services\Logic\Account; use App\Repos\Account as AccountRepo; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Validators\Account as AccountValidator; use App\Validators\Verify as VerifyValidator; -class EmailUpdate extends Service +class EmailUpdate extends LogicService { public function handle() diff --git a/app/Services/Logic/Account/OAuthProvider.php b/app/Services/Logic/Account/OAuthProvider.php index 79a9cd2d..ca6b5320 100644 --- a/app/Services/Logic/Account/OAuthProvider.php +++ b/app/Services/Logic/Account/OAuthProvider.php @@ -2,9 +2,9 @@ namespace App\Services\Logic\Account; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class OAuthProvider extends Service +class OAuthProvider extends LogicService { public function handle() diff --git a/app/Services/Logic/Account/PasswordReset.php b/app/Services/Logic/Account/PasswordReset.php index 2b2bb6fd..4a6134da 100644 --- a/app/Services/Logic/Account/PasswordReset.php +++ b/app/Services/Logic/Account/PasswordReset.php @@ -3,11 +3,11 @@ namespace App\Services\Logic\Account; use App\Library\Utils\Password as PasswordUtil; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Validators\Account as AccountValidator; use App\Validators\Verify as VerifyValidator; -class PasswordReset extends Service +class PasswordReset extends LogicService { public function handle() diff --git a/app/Services/Logic/Account/PasswordUpdate.php b/app/Services/Logic/Account/PasswordUpdate.php index b01c86ad..b2223852 100644 --- a/app/Services/Logic/Account/PasswordUpdate.php +++ b/app/Services/Logic/Account/PasswordUpdate.php @@ -4,10 +4,10 @@ namespace App\Services\Logic\Account; use App\Library\Utils\Password as PasswordUtil; use App\Repos\Account as AccountRepo; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Validators\Account as AccountValidator; -class PasswordUpdate extends Service +class PasswordUpdate extends LogicService { public function handle() diff --git a/app/Services/Logic/Account/PhoneUpdate.php b/app/Services/Logic/Account/PhoneUpdate.php index d61ddcaf..64310ec4 100644 --- a/app/Services/Logic/Account/PhoneUpdate.php +++ b/app/Services/Logic/Account/PhoneUpdate.php @@ -3,11 +3,11 @@ namespace App\Services\Logic\Account; use App\Repos\Account as AccountRepo; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Validators\Account as AccountValidator; use App\Validators\Verify as VerifyValidator; -class PhoneUpdate extends Service +class PhoneUpdate extends LogicService { public function handle() diff --git a/app/Services/Logic/Account/Register.php b/app/Services/Logic/Account/Register.php index ade1df09..cba531bc 100644 --- a/app/Services/Logic/Account/Register.php +++ b/app/Services/Logic/Account/Register.php @@ -7,11 +7,11 @@ use App\Library\Validators\Common as CommonValidator; use App\Models\Account as AccountModel; use App\Models\ImUser as ImUserModel; use App\Models\User as UserModel; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Validators\Account as AccountValidator; use App\Validators\Verify as VerifyValidator; -class Register extends Service +class Register extends LogicService { public function handle() diff --git a/app/Services/Logic/Chapter/BasicInfo.php b/app/Services/Logic/Chapter/BasicInfo.php index 8c571f8c..8a7f4baa 100644 --- a/app/Services/Logic/Chapter/BasicInfo.php +++ b/app/Services/Logic/Chapter/BasicInfo.php @@ -10,9 +10,9 @@ use App\Services\ChapterVod as ChapterVodService; use App\Services\Live as LiveService; use App\Services\Logic\ChapterTrait; use App\Services\Logic\CourseTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class BasicInfo extends Service +class BasicInfo extends LogicService { use CourseTrait; diff --git a/app/Services/Logic/Chapter/ChapterInfo.php b/app/Services/Logic/Chapter/ChapterInfo.php index f9c16ca7..dbf0d66e 100644 --- a/app/Services/Logic/Chapter/ChapterInfo.php +++ b/app/Services/Logic/Chapter/ChapterInfo.php @@ -14,9 +14,9 @@ use App\Repos\ImGroup as ImGroupRepo; use App\Repos\ImGroupUser as ImGroupUserRepo; use App\Services\Logic\ChapterTrait; use App\Services\Logic\CourseTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class ChapterInfo extends Service +class ChapterInfo extends LogicService { /** diff --git a/app/Services/Logic/Chapter/ChapterLike.php b/app/Services/Logic/Chapter/ChapterLike.php index 6e6c4861..d2f10709 100644 --- a/app/Services/Logic/Chapter/ChapterLike.php +++ b/app/Services/Logic/Chapter/ChapterLike.php @@ -7,10 +7,10 @@ use App\Models\ChapterLike as ChapterLikeModel; use App\Models\User as UserModel; use App\Repos\ChapterLike as ChapterLikeRepo; use App\Services\Logic\ChapterTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Validators\UserLimit as UserLimitValidator; -class ChapterLike extends Service +class ChapterLike extends LogicService { use ChapterTrait; diff --git a/app/Services/Logic/Chapter/ConsultList.php b/app/Services/Logic/Chapter/ConsultList.php index d014298a..7f81aba0 100644 --- a/app/Services/Logic/Chapter/ConsultList.php +++ b/app/Services/Logic/Chapter/ConsultList.php @@ -5,9 +5,9 @@ namespace App\Services\Logic\Chapter; use App\Library\Paginator\Query as PagerQuery; use App\Services\Logic\ChapterTrait; use App\Services\Logic\Consult\ConsultList as ConsultListHandler; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class ConsultList extends Service +class ConsultList extends LogicService { use ChapterTrait; diff --git a/app/Services/Logic/Chapter/DanmuList.php b/app/Services/Logic/Chapter/DanmuList.php index a30d5de3..26c62664 100644 --- a/app/Services/Logic/Chapter/DanmuList.php +++ b/app/Services/Logic/Chapter/DanmuList.php @@ -5,9 +5,9 @@ namespace App\Services\Logic\Chapter; use App\Builders\DanmuList as DanmuListBuilder; use App\Repos\Danmu as DanmuRepo; use App\Services\Logic\ChapterTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class DanmuList extends Service +class DanmuList extends LogicService { use ChapterTrait; diff --git a/app/Services/Logic/Chapter/Learning.php b/app/Services/Logic/Chapter/Learning.php index 25fb9f09..1c264e85 100644 --- a/app/Services/Logic/Chapter/Learning.php +++ b/app/Services/Logic/Chapter/Learning.php @@ -5,11 +5,11 @@ namespace App\Services\Logic\Chapter; use App\Models\Course as CourseModel; use App\Models\Learning as LearningModel; use App\Services\Logic\ChapterTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Services\Sync\Learning as LearningSyncService; use App\Validators\Learning as LearningValidator; -class Learning extends Service +class Learning extends LogicService { use ChapterTrait; diff --git a/app/Services/Logic/Chapter/ResourceList.php b/app/Services/Logic/Chapter/ResourceList.php index 6ace34eb..6ff9afe8 100644 --- a/app/Services/Logic/Chapter/ResourceList.php +++ b/app/Services/Logic/Chapter/ResourceList.php @@ -5,9 +5,9 @@ namespace App\Services\Logic\Chapter; use App\Builders\ResourceList as ResourceListBuilder; use App\Repos\Resource as ResourceRepo; use App\Services\Logic\ChapterTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class ResourceList extends Service +class ResourceList extends LogicService { use ChapterTrait; diff --git a/app/Services/Logic/Consult/ConsultCreate.php b/app/Services/Logic/Consult/ConsultCreate.php index a1fb5665..4db3c504 100644 --- a/app/Services/Logic/Consult/ConsultCreate.php +++ b/app/Services/Logic/Consult/ConsultCreate.php @@ -9,11 +9,11 @@ use App\Models\User as UserModel; use App\Services\Logic\ChapterTrait; use App\Services\Logic\CourseTrait; use App\Services\Logic\Notice\DingTalk\ConsultCreate as ConsultCreateNotice; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Validators\Consult as ConsultValidator; use App\Validators\UserLimit as UserLimitValidator; -class ConsultCreate extends Service +class ConsultCreate extends LogicService { use CourseTrait; diff --git a/app/Services/Logic/Consult/ConsultDelete.php b/app/Services/Logic/Consult/ConsultDelete.php index 95395d60..8529f3b3 100644 --- a/app/Services/Logic/Consult/ConsultDelete.php +++ b/app/Services/Logic/Consult/ConsultDelete.php @@ -7,10 +7,10 @@ use App\Models\Course as CourseModel; use App\Services\Logic\ChapterTrait; use App\Services\Logic\ConsultTrait; use App\Services\Logic\CourseTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Validators\Consult as ConsultValidator; -class ConsultDelete extends Service +class ConsultDelete extends LogicService { use CourseTrait; diff --git a/app/Services/Logic/Consult/ConsultInfo.php b/app/Services/Logic/Consult/ConsultInfo.php index f8b5590b..b731983b 100644 --- a/app/Services/Logic/Consult/ConsultInfo.php +++ b/app/Services/Logic/Consult/ConsultInfo.php @@ -7,9 +7,9 @@ use App\Repos\Chapter as ChapterRepo; use App\Repos\Course as CourseRepo; use App\Repos\User as UserRepo; use App\Services\Logic\ConsultTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class ConsultInfo extends Service +class ConsultInfo extends LogicService { use ConsultTrait; diff --git a/app/Services/Logic/Consult/ConsultLike.php b/app/Services/Logic/Consult/ConsultLike.php index b674b6a5..747c0e2d 100644 --- a/app/Services/Logic/Consult/ConsultLike.php +++ b/app/Services/Logic/Consult/ConsultLike.php @@ -6,11 +6,11 @@ use App\Models\Consult as ConsultModel; use App\Models\ConsultLike as ConsultLikeModel; use App\Models\User as UserModel; use App\Services\Logic\ConsultTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Validators\Consult as ConsultValidator; use App\Validators\UserLimit as UserLimitValidator; -class ConsultLike extends Service +class ConsultLike extends LogicService { use ConsultTrait; diff --git a/app/Services/Logic/Consult/ConsultList.php b/app/Services/Logic/Consult/ConsultList.php index 44b52f9f..7ea8d178 100644 --- a/app/Services/Logic/Consult/ConsultList.php +++ b/app/Services/Logic/Consult/ConsultList.php @@ -4,9 +4,9 @@ namespace App\Services\Logic\Consult; use App\Builders\ConsultList as ConsultListBuilder; use App\Repos\Consult as ConsultRepo; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class ConsultList extends Service +class ConsultList extends LogicService { public function paginate($params, $sort, $page, $limit) diff --git a/app/Services/Logic/Consult/ConsultUpdate.php b/app/Services/Logic/Consult/ConsultUpdate.php index c78e2f6b..13e39837 100644 --- a/app/Services/Logic/Consult/ConsultUpdate.php +++ b/app/Services/Logic/Consult/ConsultUpdate.php @@ -3,10 +3,10 @@ namespace App\Services\Logic\Consult; use App\Services\Logic\ConsultTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Validators\Consult as ConsultValidator; -class ConsultUpdate extends Service +class ConsultUpdate extends LogicService { use ConsultTrait; diff --git a/app/Services/Logic/Course/BasicInfo.php b/app/Services/Logic/Course/BasicInfo.php index f0e6efad..841c6209 100644 --- a/app/Services/Logic/Course/BasicInfo.php +++ b/app/Services/Logic/Course/BasicInfo.php @@ -6,9 +6,9 @@ use App\Caches\CourseTeacherList as CourseTeacherListCache; use App\Models\Course as CourseModel; use App\Repos\Course as CourseRepo; use App\Services\Logic\CourseTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class BasicInfo extends Service +class BasicInfo extends LogicService { use CourseTrait; diff --git a/app/Services/Logic/Course/CategoryList.php b/app/Services/Logic/Course/CategoryList.php index 3fed96a3..2b7b1272 100644 --- a/app/Services/Logic/Course/CategoryList.php +++ b/app/Services/Logic/Course/CategoryList.php @@ -4,9 +4,9 @@ namespace App\Services\Logic\Course; use App\Caches\CategoryTreeList as CategoryTreeListCache; use App\Models\Category as CategoryModel; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class CategoryList extends Service +class CategoryList extends LogicService { public function handle() diff --git a/app/Services/Logic/Course/ChapterList.php b/app/Services/Logic/Course/ChapterList.php index 158c4e6f..f17da6ff 100644 --- a/app/Services/Logic/Course/ChapterList.php +++ b/app/Services/Logic/Course/ChapterList.php @@ -7,9 +7,9 @@ use App\Models\Course as CourseModel; use App\Models\User as UserModel; use App\Repos\Course as CourseRepo; use App\Services\Logic\CourseTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class ChapterList extends Service +class ChapterList extends LogicService { use CourseTrait; diff --git a/app/Services/Logic/Course/ConsultList.php b/app/Services/Logic/Course/ConsultList.php index 5b924f80..bf1dcdc1 100644 --- a/app/Services/Logic/Course/ConsultList.php +++ b/app/Services/Logic/Course/ConsultList.php @@ -6,9 +6,9 @@ use App\Builders\ConsultList as ConsultListBuilder; use App\Library\Paginator\Query as PagerQuery; use App\Repos\Consult as ConsultRepo; use App\Services\Logic\CourseTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class ConsultList extends Service +class ConsultList extends LogicService { use CourseTrait; diff --git a/app/Services/Logic/Course/CourseFavorite.php b/app/Services/Logic/Course/CourseFavorite.php index 12da8557..4851f3c2 100644 --- a/app/Services/Logic/Course/CourseFavorite.php +++ b/app/Services/Logic/Course/CourseFavorite.php @@ -7,10 +7,10 @@ use App\Models\CourseFavorite as CourseFavoriteModel; use App\Models\User as UserModel; use App\Repos\CourseFavorite as CourseFavoriteRepo; use App\Services\Logic\CourseTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Validators\UserLimit as UserLimitValidator; -class CourseFavorite extends Service +class CourseFavorite extends LogicService { use CourseTrait; diff --git a/app/Services/Logic/Course/CourseInfo.php b/app/Services/Logic/Course/CourseInfo.php index 466404b6..8109b84e 100644 --- a/app/Services/Logic/Course/CourseInfo.php +++ b/app/Services/Logic/Course/CourseInfo.php @@ -6,9 +6,9 @@ use App\Models\Course as CourseModel; use App\Models\User as UserModel; use App\Repos\CourseFavorite as CourseFavoriteRepo; use App\Services\Logic\CourseTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class CourseInfo extends Service +class CourseInfo extends LogicService { use CourseTrait; diff --git a/app/Services/Logic/Course/CourseList.php b/app/Services/Logic/Course/CourseList.php index 20c8ff53..95b2432e 100644 --- a/app/Services/Logic/Course/CourseList.php +++ b/app/Services/Logic/Course/CourseList.php @@ -5,10 +5,10 @@ namespace App\Services\Logic\Course; use App\Library\Paginator\Query as PagerQuery; use App\Repos\Course as CourseRepo; use App\Services\Category as CategoryService; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Validators\CourseQuery as CourseQueryValidator; -class CourseList extends Service +class CourseList extends LogicService { public function handle() diff --git a/app/Services/Logic/Course/PackageList.php b/app/Services/Logic/Course/PackageList.php index d7c5c2e4..157fed27 100644 --- a/app/Services/Logic/Course/PackageList.php +++ b/app/Services/Logic/Course/PackageList.php @@ -5,9 +5,9 @@ namespace App\Services\Logic\Course; use App\Caches\CoursePackageList as CoursePackageListCache; use App\Caches\PackageCourseList as PackageCourseListCache; use App\Services\Logic\CourseTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class PackageList extends Service +class PackageList extends LogicService { use CourseTrait; diff --git a/app/Services/Logic/Course/RecommendedList.php b/app/Services/Logic/Course/RecommendedList.php index 4ab7247d..1703a28e 100644 --- a/app/Services/Logic/Course/RecommendedList.php +++ b/app/Services/Logic/Course/RecommendedList.php @@ -4,9 +4,9 @@ namespace App\Services\Logic\Course; use App\Caches\CourseRecommendedList as CourseRecommendedListCache; use App\Services\Logic\CourseTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class RecommendedList extends Service +class RecommendedList extends LogicService { use CourseTrait; diff --git a/app/Services/Logic/Course/RelatedList.php b/app/Services/Logic/Course/RelatedList.php index 9b4bd38d..8f046186 100644 --- a/app/Services/Logic/Course/RelatedList.php +++ b/app/Services/Logic/Course/RelatedList.php @@ -4,9 +4,9 @@ namespace App\Services\Logic\Course; use App\Caches\CourseRelatedList as CourseRelatedListCache; use App\Services\Logic\CourseTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class RelatedList extends Service +class RelatedList extends LogicService { use CourseTrait; diff --git a/app/Services/Logic/Course/ReviewList.php b/app/Services/Logic/Course/ReviewList.php index f6350c9e..7f6a0266 100644 --- a/app/Services/Logic/Course/ReviewList.php +++ b/app/Services/Logic/Course/ReviewList.php @@ -6,9 +6,9 @@ use App\Builders\ReviewList as ReviewListBuilder; use App\Library\Paginator\Query as PagerQuery; use App\Repos\Review as ReviewRepo; use App\Services\Logic\CourseTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class ReviewList extends Service +class ReviewList extends LogicService { use CourseTrait; diff --git a/app/Services/Logic/Course/TeacherList.php b/app/Services/Logic/Course/TeacherList.php index f3682177..3fb5fd32 100644 --- a/app/Services/Logic/Course/TeacherList.php +++ b/app/Services/Logic/Course/TeacherList.php @@ -4,9 +4,9 @@ namespace App\Services\Logic\Course; use App\Caches\CourseTeacherList as CourseTeacherListCache; use App\Services\Logic\CourseTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class TeacherList extends Service +class TeacherList extends LogicService { use CourseTrait; diff --git a/app/Services/Logic/Course/TopicList.php b/app/Services/Logic/Course/TopicList.php index d00c88aa..b5ee3a02 100644 --- a/app/Services/Logic/Course/TopicList.php +++ b/app/Services/Logic/Course/TopicList.php @@ -4,9 +4,9 @@ namespace App\Services\Logic\Course; use App\Caches\CourseTopicList as CourseTopicListCache; use App\Services\Logic\CourseTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class TopicList extends Service +class TopicList extends LogicService { use CourseTrait; diff --git a/app/Services/Logic/Danmu/DanmuCreate.php b/app/Services/Logic/Danmu/DanmuCreate.php index 47288358..62f48aec 100644 --- a/app/Services/Logic/Danmu/DanmuCreate.php +++ b/app/Services/Logic/Danmu/DanmuCreate.php @@ -5,11 +5,11 @@ namespace App\Services\Logic\Danmu; use App\Models\Danmu as DanmuModel; use App\Models\User as UserModel; use App\Services\Logic\ChapterTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Validators\Danmu as DanmuValidator; use App\Validators\UserLimit as UserLimitValidator; -class DanmuCreate extends Service +class DanmuCreate extends LogicService { use ChapterTrait; diff --git a/app/Services/Logic/Danmu/DanmuInfo.php b/app/Services/Logic/Danmu/DanmuInfo.php index bf432b16..9791c0dc 100644 --- a/app/Services/Logic/Danmu/DanmuInfo.php +++ b/app/Services/Logic/Danmu/DanmuInfo.php @@ -5,9 +5,9 @@ namespace App\Services\Logic\Danmu; use App\Models\Danmu as DanmuModel; use App\Repos\User as UserRepo; use App\Services\Logic\DanmuTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class DanmuInfo extends Service +class DanmuInfo extends LogicService { use DanmuTrait; diff --git a/app/Services/Logic/FlashSale/Queue.php b/app/Services/Logic/FlashSale/Queue.php index 1a85b07f..b3d1b616 100644 --- a/app/Services/Logic/FlashSale/Queue.php +++ b/app/Services/Logic/FlashSale/Queue.php @@ -3,9 +3,9 @@ namespace App\Services\Logic\FlashSale; use App\Services\Logic\FlashSaleTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class Queue extends Service +class Queue extends LogicService { use FlashSaleTrait; diff --git a/app/Services/Logic/FlashSale/SaleList.php b/app/Services/Logic/FlashSale/SaleList.php index 0764aa44..dab42e05 100644 --- a/app/Services/Logic/FlashSale/SaleList.php +++ b/app/Services/Logic/FlashSale/SaleList.php @@ -4,9 +4,9 @@ namespace App\Services\Logic\FlashSale; use App\Models\FlashSale as FlashSaleModel; use App\Repos\FlashSale as FlashSaleRepo; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class SaleList extends Service +class SaleList extends LogicService { /** diff --git a/app/Services/Logic/FlashSale/UserOrderCache.php b/app/Services/Logic/FlashSale/UserOrderCache.php index 71351170..d1202efb 100644 --- a/app/Services/Logic/FlashSale/UserOrderCache.php +++ b/app/Services/Logic/FlashSale/UserOrderCache.php @@ -2,9 +2,9 @@ namespace App\Services\Logic\FlashSale; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class UserOrderCache extends Service +class UserOrderCache extends LogicService { public function get($userId, $saleId) diff --git a/app/Services/Logic/Help/HelpInfo.php b/app/Services/Logic/Help/HelpInfo.php index 75b5a8ee..690359b3 100644 --- a/app/Services/Logic/Help/HelpInfo.php +++ b/app/Services/Logic/Help/HelpInfo.php @@ -4,9 +4,9 @@ namespace App\Services\Logic\Help; use App\Models\Help as HelpModel; use App\Services\Logic\HelpTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class HelpInfo extends Service +class HelpInfo extends LogicService { use HelpTrait; diff --git a/app/Services/Logic/Help/HelpList.php b/app/Services/Logic/Help/HelpList.php index d204f62f..ddeb1997 100644 --- a/app/Services/Logic/Help/HelpList.php +++ b/app/Services/Logic/Help/HelpList.php @@ -3,9 +3,9 @@ namespace App\Services\Logic\Help; use App\Caches\HelpList as HelpListCache; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class HelpList extends Service +class HelpList extends LogicService { public function handle() diff --git a/app/Services/Logic/Im/GroupInfo.php b/app/Services/Logic/Im/GroupInfo.php index 13aaec2d..70905c60 100644 --- a/app/Services/Logic/Im/GroupInfo.php +++ b/app/Services/Logic/Im/GroupInfo.php @@ -4,7 +4,6 @@ namespace App\Services\Logic\Im; use App\Repos\User as UserRepo; use App\Services\Logic\ImGroupTrait; -use App\Services\Logic\Service; class GroupInfo extends Service diff --git a/app/Services/Logic/Im/GroupList.php b/app/Services/Logic/Im/GroupList.php index 88160b9e..ff890419 100644 --- a/app/Services/Logic/Im/GroupList.php +++ b/app/Services/Logic/Im/GroupList.php @@ -5,7 +5,6 @@ namespace App\Services\Logic\Im; use App\Builders\ImGroupList as ImGroupListBuilder; use App\Library\Paginator\Query as PagerQuery; use App\Repos\ImGroup as ImGroupRepo; -use App\Services\Logic\Service; class GroupList extends Service { diff --git a/app/Services/Logic/Im/GroupUserList.php b/app/Services/Logic/Im/GroupUserList.php index b0fed864..eef73d9c 100644 --- a/app/Services/Logic/Im/GroupUserList.php +++ b/app/Services/Logic/Im/GroupUserList.php @@ -6,7 +6,6 @@ use App\Builders\ImGroupUserList as ImGroupUserListBuilder; use App\Library\Paginator\Query as PagerQuery; use App\Repos\ImGroupUser as ImGroupUserRepo; use App\Services\Logic\ImGroupTrait; -use App\Services\Logic\Service; class GroupUserList extends Service { diff --git a/app/Services/Logic/Live/LiveChapter.php b/app/Services/Logic/Live/LiveChapter.php index 49a0df55..087fc106 100644 --- a/app/Services/Logic/Live/LiveChapter.php +++ b/app/Services/Logic/Live/LiveChapter.php @@ -3,11 +3,11 @@ namespace App\Services\Logic\Live; use App\Services\Logic\ChapterTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Validators\Live as LiveValidator; use GatewayClient\Gateway; -class LiveChapter extends Service +class LiveChapter extends LogicService { use ChapterTrait; diff --git a/app/Services/Logic/Live/LiveList.php b/app/Services/Logic/Live/LiveList.php index a461a6fa..15ee22f9 100644 --- a/app/Services/Logic/Live/LiveList.php +++ b/app/Services/Logic/Live/LiveList.php @@ -6,9 +6,9 @@ namespace App\Services\Logic\Live; use App\Builders\LiveList as LiveListBuilder; use App\Library\Paginator\Query as PagerQuery; use App\Repos\ChapterLive as ChapterLiveRepo; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class LiveList extends Service +class LiveList extends LogicService { public function handle() diff --git a/app/Services/Logic/Order/OrderCancel.php b/app/Services/Logic/Order/OrderCancel.php index a11510ca..139a2ae1 100644 --- a/app/Services/Logic/Order/OrderCancel.php +++ b/app/Services/Logic/Order/OrderCancel.php @@ -4,10 +4,10 @@ namespace App\Services\Logic\Order; use App\Models\Order as OrderModel; use App\Services\Logic\OrderTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Validators\Order as OrderValidator; -class OrderCancel extends Service +class OrderCancel extends LogicService { use OrderTrait; diff --git a/app/Services/Logic/Order/OrderConfirm.php b/app/Services/Logic/Order/OrderConfirm.php index aa7bb58f..a906a98b 100644 --- a/app/Services/Logic/Order/OrderConfirm.php +++ b/app/Services/Logic/Order/OrderConfirm.php @@ -8,10 +8,10 @@ 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; +use App\Services\Logic\Service as LogicService; use App\Validators\Order as OrderValidator; -class OrderConfirm extends Service +class OrderConfirm extends LogicService { public function handle($itemId, $itemType) diff --git a/app/Services/Logic/Order/OrderCreate.php b/app/Services/Logic/Order/OrderCreate.php index 29690f0d..7ba8f850 100644 --- a/app/Services/Logic/Order/OrderCreate.php +++ b/app/Services/Logic/Order/OrderCreate.php @@ -10,12 +10,12 @@ use App\Models\User as UserModel; use App\Models\Vip as VipModel; use App\Repos\Order as OrderRepo; use App\Repos\Package as PackageRepo; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Traits\Client as ClientTrait; use App\Validators\Order as OrderValidator; use App\Validators\UserLimit as UserLimitValidator; -class OrderCreate extends Service +class OrderCreate extends LogicService { /** diff --git a/app/Services/Logic/Order/OrderInfo.php b/app/Services/Logic/Order/OrderInfo.php index 96c7af99..0247082c 100644 --- a/app/Services/Logic/Order/OrderInfo.php +++ b/app/Services/Logic/Order/OrderInfo.php @@ -5,10 +5,10 @@ namespace App\Services\Logic\Order; use App\Models\Course as CourseModel; use App\Models\Order as OrderModel; use App\Repos\Order as OrderRepo; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Validators\Order as OrderValidator; -class OrderInfo extends Service +class OrderInfo extends LogicService { public function handle($sn) diff --git a/app/Services/Logic/Order/PayProvider.php b/app/Services/Logic/Order/PayProvider.php index a8271845..48a62297 100644 --- a/app/Services/Logic/Order/PayProvider.php +++ b/app/Services/Logic/Order/PayProvider.php @@ -2,9 +2,9 @@ namespace App\Services\Logic\Order; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class PayProvider extends Service +class PayProvider extends LogicService { public function handle() diff --git a/app/Services/Logic/Package/CourseList.php b/app/Services/Logic/Package/CourseList.php index fa75097d..6c21b98e 100644 --- a/app/Services/Logic/Package/CourseList.php +++ b/app/Services/Logic/Package/CourseList.php @@ -4,9 +4,9 @@ namespace App\Services\Logic\Package; use App\Caches\PackageCourseList as PackageCourseListCache; use App\Services\Logic\PackageTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class CourseList extends Service +class CourseList extends LogicService { use PackageTrait; diff --git a/app/Services/Logic/Package/PackageInfo.php b/app/Services/Logic/Package/PackageInfo.php index 7515224c..1a3f760e 100644 --- a/app/Services/Logic/Package/PackageInfo.php +++ b/app/Services/Logic/Package/PackageInfo.php @@ -4,9 +4,9 @@ namespace App\Services\Logic\Package; use App\Models\Package as PackageModel; use App\Services\Logic\PackageTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class PackageInfo extends Service +class PackageInfo extends LogicService { use PackageTrait; diff --git a/app/Services/Logic/Page/PageInfo.php b/app/Services/Logic/Page/PageInfo.php index 9b960599..50e0c6a6 100644 --- a/app/Services/Logic/Page/PageInfo.php +++ b/app/Services/Logic/Page/PageInfo.php @@ -4,9 +4,9 @@ namespace App\Services\Logic\Page; use App\Models\Page as PageModel; use App\Services\Logic\PageTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class PageInfo extends Service +class PageInfo extends LogicService { use PageTrait; diff --git a/app/Services/Logic/Point/GiftInfo.php b/app/Services/Logic/Point/GiftInfo.php index a3d7b371..318daa81 100644 --- a/app/Services/Logic/Point/GiftInfo.php +++ b/app/Services/Logic/Point/GiftInfo.php @@ -5,9 +5,9 @@ namespace App\Services\Logic\Point; use App\Models\PointGift; use App\Services\Logic\CourseTrait; use App\Services\Logic\PointGiftTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class GiftInfo extends Service +class GiftInfo extends LogicService { use CourseTrait; diff --git a/app/Services/Logic/Point/GiftList.php b/app/Services/Logic/Point/GiftList.php index d3a7b16b..a9376f91 100644 --- a/app/Services/Logic/Point/GiftList.php +++ b/app/Services/Logic/Point/GiftList.php @@ -4,9 +4,9 @@ namespace App\Services\Logic\Point; use App\Library\Paginator\Query as PagerQuery; use App\Repos\PointGift as PointGiftRepo; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class GiftList extends Service +class GiftList extends LogicService { public function handle() diff --git a/app/Services/Logic/Point/HotGiftList.php b/app/Services/Logic/Point/HotGiftList.php index 0564722b..a6db5ca4 100644 --- a/app/Services/Logic/Point/HotGiftList.php +++ b/app/Services/Logic/Point/HotGiftList.php @@ -3,9 +3,9 @@ namespace App\Services\Logic\Point; use App\Caches\PointHotGiftList; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class HotGiftList extends Service +class HotGiftList extends LogicService { public function handle() diff --git a/app/Services/Logic/Point/PointHistory.php b/app/Services/Logic/Point/PointHistory.php index ef6641fd..f3d351f8 100644 --- a/app/Services/Logic/Point/PointHistory.php +++ b/app/Services/Logic/Point/PointHistory.php @@ -14,9 +14,9 @@ use App\Repos\Chapter as ChapterRepo; use App\Repos\Course as CourseRepo; use App\Repos\PointHistory as PointHistoryRepo; use App\Repos\User as UserRepo; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class PointHistory extends Service +class PointHistory extends LogicService { public function handleOrderConsume(OrderModel $order) diff --git a/app/Services/Logic/Point/PointRedeem.php b/app/Services/Logic/Point/PointRedeem.php index e8170499..5e0f54be 100644 --- a/app/Services/Logic/Point/PointRedeem.php +++ b/app/Services/Logic/Point/PointRedeem.php @@ -10,10 +10,10 @@ use App\Models\User as UserModel; use App\Repos\User as UserRepo; use App\Services\Logic\Point\PointHistory as PointHistoryService; use App\Services\Logic\PointGiftTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Validators\PointRedeem as PointRedeemValidator; -class PointRedeem extends Service +class PointRedeem extends LogicService { use PointGiftTrait; diff --git a/app/Services/Logic/Refund/RefundCancel.php b/app/Services/Logic/Refund/RefundCancel.php index 288e02fc..6d76a39d 100644 --- a/app/Services/Logic/Refund/RefundCancel.php +++ b/app/Services/Logic/Refund/RefundCancel.php @@ -6,10 +6,10 @@ use App\Models\Refund as RefundModel; use App\Models\Task as TaskModel; use App\Repos\Refund as RefundRepo; use App\Services\Logic\RefundTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Validators\Refund as RefundValidator; -class RefundCancel extends Service +class RefundCancel extends LogicService { use RefundTrait; diff --git a/app/Services/Logic/Refund/RefundConfirm.php b/app/Services/Logic/Refund/RefundConfirm.php index 56abd9a8..347ff523 100644 --- a/app/Services/Logic/Refund/RefundConfirm.php +++ b/app/Services/Logic/Refund/RefundConfirm.php @@ -3,10 +3,10 @@ namespace App\Services\Logic\Refund; use App\Services\Logic\OrderTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Services\Refund; -class RefundConfirm extends Service +class RefundConfirm extends LogicService { use OrderTrait; diff --git a/app/Services/Logic/Refund/RefundCreate.php b/app/Services/Logic/Refund/RefundCreate.php index 228e52ab..b72f4d7c 100644 --- a/app/Services/Logic/Refund/RefundCreate.php +++ b/app/Services/Logic/Refund/RefundCreate.php @@ -6,12 +6,12 @@ use App\Models\Refund as RefundModel; use App\Models\Task as TaskModel; use App\Repos\Order as OrderRepo; use App\Services\Logic\OrderTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Services\Refund as RefundService; use App\Validators\Order as OrderValidator; use App\Validators\Refund as RefundValidator; -class RefundCreate extends Service +class RefundCreate extends LogicService { use OrderTrait; diff --git a/app/Services/Logic/Refund/RefundInfo.php b/app/Services/Logic/Refund/RefundInfo.php index 9f97819c..54051d4c 100644 --- a/app/Services/Logic/Refund/RefundInfo.php +++ b/app/Services/Logic/Refund/RefundInfo.php @@ -6,9 +6,9 @@ use App\Models\Refund as RefundModel; use App\Repos\Order as OrderRepo; use App\Repos\Refund as RefundRepo; use App\Services\Logic\RefundTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class RefundInfo extends Service +class RefundInfo extends LogicService { use RefundTrait; diff --git a/app/Services/Logic/Review/ReviewCreate.php b/app/Services/Logic/Review/ReviewCreate.php index 1b4d3c37..b564f485 100644 --- a/app/Services/Logic/Review/ReviewCreate.php +++ b/app/Services/Logic/Review/ReviewCreate.php @@ -8,11 +8,11 @@ use App\Models\Review as ReviewModel; use App\Services\CourseStat as CourseStatService; use App\Services\Logic\CourseTrait; use App\Services\Logic\ReviewTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Validators\CourseUser as CourseUserValidator; use App\Validators\Review as ReviewValidator; -class ReviewCreate extends Service +class ReviewCreate extends LogicService { use CourseTrait; diff --git a/app/Services/Logic/Review/ReviewDelete.php b/app/Services/Logic/Review/ReviewDelete.php index 16040e82..d314e35f 100644 --- a/app/Services/Logic/Review/ReviewDelete.php +++ b/app/Services/Logic/Review/ReviewDelete.php @@ -6,10 +6,10 @@ use App\Models\Course as CourseModel; use App\Services\CourseStat as CourseStatService; use App\Services\Logic\CourseTrait; use App\Services\Logic\ReviewTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Validators\Review as ReviewValidator; -class ReviewDelete extends Service +class ReviewDelete extends LogicService { use CourseTrait; diff --git a/app/Services/Logic/Review/ReviewInfo.php b/app/Services/Logic/Review/ReviewInfo.php index 692fa381..dfc293bc 100644 --- a/app/Services/Logic/Review/ReviewInfo.php +++ b/app/Services/Logic/Review/ReviewInfo.php @@ -6,9 +6,9 @@ use App\Models\Review as ReviewModel; use App\Repos\Course as CourseRepo; use App\Repos\User as UserRepo; use App\Services\Logic\ReviewTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class ReviewInfo extends Service +class ReviewInfo extends LogicService { use ReviewTrait; diff --git a/app/Services/Logic/Review/ReviewLike.php b/app/Services/Logic/Review/ReviewLike.php index 2b02dd22..17e9bbee 100644 --- a/app/Services/Logic/Review/ReviewLike.php +++ b/app/Services/Logic/Review/ReviewLike.php @@ -6,11 +6,11 @@ use App\Models\Review as ReviewModel; use App\Models\ReviewLike as ReviewLikeModel; use App\Models\User as UserModel; use App\Services\Logic\ReviewTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Validators\Review as ReviewValidator; use App\Validators\UserLimit as UserLimitValidator; -class ReviewLike extends Service +class ReviewLike extends LogicService { use ReviewTrait; diff --git a/app/Services/Logic/Review/ReviewUpdate.php b/app/Services/Logic/Review/ReviewUpdate.php index 0d942a6b..76098319 100644 --- a/app/Services/Logic/Review/ReviewUpdate.php +++ b/app/Services/Logic/Review/ReviewUpdate.php @@ -6,10 +6,10 @@ use App\Models\Course as CourseModel; use App\Services\CourseStat as CourseStatService; use App\Services\Logic\CourseTrait; use App\Services\Logic\ReviewTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Validators\Review as ReviewValidator; -class ReviewUpdate extends Service +class ReviewUpdate extends LogicService { use CourseTrait; diff --git a/app/Services/Logic/Reward/OptionList.php b/app/Services/Logic/Reward/OptionList.php index 732d8e90..fc8dc5b1 100644 --- a/app/Services/Logic/Reward/OptionList.php +++ b/app/Services/Logic/Reward/OptionList.php @@ -3,9 +3,9 @@ namespace App\Services\Logic\Reward; use App\Repos\Reward as RewardRepo; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class OptionList extends Service +class OptionList extends LogicService { public function handle() diff --git a/app/Services/Logic/Search/Handler.php b/app/Services/Logic/Search/Handler.php index 274fcdc9..ed12a716 100644 --- a/app/Services/Logic/Search/Handler.php +++ b/app/Services/Logic/Search/Handler.php @@ -2,9 +2,9 @@ namespace App\Services\Logic\Search; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -abstract class Handler extends Service +abstract class Handler extends LogicService { abstract function search(); diff --git a/app/Services/Logic/Teacher/Console/ConsultList.php b/app/Services/Logic/Teacher/Console/ConsultList.php index 1031dbc0..b0ced828 100644 --- a/app/Services/Logic/Teacher/Console/ConsultList.php +++ b/app/Services/Logic/Teacher/Console/ConsultList.php @@ -8,11 +8,11 @@ use App\Library\Paginator\Query as PagerQuery; use App\Models\Consult as ConsultModel; use App\Models\Course as CourseModel; use App\Models\CourseUser as CourseUserModel; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use Phalcon\Mvc\Model\Resultset; use Phalcon\Mvc\Model\ResultsetInterface; -class ConsultList extends Service +class ConsultList extends LogicService { public function handle() diff --git a/app/Services/Logic/Teacher/Console/CourseList.php b/app/Services/Logic/Teacher/Console/CourseList.php index 6ee24a82..ff884ee4 100644 --- a/app/Services/Logic/Teacher/Console/CourseList.php +++ b/app/Services/Logic/Teacher/Console/CourseList.php @@ -6,10 +6,10 @@ use App\Builders\CourseUserList as CourseUserListBuilder; use App\Library\Paginator\Query as PagerQuery; use App\Models\CourseUser as CourseUserModel; use App\Repos\CourseUser as CourseUserRepo; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Services\Logic\UserTrait; -class CourseList extends Service +class CourseList extends LogicService { use UserTrait; diff --git a/app/Services/Logic/Teacher/Console/LiveList.php b/app/Services/Logic/Teacher/Console/LiveList.php index ae1a9ce2..135d148f 100644 --- a/app/Services/Logic/Teacher/Console/LiveList.php +++ b/app/Services/Logic/Teacher/Console/LiveList.php @@ -4,9 +4,9 @@ namespace App\Services\Logic\Teacher\Console; use App\Library\Paginator\Query as PagerQuery; use App\Repos\TeacherLive as TeacherLiveRepo; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class LiveList extends Service +class LiveList extends LogicService { public function handle() diff --git a/app/Services/Logic/Teacher/Console/LivePushUrl.php b/app/Services/Logic/Teacher/Console/LivePushUrl.php index 210d3a15..59f7d40b 100644 --- a/app/Services/Logic/Teacher/Console/LivePushUrl.php +++ b/app/Services/Logic/Teacher/Console/LivePushUrl.php @@ -5,9 +5,9 @@ namespace App\Services\Logic\Teacher\Console; use App\Models\ChapterLive as ChapterLiveModel; use App\Services\Live as LiveService; use App\Services\Logic\ChapterTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class LivePushUrl extends Service +class LivePushUrl extends LogicService { use ChapterTrait; diff --git a/app/Services/Logic/Teacher/CourseList.php b/app/Services/Logic/Teacher/CourseList.php index 76079073..8dc9e303 100644 --- a/app/Services/Logic/Teacher/CourseList.php +++ b/app/Services/Logic/Teacher/CourseList.php @@ -6,10 +6,10 @@ use App\Builders\CourseUserList as CourseUserListBuilder; use App\Library\Paginator\Query as PagerQuery; use App\Models\CourseUser as CourseUserModel; use App\Repos\CourseUser as CourseUserRepo; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Services\Logic\UserTrait; -class CourseList extends Service +class CourseList extends LogicService { use UserTrait; diff --git a/app/Services/Logic/Teacher/TeacherInfo.php b/app/Services/Logic/Teacher/TeacherInfo.php index ee17103c..68145a0a 100644 --- a/app/Services/Logic/Teacher/TeacherInfo.php +++ b/app/Services/Logic/Teacher/TeacherInfo.php @@ -2,10 +2,10 @@ namespace App\Services\Logic\Teacher; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Services\Logic\User\UserInfo as UserInfoService; -class TeacherInfo extends Service +class TeacherInfo extends LogicService { public function handle($id) diff --git a/app/Services/Logic/Teacher/TeacherList.php b/app/Services/Logic/Teacher/TeacherList.php index e20b4b48..2159ecd5 100644 --- a/app/Services/Logic/Teacher/TeacherList.php +++ b/app/Services/Logic/Teacher/TeacherList.php @@ -5,9 +5,9 @@ namespace App\Services\Logic\Teacher; use App\Library\Paginator\Query as PagerQuery; use App\Models\User as UserModel; use App\Repos\User as UserRepo; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class TeacherList extends Service +class TeacherList extends LogicService { public function handle() diff --git a/app/Services/Logic/Topic/CourseList.php b/app/Services/Logic/Topic/CourseList.php index 0e9ef454..7f5cc78a 100644 --- a/app/Services/Logic/Topic/CourseList.php +++ b/app/Services/Logic/Topic/CourseList.php @@ -5,10 +5,10 @@ namespace App\Services\Logic\Topic; use App\Builders\CourseTopicList as CourseTopicListBuilder; use App\Library\Paginator\Query as PagerQuery; use App\Repos\CourseTopic as CourseTopicRepo; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Services\Logic\TopicTrait; -class CourseList extends Service +class CourseList extends LogicService { use TopicTrait; diff --git a/app/Services/Logic/Topic/TopicInfo.php b/app/Services/Logic/Topic/TopicInfo.php index f7695c0e..50faa6bc 100644 --- a/app/Services/Logic/Topic/TopicInfo.php +++ b/app/Services/Logic/Topic/TopicInfo.php @@ -3,10 +3,10 @@ namespace App\Services\Logic\Topic; use App\Models\Topic as TopicModel; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Services\Logic\TopicTrait; -class TopicInfo extends Service +class TopicInfo extends LogicService { use TopicTrait; diff --git a/app/Services/Logic/Trade/TradeCreate.php b/app/Services/Logic/Trade/TradeCreate.php index 77cdbbc3..f10cbcef 100644 --- a/app/Services/Logic/Trade/TradeCreate.php +++ b/app/Services/Logic/Trade/TradeCreate.php @@ -4,10 +4,10 @@ namespace App\Services\Logic\Trade; use App\Models\Trade as TradeModel; use App\Services\Logic\OrderTrait; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Validators\Trade as TradeValidator; -class TradeCreate extends Service +class TradeCreate extends LogicService { use OrderTrait; diff --git a/app/Services/Logic/Trade/TradeInfo.php b/app/Services/Logic/Trade/TradeInfo.php index 09f0d58d..ca4f3bc3 100644 --- a/app/Services/Logic/Trade/TradeInfo.php +++ b/app/Services/Logic/Trade/TradeInfo.php @@ -3,10 +3,10 @@ namespace App\Services\Logic\Trade; use App\Models\Trade as TradeModel; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Services\Logic\TradeTrait; -class TradeInfo extends Service +class TradeInfo extends LogicService { use TradeTrait; diff --git a/app/Services/Logic/User/Console/AccountInfo.php b/app/Services/Logic/User/Console/AccountInfo.php index 343df5db..875767bd 100644 --- a/app/Services/Logic/User/Console/AccountInfo.php +++ b/app/Services/Logic/User/Console/AccountInfo.php @@ -4,9 +4,9 @@ namespace App\Services\Logic\User\Console; use App\Models\User as UserModel; use App\Repos\Account as AccountRepo; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class AccountInfo extends Service +class AccountInfo extends LogicService { public function handle() diff --git a/app/Services/Logic/User/Console/BalanceInfo.php b/app/Services/Logic/User/Console/BalanceInfo.php index 656d4253..13cf1b78 100644 --- a/app/Services/Logic/User/Console/BalanceInfo.php +++ b/app/Services/Logic/User/Console/BalanceInfo.php @@ -3,9 +3,9 @@ namespace App\Services\Logic\User\Console; use App\Repos\User as UserRepo; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class BalanceInfo extends Service +class BalanceInfo extends LogicService { public function handle() diff --git a/app/Services/Logic/User/Console/ConnectDelete.php b/app/Services/Logic/User/Console/ConnectDelete.php index 28209993..40e2f979 100644 --- a/app/Services/Logic/User/Console/ConnectDelete.php +++ b/app/Services/Logic/User/Console/ConnectDelete.php @@ -2,10 +2,9 @@ namespace App\Services\Logic\User\Console; -use App\Services\Logic\Service; use App\Validators\Connect as ConnectValidator; -class ConnectDelete extends Service +class ConnectDelete extends LogicService { public function handle($id) diff --git a/app/Services/Logic/User/Console/ConnectList.php b/app/Services/Logic/User/Console/ConnectList.php index 7c930e89..ea2edfa0 100644 --- a/app/Services/Logic/User/Console/ConnectList.php +++ b/app/Services/Logic/User/Console/ConnectList.php @@ -3,9 +3,9 @@ namespace App\Services\Logic\User\Console; use App\Repos\Connect as ConnectRepo; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class ConnectList extends Service +class ConnectList extends LogicService { public function handle() diff --git a/app/Services/Logic/User/Console/ConsultList.php b/app/Services/Logic/User/Console/ConsultList.php index d023a329..49d608e7 100644 --- a/app/Services/Logic/User/Console/ConsultList.php +++ b/app/Services/Logic/User/Console/ConsultList.php @@ -5,9 +5,8 @@ namespace App\Services\Logic\User\Console; use App\Builders\ConsultList as ConsultListBuilder; use App\Library\Paginator\Query as PagerQuery; use App\Repos\Consult as ConsultRepo; -use App\Services\Logic\Service; -class ConsultList extends Service +class ConsultList extends LogicService { public function handle() diff --git a/app/Services/Logic/User/Console/ContactInfo.php b/app/Services/Logic/User/Console/ContactInfo.php index 1125baec..8273ab0f 100644 --- a/app/Services/Logic/User/Console/ContactInfo.php +++ b/app/Services/Logic/User/Console/ContactInfo.php @@ -3,9 +3,9 @@ namespace App\Services\Logic\User\Console; use App\Repos\User as UserRepo; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class ContactInfo extends Service +class ContactInfo extends LogicService { public function handle() diff --git a/app/Services/Logic/User/Console/ContactUpdate.php b/app/Services/Logic/User/Console/ContactUpdate.php index d8ab0aaf..d95f4cb3 100644 --- a/app/Services/Logic/User/Console/ContactUpdate.php +++ b/app/Services/Logic/User/Console/ContactUpdate.php @@ -3,10 +3,10 @@ namespace App\Services\Logic\User\Console; use App\Models\UserContact as UserContactModel; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Validators\UserContact as UserContactValidator; -class ContactUpdate extends Service +class ContactUpdate extends LogicService { public function handle() diff --git a/app/Services/Logic/User/Console/CourseList.php b/app/Services/Logic/User/Console/CourseList.php index a06cde89..7c444244 100644 --- a/app/Services/Logic/User/Console/CourseList.php +++ b/app/Services/Logic/User/Console/CourseList.php @@ -2,10 +2,10 @@ namespace App\Services\Logic\User\Console; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Services\Logic\User\CourseList as UserCourseListService; -class CourseList extends Service +class CourseList extends LogicService { public function handle() diff --git a/app/Services/Logic/User/Console/FavoriteList.php b/app/Services/Logic/User/Console/FavoriteList.php index b71779da..8ca15bc1 100644 --- a/app/Services/Logic/User/Console/FavoriteList.php +++ b/app/Services/Logic/User/Console/FavoriteList.php @@ -2,10 +2,9 @@ namespace App\Services\Logic\User\Console; -use App\Services\Logic\Service; use App\Services\Logic\User\FavoriteList as UserFavoriteListService; -class FavoriteList extends Service +class FavoriteList extends LogicService { public function handle() diff --git a/app/Services/Logic/User/Console/FriendList.php b/app/Services/Logic/User/Console/FriendList.php index 698b17b9..8f6b49f6 100644 --- a/app/Services/Logic/User/Console/FriendList.php +++ b/app/Services/Logic/User/Console/FriendList.php @@ -2,10 +2,10 @@ namespace App\Services\Logic\User\Console; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Services\Logic\User\FriendList as UserFriendListService; -class FriendList extends Service +class FriendList extends LogicService { public function handle() diff --git a/app/Services/Logic/User/Console/GroupList.php b/app/Services/Logic/User/Console/GroupList.php index 434442dd..be21d0b3 100644 --- a/app/Services/Logic/User/Console/GroupList.php +++ b/app/Services/Logic/User/Console/GroupList.php @@ -5,10 +5,10 @@ namespace App\Services\Logic\User\Console; use App\Builders\ImGroupList as ImGroupListBuilder; use App\Library\Paginator\Query as PagerQuery; use App\Repos\ImGroup as ImGroupRepo; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Services\Logic\User\GroupList as UserGroupListService; -class GroupList extends Service +class GroupList extends LogicService { public function handle($scope = 'joined') diff --git a/app/Services/Logic/User/Console/OrderList.php b/app/Services/Logic/User/Console/OrderList.php index 2f935fb4..e4225325 100644 --- a/app/Services/Logic/User/Console/OrderList.php +++ b/app/Services/Logic/User/Console/OrderList.php @@ -5,11 +5,11 @@ namespace App\Services\Logic\User\Console; use App\Builders\OrderList as OrderListBuilder; use App\Library\Paginator\Query as PagerQuery; use App\Repos\Order as OrderRepo; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Services\Logic\UserTrait; use App\Validators\Order as OrderValidator; -class OrderList extends Service +class OrderList extends LogicService { use UserTrait; diff --git a/app/Services/Logic/User/Console/PointHistory.php b/app/Services/Logic/User/Console/PointHistory.php index 1a655619..55ec3a5e 100644 --- a/app/Services/Logic/User/Console/PointHistory.php +++ b/app/Services/Logic/User/Console/PointHistory.php @@ -4,10 +4,10 @@ namespace App\Services\Logic\User\Console; use App\Library\Paginator\Query as PagerQuery; use App\Repos\PointHistory as PointHistoryRepo; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Services\Logic\UserTrait; -class PointHistory extends Service +class PointHistory extends LogicService { use UserTrait; diff --git a/app/Services/Logic/User/Console/PointRedeemList.php b/app/Services/Logic/User/Console/PointRedeemList.php index 9b65d41f..b7f6e6a0 100644 --- a/app/Services/Logic/User/Console/PointRedeemList.php +++ b/app/Services/Logic/User/Console/PointRedeemList.php @@ -4,10 +4,10 @@ namespace App\Services\Logic\User\Console; use App\Library\Paginator\Query as PagerQuery; use App\Repos\PointRedeem as PointRedeemRepo; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Services\Logic\UserTrait; -class PointRedeemList extends Service +class PointRedeemList extends LogicService { use UserTrait; diff --git a/app/Services/Logic/User/Console/ProfileInfo.php b/app/Services/Logic/User/Console/ProfileInfo.php index c70c7fbf..d4d81c10 100644 --- a/app/Services/Logic/User/Console/ProfileInfo.php +++ b/app/Services/Logic/User/Console/ProfileInfo.php @@ -3,9 +3,9 @@ namespace App\Services\Logic\User\Console; use App\Models\User as UserModel; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; -class ProfileInfo extends Service +class ProfileInfo extends LogicService { public function handle() diff --git a/app/Services/Logic/User/Console/ProfileUpdate.php b/app/Services/Logic/User/Console/ProfileUpdate.php index 82ecbc2e..ed642cac 100644 --- a/app/Services/Logic/User/Console/ProfileUpdate.php +++ b/app/Services/Logic/User/Console/ProfileUpdate.php @@ -3,10 +3,10 @@ namespace App\Services\Logic\User\Console; use App\Caches\User as UserCache; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Validators\User as UserValidator; -class ProfileUpdate extends Service +class ProfileUpdate extends LogicService { public function handle() diff --git a/app/Services/Logic/User/Console/RefundList.php b/app/Services/Logic/User/Console/RefundList.php index 6953c21a..da1b0af1 100644 --- a/app/Services/Logic/User/Console/RefundList.php +++ b/app/Services/Logic/User/Console/RefundList.php @@ -5,11 +5,11 @@ namespace App\Services\Logic\User\Console; use App\Builders\RefundList as RefundListBuilder; use App\Library\Paginator\Query as PagerQuery; use App\Repos\Refund as RefundRepo; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Services\Logic\UserTrait; use App\Validators\Refund as RefundValidator; -class RefundList extends Service +class RefundList extends LogicService { use UserTrait; diff --git a/app/Services/Logic/User/Console/ReviewList.php b/app/Services/Logic/User/Console/ReviewList.php index b57df0b5..2a74422a 100644 --- a/app/Services/Logic/User/Console/ReviewList.php +++ b/app/Services/Logic/User/Console/ReviewList.php @@ -5,9 +5,8 @@ namespace App\Services\Logic\User\Console; use App\Builders\ReviewList as ReviewListBuilder; use App\Library\Paginator\Query as PagerQuery; use App\Repos\Review as ReviewRepo; -use App\Services\Logic\Service; -class ReviewList extends Service +class ReviewList extends LogicService { public function handle() diff --git a/app/Services/Logic/User/CourseList.php b/app/Services/Logic/User/CourseList.php index 1ef41939..c0195916 100644 --- a/app/Services/Logic/User/CourseList.php +++ b/app/Services/Logic/User/CourseList.php @@ -5,10 +5,9 @@ namespace App\Services\Logic\User; use App\Builders\CourseUserList as CourseUserListBuilder; use App\Library\Paginator\Query as PagerQuery; use App\Repos\CourseUser as CourseUserRepo; -use App\Services\Logic\Service; use App\Services\Logic\UserTrait; -class CourseList extends Service +class CourseList extends LogicService { use UserTrait; diff --git a/app/Services/Logic/User/FavoriteList.php b/app/Services/Logic/User/FavoriteList.php index 8db2ea90..ff628f08 100644 --- a/app/Services/Logic/User/FavoriteList.php +++ b/app/Services/Logic/User/FavoriteList.php @@ -5,10 +5,9 @@ namespace App\Services\Logic\User; use App\Builders\CourseFavoriteList as CourseFavoriteListBuilder; use App\Library\Paginator\Query as PagerQuery; use App\Repos\CourseFavorite as CourseFavoriteRepo; -use App\Services\Logic\Service; use App\Services\Logic\UserTrait; -class FavoriteList extends Service +class FavoriteList extends LogicService { use UserTrait; diff --git a/app/Services/Logic/User/FriendList.php b/app/Services/Logic/User/FriendList.php index c7bb591b..44cb96d8 100644 --- a/app/Services/Logic/User/FriendList.php +++ b/app/Services/Logic/User/FriendList.php @@ -5,7 +5,6 @@ namespace App\Services\Logic\User; use App\Builders\ImFriendUserList as ImFriendUserListBuilder; use App\Library\Paginator\Query as PagerQuery; use App\Repos\ImFriendUser as ImFriendUserRepo; -use App\Services\Logic\Service; use App\Services\Logic\UserTrait; class FriendList extends Service diff --git a/app/Services/Logic/User/GroupList.php b/app/Services/Logic/User/GroupList.php index c3203039..6a4daf3d 100644 --- a/app/Services/Logic/User/GroupList.php +++ b/app/Services/Logic/User/GroupList.php @@ -5,10 +5,9 @@ namespace App\Services\Logic\User; use App\Builders\ImGroupUserList as ImGroupUserListBuilder; use App\Library\Paginator\Query as PagerQuery; use App\Repos\ImGroupUser as ImGroupUserRepo; -use App\Services\Logic\Service; use App\Services\Logic\UserTrait; -class GroupList extends Service +class GroupList extends LogicService { use UserTrait; diff --git a/app/Services/Logic/User/UserInfo.php b/app/Services/Logic/User/UserInfo.php index 387cf444..bb7e0d98 100644 --- a/app/Services/Logic/User/UserInfo.php +++ b/app/Services/Logic/User/UserInfo.php @@ -4,10 +4,10 @@ namespace App\Services\Logic\User; use App\Models\User as UserModel; use App\Repos\User as UserRepo; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Services\Logic\UserTrait; -class UserInfo extends Service +class UserInfo extends LogicService { use UserTrait; diff --git a/app/Services/Logic/Verify/EmailCode.php b/app/Services/Logic/Verify/EmailCode.php index 11671ae5..d88fca4c 100644 --- a/app/Services/Logic/Verify/EmailCode.php +++ b/app/Services/Logic/Verify/EmailCode.php @@ -2,12 +2,12 @@ namespace App\Services\Logic\Verify; -use App\Services\Logic\Service; -use App\Services\Mail\Verify as VerifyMailService; +use App\Services\Logic\Notice\Mail\Verify as VerifyMailService; +use App\Services\Logic\Service as LogicService; use App\Validators\Captcha as CaptchaValidator; use App\Validators\Verify as VerifyValidator; -class EmailCode extends Service +class EmailCode extends LogicService { public function handle() diff --git a/app/Services/Logic/Verify/SmsCode.php b/app/Services/Logic/Verify/SmsCode.php index 48c79713..9fdc423f 100644 --- a/app/Services/Logic/Verify/SmsCode.php +++ b/app/Services/Logic/Verify/SmsCode.php @@ -3,11 +3,11 @@ namespace App\Services\Logic\Verify; use App\Services\Logic\Notice\Sms\Verify as SmsVerifyService; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; use App\Validators\Captcha as CaptchaValidator; use App\Validators\Verify as VerifyValidator; -class SmsCode extends Service +class SmsCode extends LogicService { public function handle() diff --git a/app/Services/Logic/Vip/CourseList.php b/app/Services/Logic/Vip/CourseList.php index 3cb7502d..c386a243 100644 --- a/app/Services/Logic/Vip/CourseList.php +++ b/app/Services/Logic/Vip/CourseList.php @@ -4,7 +4,6 @@ namespace App\Services\Logic\Vip; use App\Library\Paginator\Query as PagerQuery; use App\Repos\Course as CourseRepo; -use App\Services\Logic\Service; class CourseList extends Service { diff --git a/app/Services/Logic/Vip/OptionList.php b/app/Services/Logic/Vip/OptionList.php index 0f732a03..64bc23c5 100644 --- a/app/Services/Logic/Vip/OptionList.php +++ b/app/Services/Logic/Vip/OptionList.php @@ -3,7 +3,6 @@ namespace App\Services\Logic\Vip; use App\Repos\Vip as VipRepo; -use App\Services\Logic\Service; class OptionList extends Service { diff --git a/app/Services/Logic/Vip/UserList.php b/app/Services/Logic/Vip/UserList.php index cdbb4b71..606c256a 100644 --- a/app/Services/Logic/Vip/UserList.php +++ b/app/Services/Logic/Vip/UserList.php @@ -4,7 +4,7 @@ namespace App\Services\Logic\Vip; use App\Library\Paginator\Query as PagerQuery; use App\Repos\User as UserRepo; -use App\Services\Logic\Service; +use App\Services\Logic\Service as LogicService; class UserList extends Service { diff --git a/app/Services/Pay/WxpayGateway.php b/app/Services/Pay/WxpayGateway.php index 00a7800f..ad311b22 100644 --- a/app/Services/Pay/WxpayGateway.php +++ b/app/Services/Pay/WxpayGateway.php @@ -2,7 +2,7 @@ namespace App\Services\Pay; -use App\Services\Service as Service; +use App\Services\Service; use Yansongda\Pay\Gateways\Wechat; use Yansongda\Pay\Pay; diff --git a/app/Services/Sync/Learning.php b/app/Services/Sync/Learning.php index fe5ba353..3f4a8d93 100644 --- a/app/Services/Sync/Learning.php +++ b/app/Services/Sync/Learning.php @@ -3,10 +3,10 @@ namespace App\Services\Sync; use App\Models\Learning as LearningModel; -use App\Services\Service; +use App\Services\Service as AppService; use App\Traits\Client as ClientTrait; -class Learning extends Service +class Learning extends AppService { use ClientTrait; diff --git a/app/Services/Utils/IndexCourseCache.php b/app/Services/Utils/IndexCourseCache.php index beedbd32..3781e53c 100644 --- a/app/Services/Utils/IndexCourseCache.php +++ b/app/Services/Utils/IndexCourseCache.php @@ -10,9 +10,9 @@ use App\Caches\IndexSimpleFreeCourseList as IndexSimpleFreeCourseListCache; use App\Caches\IndexSimpleNewCourseList as IndexSimpleNewCourseListCache; use App\Caches\IndexSimpleVipCourseList as IndexSimpleVipCourseListCache; use App\Caches\IndexVipCourseList as IndexVipCourseListCache; -use App\Services\Service; +use App\Services\Service as AppService; -class IndexCourseCache extends Service +class IndexCourseCache extends AppService { public function rebuild($section = null) From e7633cc7235770420995530d18cffc64c7af4a9d Mon Sep 17 00:00:00 2001 From: koogua Date: Tue, 30 Mar 2021 11:20:27 +0800 Subject: [PATCH 12/16] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=82=AE=E4=BB=B6?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E7=A0=81=E5=91=BD=E5=90=8D=E7=A9=BA=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/Logic/Verify/EmailCode.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Services/Logic/Verify/EmailCode.php b/app/Services/Logic/Verify/EmailCode.php index 11671ae5..5b4862a8 100644 --- a/app/Services/Logic/Verify/EmailCode.php +++ b/app/Services/Logic/Verify/EmailCode.php @@ -2,8 +2,8 @@ namespace App\Services\Logic\Verify; +use App\Services\Logic\Notice\Mail\Verify as VerifyMailService; use App\Services\Logic\Service; -use App\Services\Mail\Verify as VerifyMailService; use App\Validators\Captcha as CaptchaValidator; use App\Validators\Verify as VerifyValidator; From 51899d8c81471f04ce223df926771c33964eafce Mon Sep 17 00:00:00 2001 From: koogua Date: Tue, 30 Mar 2021 20:07:54 +0800 Subject: [PATCH 13/16] =?UTF-8?q?=E4=BF=AE=E6=AD=A3file=5Ftranscode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/ChapterVod.php | 12 ++++++------ app/Services/ChapterVod.php | 4 +--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/app/Models/ChapterVod.php b/app/Models/ChapterVod.php index 53166d64..be1b0335 100644 --- a/app/Models/ChapterVod.php +++ b/app/Models/ChapterVod.php @@ -81,12 +81,12 @@ class ChapterVod extends Model public function afterFetch() { - if (!empty($this->file_id)) { - if (is_string($this->file_transcode) && !empty($this->file_transcode)) { - $this->file_transcode = json_decode($this->file_transcode, true); - } else { - $this->file_transcode = $this->getFileTranscode($this->file_id); - } + if (is_string($this->file_transcode)) { + $this->file_transcode = json_decode($this->file_transcode, true); + } + + if (!empty($this->file_id) && empty($this->file_transcode)) { + $this->file_transcode = $this->getFileTranscode($this->file_id); } } diff --git a/app/Services/ChapterVod.php b/app/Services/ChapterVod.php index 4d070c95..a372b9c9 100644 --- a/app/Services/ChapterVod.php +++ b/app/Services/ChapterVod.php @@ -14,9 +14,7 @@ class ChapterVod extends Service $vod = $chapterRepo->findChapterVod($chapterId); - if (empty($vod->file_transcode)) { - return []; - } + if (empty($vod->file_transcode)) return []; $vodService = new VodService(); From d98b936969ec1125e3763045244f708a19a46823 Mon Sep 17 00:00:00 2001 From: koogua Date: Thu, 8 Apr 2021 19:58:30 +0800 Subject: [PATCH 14/16] =?UTF-8?q?=E4=B8=93=E6=A0=8F=E9=98=B6=E6=AE=B5?= =?UTF-8?q?=E6=80=A7=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Builders/ArticleList.php | 83 ++ app/Builders/CommentList.php | 44 + app/Builders/CourseList.php | 4 +- app/Caches/Article.php | 31 + app/Caches/ArticleHotAuthorList.php | 103 +++ app/Caches/ArticleRelatedList.php | 81 ++ app/Caches/MaxArticleId.php | 29 + app/Caches/MaxTagId.php | 29 + app/Caches/Tag.php | 31 + app/Caches/UserDailyCounter.php | 1 + .../Admin/Controllers/ArticleController.php | 155 ++++ .../Admin/Controllers/CommentController.php | 81 ++ app/Http/Admin/Controllers/Controller.php | 2 +- .../Admin/Controllers/PublicController.php | 13 + app/Http/Admin/Controllers/TagController.php | 132 +++ .../Admin/Controllers/UploadController.php | 21 +- app/Http/Admin/Controllers/VodController.php | 38 - app/Http/Admin/Services/Article.php | 287 ++++++ app/Http/Admin/Services/AuthNode.php | 111 +++ app/Http/Admin/Services/Comment.php | 105 +++ app/Http/Admin/Services/Course.php | 40 +- app/Http/Admin/Services/Page.php | 4 +- app/Http/Admin/Services/Student.php | 2 - app/Http/Admin/Services/Tag.php | 126 +++ app/Http/Admin/Views/article/add.volt | 35 + app/Http/Admin/Views/article/edit.volt | 72 ++ app/Http/Admin/Views/article/edit_basic.volt | 67 ++ app/Http/Admin/Views/article/edit_desc.volt | 22 + app/Http/Admin/Views/article/list.volt | 183 ++++ app/Http/Admin/Views/article/search.volt | 104 +++ app/Http/Admin/Views/category/list.volt | 6 +- app/Http/Admin/Views/comment/edit.volt | 98 ++ app/Http/Admin/Views/comment/list.volt | 63 ++ app/Http/Admin/Views/comment/search.volt | 50 ++ app/Http/Admin/Views/macros/article.volt | 18 + app/Http/Admin/Views/macros/common.volt | 13 + app/Http/Admin/Views/macros/course.volt | 2 +- app/Http/Admin/Views/setting/site.volt | 1 - app/Http/Admin/Views/setting/storage.volt | 4 + app/Http/Admin/Views/student/list.volt | 8 +- app/Http/Admin/Views/tag/add.volt | 30 + app/Http/Admin/Views/tag/edit.volt | 37 + app/Http/Admin/Views/tag/list.volt | 78 ++ app/Http/Admin/Views/tag/search.volt | 44 + .../Api/Controllers/ConsultController.php | 8 +- app/Http/Api/Controllers/CourseController.php | 8 +- app/Http/Api/Controllers/PageController.php | 2 +- app/Http/Api/Controllers/ReviewController.php | 8 +- .../Home/Controllers/ArticleController.php | 132 +++ .../Home/Controllers/ChapterController.php | 6 +- .../Home/Controllers/ConsultController.php | 6 +- .../Home/Controllers/CourseController.php | 6 +- app/Http/Home/Controllers/PageController.php | 2 +- .../Home/Controllers/ReviewController.php | 6 +- app/Http/Home/Services/ArticleQuery.php | 105 +++ app/Http/Home/Services/CourseQuery.php | 12 +- app/Http/Home/Views/article/hot_authors.volt | 24 + app/Http/Home/Views/article/list.volt | 46 + app/Http/Home/Views/article/pager.volt | 31 + app/Http/Home/Views/article/related.volt | 20 + app/Http/Home/Views/article/show.volt | 125 +++ app/Http/Home/Views/course/consults.volt | 2 +- app/Http/Home/Views/course/packages.volt | 2 +- app/Http/Home/Views/course/reviews.volt | 4 +- app/Http/Home/Views/course/show_teacher.volt | 2 +- app/Http/Home/Views/course/topics.volt | 2 +- app/Http/Home/Views/help/index.volt | 2 +- .../Home/Views/im/group/active_users.volt | 2 +- app/Http/Home/Views/im/group/pager.volt | 4 +- app/Http/Home/Views/im/group/show_owner.volt | 2 +- app/Http/Home/Views/im/group/users.volt | 4 +- app/Http/Home/Views/im/index_groups.volt | 4 +- app/Http/Home/Views/im/index_users.volt | 4 +- app/Http/Home/Views/macros/article.volt | 11 + app/Http/Home/Views/macros/course.volt | 10 +- app/Http/Home/Views/macros/point.volt | 10 +- app/Http/Home/Views/teacher/pager.volt | 4 +- app/Http/Home/Views/user/console/courses.volt | 2 +- .../Home/Views/user/console/favorites.volt | 2 +- .../Views/user/console/groups_joined.volt | 2 +- .../Home/Views/user/console/groups_owned.volt | 2 +- app/Http/Home/Views/user/console/reviews.volt | 2 +- app/Http/Home/Views/user/friends.volt | 8 +- app/Http/Home/Views/user/groups.volt | 4 +- app/Http/Home/Views/vip/users.volt | 7 +- app/Library/Helper.php | 40 + app/Listeners/UserDailyCounter.php | 10 + app/Models/Article.php | 268 ++++++ app/Models/ArticleFavorite.php | 46 + app/Models/ArticleLike.php | 46 + app/Models/ArticleTag.php | 46 + app/Models/Category.php | 2 + app/Models/Chapter.php | 7 + app/Models/ChapterLike.php | 12 - app/Models/Comment.php | 158 ++++ app/Models/CommentLike.php | 46 + app/Models/ConsultLike.php | 12 - app/Models/Course.php | 4 +- app/Models/CourseFavorite.php | 12 - app/Models/ReviewLike.php | 12 - app/Models/Tag.php | 119 +++ app/Models/User.php | 7 + app/Repos/Article.php | 175 ++++ app/Repos/ArticleFavorite.php | 24 + app/Repos/ArticleLike.php | 24 + app/Repos/ArticleTag.php | 48 + app/Repos/Comment.php | 95 ++ app/Repos/CommentLike.php | 24 + app/Repos/Learning.php | 4 - app/Repos/Tag.php | 109 +++ app/Repos/User.php | 13 +- .../Logic/Article/ArticleFavorite.php | 85 ++ app/Services/Logic/Article/ArticleInfo.php | 137 +++ app/Services/Logic/Article/ArticleLike.php | 75 ++ app/Services/Logic/Article/ArticleList.php | 106 +++ app/Services/Logic/Article/CommentList.php | 39 + app/Services/Logic/Article/HotAuthorList.php | 20 + app/Services/Logic/Article/RelatedList.php | 20 + app/Services/Logic/ArticleTrait.php | 24 + app/Services/Logic/Chapter/ChapterLike.php | 19 +- app/Services/Logic/Comment/CommentCreate.php | 70 ++ app/Services/Logic/Comment/CommentDelete.php | 46 + app/Services/Logic/Comment/CommentInfo.php | 47 + app/Services/Logic/Comment/CommentList.php | 49 + app/Services/Logic/CommentTrait.php | 17 + app/Services/Logic/Consult/ConsultLike.php | 24 +- app/Services/Logic/Course/CourseFavorite.php | 12 +- app/Services/Logic/Review/ReviewLike.php | 24 +- app/Services/MyStorage.php | 14 + app/Services/Search/ArticleDocument.php | 81 ++ app/Services/Search/ArticleSearcher.php | 25 + app/Services/Search/CourseDocument.php | 4 - app/Services/Sync/ArticleIndex.php | 33 + app/Validators/Article.php | 166 ++++ app/Validators/ArticleQuery.php | 50 ++ app/Validators/ChapterRead.php | 4 +- app/Validators/Comment.php | 87 ++ app/Validators/Consult.php | 16 - app/Validators/Course.php | 6 +- app/Validators/Help.php | 2 +- app/Validators/Page.php | 2 +- app/Validators/Review.php | 16 - app/Validators/Tag.php | 110 +++ app/Validators/UserLimit.php | 22 + config/errors.php | 43 + config/xs.article.default.ini | 48 + config/xs.article.ini | 48 + .../20200827120717_insert_nav_data.php | 56 +- db/migrations/20210403184518.php | 849 ++++++++++++++++++ .../admin/img/default/article_cover.png | Bin 0 -> 65013 bytes public/static/admin/js/chapter.resource.js | 2 +- public/static/admin/js/media.upload.js | 4 +- public/static/home/css/common.css | 181 +++- public/static/home/js/article.list.js | 12 + public/static/home/js/article.show.js | 72 ++ 155 files changed, 6915 insertions(+), 348 deletions(-) create mode 100644 app/Builders/ArticleList.php create mode 100644 app/Builders/CommentList.php create mode 100644 app/Caches/Article.php create mode 100644 app/Caches/ArticleHotAuthorList.php create mode 100644 app/Caches/ArticleRelatedList.php create mode 100644 app/Caches/MaxArticleId.php create mode 100644 app/Caches/MaxTagId.php create mode 100644 app/Caches/Tag.php create mode 100644 app/Http/Admin/Controllers/ArticleController.php create mode 100644 app/Http/Admin/Controllers/CommentController.php create mode 100644 app/Http/Admin/Controllers/TagController.php delete mode 100644 app/Http/Admin/Controllers/VodController.php create mode 100644 app/Http/Admin/Services/Article.php create mode 100644 app/Http/Admin/Services/Comment.php create mode 100644 app/Http/Admin/Services/Tag.php create mode 100644 app/Http/Admin/Views/article/add.volt create mode 100644 app/Http/Admin/Views/article/edit.volt create mode 100644 app/Http/Admin/Views/article/edit_basic.volt create mode 100644 app/Http/Admin/Views/article/edit_desc.volt create mode 100644 app/Http/Admin/Views/article/list.volt create mode 100644 app/Http/Admin/Views/article/search.volt create mode 100644 app/Http/Admin/Views/comment/edit.volt create mode 100644 app/Http/Admin/Views/comment/list.volt create mode 100644 app/Http/Admin/Views/comment/search.volt create mode 100644 app/Http/Admin/Views/macros/article.volt create mode 100644 app/Http/Admin/Views/macros/common.volt create mode 100644 app/Http/Admin/Views/tag/add.volt create mode 100644 app/Http/Admin/Views/tag/edit.volt create mode 100644 app/Http/Admin/Views/tag/list.volt create mode 100644 app/Http/Admin/Views/tag/search.volt create mode 100644 app/Http/Home/Controllers/ArticleController.php create mode 100644 app/Http/Home/Services/ArticleQuery.php create mode 100644 app/Http/Home/Views/article/hot_authors.volt create mode 100644 app/Http/Home/Views/article/list.volt create mode 100644 app/Http/Home/Views/article/pager.volt create mode 100644 app/Http/Home/Views/article/related.volt create mode 100644 app/Http/Home/Views/article/show.volt create mode 100644 app/Http/Home/Views/macros/article.volt create mode 100644 app/Models/Article.php create mode 100644 app/Models/ArticleFavorite.php create mode 100644 app/Models/ArticleLike.php create mode 100644 app/Models/ArticleTag.php create mode 100644 app/Models/Comment.php create mode 100644 app/Models/CommentLike.php create mode 100644 app/Models/Tag.php create mode 100644 app/Repos/Article.php create mode 100644 app/Repos/ArticleFavorite.php create mode 100644 app/Repos/ArticleLike.php create mode 100644 app/Repos/ArticleTag.php create mode 100644 app/Repos/Comment.php create mode 100644 app/Repos/CommentLike.php create mode 100644 app/Repos/Tag.php create mode 100644 app/Services/Logic/Article/ArticleFavorite.php create mode 100644 app/Services/Logic/Article/ArticleInfo.php create mode 100644 app/Services/Logic/Article/ArticleLike.php create mode 100644 app/Services/Logic/Article/ArticleList.php create mode 100644 app/Services/Logic/Article/CommentList.php create mode 100644 app/Services/Logic/Article/HotAuthorList.php create mode 100644 app/Services/Logic/Article/RelatedList.php create mode 100644 app/Services/Logic/ArticleTrait.php create mode 100644 app/Services/Logic/Comment/CommentCreate.php create mode 100644 app/Services/Logic/Comment/CommentDelete.php create mode 100644 app/Services/Logic/Comment/CommentInfo.php create mode 100644 app/Services/Logic/Comment/CommentList.php create mode 100644 app/Services/Logic/CommentTrait.php create mode 100644 app/Services/Search/ArticleDocument.php create mode 100644 app/Services/Search/ArticleSearcher.php create mode 100644 app/Services/Sync/ArticleIndex.php create mode 100644 app/Validators/Article.php create mode 100644 app/Validators/ArticleQuery.php create mode 100644 app/Validators/Comment.php create mode 100644 app/Validators/Tag.php create mode 100644 config/xs.article.default.ini create mode 100644 config/xs.article.ini create mode 100644 db/migrations/20210403184518.php create mode 100644 public/static/admin/img/default/article_cover.png create mode 100644 public/static/home/js/article.list.js create mode 100644 public/static/home/js/article.show.js diff --git a/app/Builders/ArticleList.php b/app/Builders/ArticleList.php new file mode 100644 index 00000000..be639665 --- /dev/null +++ b/app/Builders/ArticleList.php @@ -0,0 +1,83 @@ + $article) { + $articles[$key]['tags'] = json_decode($article['tags'], true); + } + + return $articles; + } + + public function handleCategories(array $articles) + { + $categories = $this->getCategories(); + + foreach ($articles as $key => $article) { + $articles[$key]['category'] = $categories[$article['category_id']] ?? new \stdClass(); + } + + return $articles; + } + + public function handleUsers(array $articles) + { + $users = $this->getUsers($articles); + + foreach ($articles as $key => $article) { + $articles[$key]['owner'] = $users[$article['owner_id']] ?? new \stdClass(); + } + + return $articles; + } + + public function getCategories() + { + $cache = new CategoryListCache(); + + $items = $cache->get(CategoryModel::TYPE_ARTICLE); + + if (empty($items)) return []; + + $result = []; + + foreach ($items as $item) { + $result[$item['id']] = [ + 'id' => $item['id'], + 'name' => $item['name'], + ]; + } + + return $result; + } + + public function getUsers($articles) + { + $ids = kg_array_column($articles, 'owner_id'); + + $userRepo = new UserRepo(); + + $users = $userRepo->findByIds($ids, ['id', 'name', 'avatar']); + + $baseUrl = kg_cos_url(); + + $result = []; + + foreach ($users->toArray() as $user) { + $user['avatar'] = $baseUrl . $user['avatar']; + $result[$user['id']] = $user; + } + + return $result; + } + +} diff --git a/app/Builders/CommentList.php b/app/Builders/CommentList.php new file mode 100644 index 00000000..562629b4 --- /dev/null +++ b/app/Builders/CommentList.php @@ -0,0 +1,44 @@ +getUsers($comments); + + foreach ($comments as $key => $comment) { + $comments[$key]['owner'] = $users[$comment['owner_id']] ?? new \stdClass(); + $comments[$key]['to_user'] = $users[$comment['to_user_id']] ?? new \stdClass(); + } + + return $comments; + } + + public function getUsers(array $comments) + { + $ownerIds = kg_array_column($comments, 'owner_id'); + $toUserIds = kg_array_column($comments, 'to_user_id'); + $ids = array_merge($ownerIds, $toUserIds); + + $userRepo = new UserRepo(); + + $users = $userRepo->findByIds($ids, ['id', 'name', 'avatar']); + + $baseUrl = kg_cos_url(); + + $result = []; + + foreach ($users->toArray() as $user) { + $user['avatar'] = $baseUrl . $user['avatar']; + $result[$user['id']] = $user; + } + + return $result; + } + +} diff --git a/app/Builders/CourseList.php b/app/Builders/CourseList.php index 74f4430b..d2bcb60b 100644 --- a/app/Builders/CourseList.php +++ b/app/Builders/CourseList.php @@ -37,9 +37,7 @@ class CourseList extends Builder $items = $cache->get(CategoryModel::TYPE_COURSE); - if (empty($items)) { - return []; - } + if (empty($items)) return []; $result = []; diff --git a/app/Caches/Article.php b/app/Caches/Article.php new file mode 100644 index 00000000..1deb93e9 --- /dev/null +++ b/app/Caches/Article.php @@ -0,0 +1,31 @@ +lifetime; + } + + public function getKey($id = null) + { + return "article:{$id}"; + } + + public function getContent($id = null) + { + $articleRepo = new ArticleRepo(); + + $article = $articleRepo->findById($id); + + return $article ?: null; + } + +} diff --git a/app/Caches/ArticleHotAuthorList.php b/app/Caches/ArticleHotAuthorList.php new file mode 100644 index 00000000..ff4440be --- /dev/null +++ b/app/Caches/ArticleHotAuthorList.php @@ -0,0 +1,103 @@ +lifetime; + } + + public function getKey($id = null) + { + return 'article_hot_author_list'; + } + + public function getContent($id = null) + { + $rankings = $this->findWeeklyAuthorRankings(); + + if ($rankings->count() > 0) { + $userIds = kg_array_column($rankings->toArray(), 'author_id'); + return $this->handleUsers($userIds); + } + + $randOwners = $this->findRandArticleOwners(); + + if ($randOwners->count() > 0) { + $userIds = kg_array_column($randOwners->toArray(), 'owner_id'); + return $this->handleUsers($userIds); + } + + return []; + } + + protected function handleUsers($userIds) + { + $userRepo = new UserRepo(); + + $users = $userRepo->findByIds($userIds); + + $result = []; + + foreach ($users as $user) { + $result[] = [ + 'id' => $user->id, + 'name' => $user->name, + 'avatar' => $user->avatar, + 'title' => $user->title, + 'about' => $user->about, + 'vip' => $user->vip, + ]; + } + + return $result; + } + + /** + * @param int $limit + * @return ResultsetInterface|Resultset + */ + protected function findRandArticleOwners($limit = 10) + { + return ArticleModel::query() + ->columns(['owner_id']) + ->orderBy('RAND()') + ->limit($limit) + ->execute(); + } + + /** + * @param int $limit + * @return ResultsetInterface|Resultset + */ + protected function findWeeklyAuthorRankings($limit = 10) + { + $createTime = strtotime('monday this week'); + + $columns = [ + 'author_id' => 'a.owner_id', + 'like_count' => 'count(al.user_id)', + ]; + + return $this->modelsManager->createBuilder() + ->columns($columns) + ->addFrom(ArticleLikeModel::class, 'al') + ->join(ArticleModel::class, 'al.article_id = a.id', 'a') + ->where('al.create_time > :create_time:', ['create_time' => $createTime]) + ->groupBy('author_id') + ->orderBy('like_count DESC') + ->limit($limit)->getQuery()->execute(); + } + +} diff --git a/app/Caches/ArticleRelatedList.php b/app/Caches/ArticleRelatedList.php new file mode 100644 index 00000000..de602a27 --- /dev/null +++ b/app/Caches/ArticleRelatedList.php @@ -0,0 +1,81 @@ +lifetime; + } + + public function getKey($id = null) + { + return "article_related_list:{$id}"; + } + + public function getContent($id = null) + { + $this->articleId = $id; + + $articleRepo = new ArticleRepo(); + + $article = $articleRepo->findById($id); + + if (empty($article->tags)) return []; + + $tagIds = kg_array_column($article->tags, 'id'); + + $randKey = array_rand($tagIds); + + $where = [ + 'tag_id' => $tagIds[$randKey], + 'published' => 1, + ]; + + $pager = $articleRepo->paginate($where); + + if ($pager->total_items == 0) return []; + + return $this->handleContent($pager->items); + } + + /** + * @param ArticleModel[] $articles + * @return array + */ + public function handleContent($articles) + { + $result = []; + + $count = 0; + + foreach ($articles as $article) { + if ($article->id != $this->articleId && $count < $this->limit) { + $result[] = [ + 'id' => $article->id, + 'title' => $article->title, + 'cover' => $article->cover, + 'view_count' => $article->view_count, + 'like_count' => $article->like_count, + 'comment_count' => $article->comment_count, + 'favorite_count' => $article->favorite_count, + ]; + $count++; + } + } + + return $result; + } + +} diff --git a/app/Caches/MaxArticleId.php b/app/Caches/MaxArticleId.php new file mode 100644 index 00000000..7fa89590 --- /dev/null +++ b/app/Caches/MaxArticleId.php @@ -0,0 +1,29 @@ +lifetime; + } + + public function getKey($id = null) + { + return 'max_article_id'; + } + + public function getContent($id = null) + { + $article = ArticleModel::findFirst(['order' => 'id DESC']); + + return $article->id ?? 0; + } + +} diff --git a/app/Caches/MaxTagId.php b/app/Caches/MaxTagId.php new file mode 100644 index 00000000..8faf25e3 --- /dev/null +++ b/app/Caches/MaxTagId.php @@ -0,0 +1,29 @@ +lifetime; + } + + public function getKey($id = null) + { + return 'max_tag_id'; + } + + public function getContent($id = null) + { + $tag = TagModel::findFirst(['order' => 'id DESC']); + + return $tag->id ?? 0; + } + +} diff --git a/app/Caches/Tag.php b/app/Caches/Tag.php new file mode 100644 index 00000000..58ba0922 --- /dev/null +++ b/app/Caches/Tag.php @@ -0,0 +1,31 @@ +lifetime; + } + + public function getKey($id = null) + { + return "tag:{$id}"; + } + + public function getContent($id = null) + { + $tagRepo = new TagRepo(); + + $tag = $tagRepo->findById($id); + + return $tag ?: null; + } + +} diff --git a/app/Caches/UserDailyCounter.php b/app/Caches/UserDailyCounter.php index 3382ace4..2409dee2 100644 --- a/app/Caches/UserDailyCounter.php +++ b/app/Caches/UserDailyCounter.php @@ -28,6 +28,7 @@ class UserDailyCounter extends Counter 'chapter_like_count' => 0, 'consult_like_count' => 0, 'review_like_count' => 0, + 'article_like_count' => 0, ]; } diff --git a/app/Http/Admin/Controllers/ArticleController.php b/app/Http/Admin/Controllers/ArticleController.php new file mode 100644 index 00000000..14a3b3af --- /dev/null +++ b/app/Http/Admin/Controllers/ArticleController.php @@ -0,0 +1,155 @@ +url->get( + ['for' => 'admin.category.list'], + ['type' => CategoryModel::TYPE_ARTICLE] + ); + + $this->response->redirect($location); + } + + /** + * @Get("/search", name="admin.article.search") + */ + public function searchAction() + { + $articleService = new ArticleService(); + + $sourceTypes = $articleService->getSourceTypes(); + $categories = $articleService->getCategories(); + $xmTags = $articleService->getXmTags(0); + + $this->view->setVar('source_types', $sourceTypes); + $this->view->setVar('categories', $categories); + $this->view->setVar('xm_tags', $xmTags); + } + + /** + * @Get("/list", name="admin.article.list") + */ + public function listAction() + { + $articleService = new ArticleService(); + + $pager = $articleService->getArticles(); + + $this->view->setVar('pager', $pager); + } + + /** + * @Get("/add", name="admin.article.add") + */ + public function addAction() + { + $articleService = new ArticleService(); + + $categories = $articleService->getCategories(); + + $this->view->setVar('categories', $categories); + } + + /** + * @Post("/create", name="admin.article.create") + */ + public function createAction() + { + $articleService = new ArticleService(); + + $article = $articleService->createArticle(); + + $location = $this->url->get([ + 'for' => 'admin.article.edit', + 'id' => $article->id, + ]); + + $content = [ + 'location' => $location, + 'msg' => '创建文章成功', + ]; + + return $this->jsonSuccess($content); + } + + /** + * @Get("/{id:[0-9]+}/edit", name="admin.article.edit") + */ + public function editAction($id) + { + $articleService = new ArticleService(); + + $sourceTypes = $articleService->getSourceTypes(); + $categories = $articleService->getCategories(); + $article = $articleService->getArticle($id); + $xmTags = $articleService->getXmTags($id); + + $this->view->setVar('source_types', $sourceTypes); + $this->view->setVar('categories', $categories); + $this->view->setVar('article', $article); + $this->view->setVar('xm_tags', $xmTags); + } + + /** + * @Post("/{id:[0-9]+}/update", name="admin.article.update") + */ + public function updateAction($id) + { + $articleService = new ArticleService(); + + $articleService->updateArticle($id); + + $content = ['msg' => '更新文章成功']; + + return $this->jsonSuccess($content); + } + + /** + * @Post("/{id:[0-9]+}/delete", name="admin.article.delete") + */ + public function deleteAction($id) + { + $articleService = new ArticleService(); + + $articleService->deleteArticle($id); + + $content = [ + 'location' => $this->request->getHTTPReferer(), + 'msg' => '删除文章成功', + ]; + + return $this->jsonSuccess($content); + } + + /** + * @Post("/{id:[0-9]+}/restore", name="admin.article.restore") + */ + public function restoreAction($id) + { + $articleService = new ArticleService(); + + $articleService->restoreArticle($id); + + $content = [ + 'location' => $this->request->getHTTPReferer(), + 'msg' => '还原文章成功', + ]; + + return $this->jsonSuccess($content); + } + +} diff --git a/app/Http/Admin/Controllers/CommentController.php b/app/Http/Admin/Controllers/CommentController.php new file mode 100644 index 00000000..c67e875e --- /dev/null +++ b/app/Http/Admin/Controllers/CommentController.php @@ -0,0 +1,81 @@ +getComments(); + + $this->view->setVar('pager', $pager); + } + + /** + * @Post("/{id:[0-9]+}/update", name="admin.comment.update") + */ + public function updateAction($id) + { + $commentService = new CommentService(); + + $commentService->updateComment($id); + + $content = ['msg' => '更新评论成功']; + + return $this->jsonSuccess($content); + } + + /** + * @Post("/{id:[0-9]+}/delete", name="admin.comment.delete") + */ + public function deleteAction($id) + { + $commentService = new CommentService(); + + $commentService->deleteComment($id); + + $content = [ + 'location' => $this->request->getHTTPReferer(), + 'msg' => '删除评论成功', + ]; + + return $this->jsonSuccess($content); + } + + /** + * @Post("/{id:[0-9]+}/restore", name="admin.comment.restore") + */ + public function restoreAction($id) + { + $commentService = new CommentService(); + + $commentService->restoreComment($id); + + $content = [ + 'location' => $this->request->getHTTPReferer(), + 'msg' => '还原评论成功', + ]; + + return $this->jsonSuccess($content); + } + +} diff --git a/app/Http/Admin/Controllers/Controller.php b/app/Http/Admin/Controllers/Controller.php index 36b974c9..2c7b5f1d 100644 --- a/app/Http/Admin/Controllers/Controller.php +++ b/app/Http/Admin/Controllers/Controller.php @@ -47,7 +47,7 @@ class Controller extends \Phalcon\Mvc\Controller * 特例白名单 */ $whitelist = [ - 'controllers' => ['public', 'index', 'vod', 'upload', 'test'], + 'controllers' => ['public', 'index', 'upload', 'test'], 'routes' => [], ]; diff --git a/app/Http/Admin/Controllers/PublicController.php b/app/Http/Admin/Controllers/PublicController.php index e5b84bbc..7db202ed 100644 --- a/app/Http/Admin/Controllers/PublicController.php +++ b/app/Http/Admin/Controllers/PublicController.php @@ -50,4 +50,17 @@ class PublicController extends \Phalcon\Mvc\Controller $this->view->setVar('region', $region); } + /** + * @Get("/vod/player", name="admin.vod_player") + */ + public function vodPlayerAction() + { + $chapterId = $this->request->getQuery('chapter_id', 'int'); + $playUrl = $this->request->getQuery('play_url', 'string'); + + $this->view->pick('public/vod_player'); + $this->view->setVar('chapter_id', $chapterId); + $this->view->setVar('play_url', $playUrl); + } + } diff --git a/app/Http/Admin/Controllers/TagController.php b/app/Http/Admin/Controllers/TagController.php new file mode 100644 index 00000000..9979134a --- /dev/null +++ b/app/Http/Admin/Controllers/TagController.php @@ -0,0 +1,132 @@ +getTags(); + + $this->view->setVar('pager', $pager); + } + + /** + * @Get("/search", name="admin.tag.search") + */ + public function searchAction() + { + + } + + /** + * @Get("/add", name="admin.tag.add") + */ + public function addAction() + { + + } + + /** + * @Get("/{id:[0-9]+}/edit", name="admin.tag.edit") + */ + public function editAction($id) + { + $tagService = new TagService; + + $tag2 = $tagService->getTag($id); + + /** + * 注意:"tag"变量被volt引擎内置占用,另取名字避免冲突 + */ + $this->view->setVar('tag2', $tag2); + } + + /** + * @Post("/create", name="admin.tag.create") + */ + public function createAction() + { + $tagService = new TagService(); + + $tagService->createTag(); + + $location = $this->url->get(['for' => 'admin.tag.list']); + + $content = [ + 'location' => $location, + 'msg' => '创建标签成功', + ]; + + return $this->jsonSuccess($content); + } + + /** + * @Post("/{id:[0-9]+}/update", name="admin.tag.update") + */ + public function updateAction($id) + { + $tagService = new TagService(); + + $tagService->updateTag($id); + + $location = $this->url->get(['for' => 'admin.tag.list']); + + $content = [ + 'location' => $location, + 'msg' => '更新标签成功', + ]; + + return $this->jsonSuccess($content); + } + + /** + * @Post("/{id:[0-9]+}/delete", name="admin.tag.delete") + */ + public function deleteAction($id) + { + $tagService = new TagService(); + + $tagService->deleteTag($id); + + $location = $this->request->getHTTPReferer(); + + $content = [ + 'location' => $location, + 'msg' => '删除标签成功', + ]; + + return $this->jsonSuccess($content); + } + + /** + * @Post("/{id:[0-9]+}/restore", name="admin.tag.restore") + */ + public function restoreAction($id) + { + $tagService = new TagService(); + + $tagService->restoreTag($id); + + $location = $this->request->getHTTPReferer(); + + $content = [ + 'location' => $location, + 'msg' => '还原标签成功', + ]; + + return $this->jsonSuccess($content); + } + +} diff --git a/app/Http/Admin/Controllers/UploadController.php b/app/Http/Admin/Controllers/UploadController.php index a6acddf0..25edb530 100644 --- a/app/Http/Admin/Controllers/UploadController.php +++ b/app/Http/Admin/Controllers/UploadController.php @@ -3,6 +3,7 @@ namespace App\Http\Admin\Controllers; use App\Services\MyStorage as StorageService; +use App\Services\Vod as VodService; /** * @RoutePrefix("/admin/upload") @@ -126,8 +127,10 @@ class UploadController extends Controller $items['user_avatar'] = $service->uploadDefaultUserAvatar(); $items['group_avatar'] = $service->uploadDefaultGroupAvatar(); + $items['article_cover'] = $service->uploadDefaultArticleCover(); $items['course_cover'] = $service->uploadDefaultCourseCover(); - $items['group_cover'] = $service->uploadDefaultPackageCover(); + $items['package_cover'] = $service->uploadDefaultPackageCover(); + $items['gift_cover'] = $service->uploadDefaultGiftCover(); $items['vip_cover'] = $service->uploadDefaultVipCover(); foreach ($items as $item) { @@ -138,9 +141,9 @@ class UploadController extends Controller } /** - * @Get("/sign", name="admin.upload.sign") + * @Post("/credentials", name="admin.upload.credentials") */ - public function signatureAction() + public function credentialsAction() { $service = new StorageService(); @@ -155,4 +158,16 @@ class UploadController extends Controller return $this->jsonSuccess($data); } + /** + * @Post("/vod/sign", name="admin.upload.vod_sign") + */ + public function vodSignatureAction() + { + $service = new VodService(); + + $sign = $service->getUploadSignature(); + + return $this->jsonSuccess(['sign' => $sign]); + } + } diff --git a/app/Http/Admin/Controllers/VodController.php b/app/Http/Admin/Controllers/VodController.php deleted file mode 100644 index 4ee0f40b..00000000 --- a/app/Http/Admin/Controllers/VodController.php +++ /dev/null @@ -1,38 +0,0 @@ -getUploadSignature(); - - return $this->jsonSuccess(['sign' => $sign]); - } - - /** - * @Get("/player", name="admin.vod.player") - */ - public function playerAction() - { - $chapterId = $this->request->getQuery('chapter_id', 'int'); - $playUrl = $this->request->getQuery('play_url', 'string'); - - $this->view->pick('public/vod_player'); - $this->view->setVar('chapter_id', $chapterId); - $this->view->setVar('play_url', $playUrl); - } - -} diff --git a/app/Http/Admin/Services/Article.php b/app/Http/Admin/Services/Article.php new file mode 100644 index 00000000..8c4dabdd --- /dev/null +++ b/app/Http/Admin/Services/Article.php @@ -0,0 +1,287 @@ +findAll(['published' => 1], 'priority'); + + if ($allTags->count() == 0) return []; + + $articleTagIds = []; + + if ($id > 0) { + $article = $this->findOrFail($id); + if (!empty($article->tags)) { + $articleTagIds = kg_array_column($article->tags, 'id'); + } + } + + $list = []; + + foreach ($allTags as $tag) { + $selected = in_array($tag->id, $articleTagIds); + $list[] = [ + 'name' => $tag->name, + 'value' => $tag->id, + 'selected' => $selected, + ]; + } + + return $list; + } + + public function getCategories() + { + $categoryRepo = new CategoryRepo(); + + return $categoryRepo->findAll([ + 'type' => CategoryModel::TYPE_ARTICLE, + 'level' => 1, + 'published' => 1, + ]); + } + + public function getSourceTypes() + { + return ArticleModel::sourceTypes(); + } + + public function getArticles() + { + $pagerQuery = new PagerQuery(); + + $params = $pagerQuery->getParams(); + + if (!empty($params['xm_tag_ids'])) { + $params['tag_id'] = explode(',', $params['xm_tag_ids']); + } + + $params['deleted'] = $params['deleted'] ?? 0; + + $sort = $pagerQuery->getSort(); + $page = $pagerQuery->getPage(); + $limit = $pagerQuery->getLimit(); + + $articleRepo = new ArticleRepo(); + + $pager = $articleRepo->paginate($params, $sort, $page, $limit); + + return $this->handleArticles($pager); + } + + public function getArticle($id) + { + return $this->findOrFail($id); + } + + public function createArticle() + { + $post = $this->request->getPost(); + + $loginUser = $this->getLoginUser(); + + $validator = new ArticleValidator(); + + $category = $validator->checkCategory($post['category_id']); + $title = $validator->checkTitle($post['title']); + + $article = new ArticleModel(); + + $article->owner_id = $loginUser->id; + $article->category_id = $category->id; + $article->title = $title; + + $article->create(); + + return $article; + } + + public function updateArticle($id) + { + $post = $this->request->getPost(); + + $article = $this->findOrFail($id); + + $validator = new ArticleValidator(); + + $data = []; + + if (isset($post['category_id'])) { + $category = $validator->checkCategory($post['category_id']); + $data['category_id'] = $category->id; + } + + if (isset($post['title'])) { + $data['title'] = $validator->checkTitle($post['title']); + } + + if (isset($post['cover'])) { + $data['cover'] = $validator->checkCover($post['cover']); + } + + if (isset($post['summary'])) { + $data['summary'] = $validator->checkSummary($post['summary']); + } + + if (isset($post['content'])) { + $data['content'] = $validator->checkContent($post['content']); + $data['word_count'] = WordUtil::getWordCount($data['content']); + } + + if (isset($post['source_type'])) { + $data['source_type'] = $validator->checkSourceType($post['source_type']); + if ($post['source_type'] != ArticleModel::SOURCE_ORIGIN) { + $data['source_url'] = $validator->checkSourceUrl($post['source_url']); + } + } + + if (isset($post['allow_comment'])) { + $data['allow_comment'] = $post['allow_comment']; + } + + if (isset($post['featured'])) { + $data['featured'] = $validator->checkFeatureStatus($post['featured']); + } + + if (isset($post['published'])) { + $data['published'] = $validator->checkPublishStatus($post['published']); + } + + if (isset($post['xm_tag_ids'])) { + $this->saveTags($article, $post['xm_tag_ids']); + } + + $article->update($data); + + return $article; + } + + public function deleteArticle($id) + { + $article = $this->findOrFail($id); + $article->deleted = 1; + $article->update(); + + return $article; + } + + public function restoreArticle($id) + { + $article = $this->findOrFail($id); + $article->deleted = 0; + $article->update(); + + return $article; + } + + protected function findOrFail($id) + { + $validator = new ArticleValidator(); + + return $validator->checkArticle($id); + } + + protected function rebuildArticleCache(ArticleModel $article) + { + $cache = new ArticleCache(); + + $cache->rebuild($article->id); + } + + protected function rebuildArticleIndex(ArticleModel $article) + { + $sync = new ArticleIndexSync(); + + $sync->addItem($article->id); + } + + protected function saveTags(ArticleModel $article, $tagIds) + { + $originTagIds = []; + + if ($article->tags) { + $originTagIds = kg_array_column($article->tags, 'id'); + } + + $newTagIds = $tagIds ? explode(',', $tagIds) : []; + $addedTagIds = array_diff($newTagIds, $originTagIds); + + if ($addedTagIds) { + foreach ($addedTagIds as $tagId) { + $articleTag = new ArticleTagModel(); + $articleTag->article_id = $article->id; + $articleTag->tag_id = $tagId; + $articleTag->create(); + } + } + + $deletedTagIds = array_diff($originTagIds, $newTagIds); + + if ($deletedTagIds) { + $articleTagRepo = new ArticleTagRepo(); + foreach ($deletedTagIds as $tagId) { + $articleTag = $articleTagRepo->findArticleTag($article->id, $tagId); + if ($articleTag) { + $articleTag->delete(); + } + } + } + + $articleTags = []; + + if ($newTagIds) { + $tagRepo = new TagRepo(); + $tags = $tagRepo->findByIds($newTagIds); + if ($tags->count() > 0) { + $articleTags = []; + foreach ($tags as $tag) { + $articleTags[] = ['id' => $tag->id, 'name' => $tag->name]; + } + } + } + + $article->tags = $articleTags; + + $article->update(); + } + + protected function handleArticles($pager) + { + if ($pager->total_items > 0) { + + $builder = new ArticleListBuilder(); + + $items = $pager->items->toArray(); + + $pipeA = $builder->handleArticles($items); + $pipeB = $builder->handleCategories($pipeA); + $pipeC = $builder->handleUsers($pipeB); + $pipeD = $builder->objects($pipeC); + + $pager->items = $pipeD; + } + + return $pager; + } + +} diff --git a/app/Http/Admin/Services/AuthNode.php b/app/Http/Admin/Services/AuthNode.php index 646c0dec..4e260dc9 100644 --- a/app/Http/Admin/Services/AuthNode.php +++ b/app/Http/Admin/Services/AuthNode.php @@ -243,6 +243,117 @@ class AuthNode extends Service ], ], ], + [ + 'id' => '1-7', + 'title' => '文章管理', + 'type' => 'menu', + 'children' => [ + [ + 'id' => '1-7-1', + 'title' => '文章列表', + 'type' => 'menu', + 'route' => 'admin.article.list', + ], + [ + 'id' => '1-7-2', + 'title' => '搜索文章', + 'type' => 'menu', + 'route' => 'admin.article.search', + ], + [ + 'id' => '1-7-3', + 'title' => '添加文章', + 'type' => 'menu', + 'route' => 'admin.article.add', + ], + [ + 'id' => '1-7-4', + 'title' => '编辑文章', + 'type' => 'button', + 'route' => 'admin.article.edit', + ], + [ + 'id' => '1-7-5', + 'title' => '删除文章', + 'type' => 'button', + 'route' => 'admin.article.delete', + ], + [ + 'id' => '1-7-6', + 'title' => '文章分类', + 'type' => 'menu', + 'route' => 'admin.article.category', + ], + ], + ], + [ + 'id' => '1-8', + 'title' => '标签管理', + 'type' => 'menu', + 'children' => [ + [ + 'id' => '1-8-1', + 'title' => '标签列表', + 'type' => 'menu', + 'route' => 'admin.tag.list', + ], + [ + 'id' => '1-8-2', + 'title' => '搜索标签', + 'type' => 'menu', + 'route' => 'admin.tag.search', + ], + [ + 'id' => '1-8-3', + 'title' => '添加标签', + 'type' => 'menu', + 'route' => 'admin.tag.add', + ], + [ + 'id' => '1-8-4', + 'title' => '编辑标签', + 'type' => 'button', + 'route' => 'admin.tag.edit', + ], + [ + 'id' => '1-8-5', + 'title' => '删除标签', + 'type' => 'button', + 'route' => 'admin.tag.delete', + ], + ], + ], + [ + 'id' => '1-9', + 'title' => '评论管理', + 'type' => 'button', + 'children' => [ + [ + 'id' => '1-9-1', + 'title' => '评论列表', + 'type' => 'button', + 'route' => 'admin.comment.list', + ], + [ + 'id' => '1-9-2', + 'title' => '搜索评论', + 'type' => 'button', + 'route' => 'admin.comment.search', + ], + [ + 'id' => '1-9-3', + 'title' => '编辑评论', + 'type' => 'button', + 'route' => 'admin.comment.edit', + ], + [ + 'id' => '1-9-4', + 'title' => '删除评论', + 'type' => 'button', + 'route' => 'admin.comment.delete', + ], + ], + ], ], ]; } diff --git a/app/Http/Admin/Services/Comment.php b/app/Http/Admin/Services/Comment.php new file mode 100644 index 00000000..1410587a --- /dev/null +++ b/app/Http/Admin/Services/Comment.php @@ -0,0 +1,105 @@ +getParams(); + + $params['deleted'] = $params['deleted'] ?? 0; + + $sort = $pagerQuery->getSort(); + $page = $pagerQuery->getPage(); + $limit = $pagerQuery->getLimit(); + + $commentRepo = new CommentRepo(); + + $pager = $commentRepo->paginate($params, $sort, $page, $limit); + + return $this->handleComments($pager); + } + + public function getComment($id) + { + return $this->findOrFail($id); + } + + public function updateComment($id) + { + $comment = $this->findOrFail($id); + + $post = $this->request->getPost(); + + $validator = new CommentValidator(); + + $data = []; + + if (isset($post['content'])) { + $data['content'] = $validator->checkContent($post['content']); + } + + if (isset($post['published'])) { + $data['published'] = $validator->checkPublishStatus($post['published']); + } + + $comment->update($data); + + return $comment; + } + + public function deleteComment($id) + { + $page = $this->findOrFail($id); + + $page->deleted = 1; + + $page->update(); + + return $page; + } + + public function restoreComment($id) + { + $page = $this->findOrFail($id); + + $page->deleted = 0; + + $page->update(); + + return $page; + } + + protected function findOrFail($id) + { + $validator = new CommentValidator(); + + return $validator->checkComment($id); + } + + protected function handleComments($pager) + { + if ($pager->total_items > 0) { + + $builder = new CommentListBuilder(); + + $pipeA = $pager->items->toArray(); + $pipeB = $builder->handleUsers($pipeA); + $pipeC = $builder->objects($pipeB); + + $pager->items = $pipeC; + } + + return $pager; + } + +} diff --git a/app/Http/Admin/Services/Course.php b/app/Http/Admin/Services/Course.php index 12c858f4..b4bebaa6 100644 --- a/app/Http/Admin/Services/Course.php +++ b/app/Http/Admin/Services/Course.php @@ -38,13 +38,11 @@ class Course extends Service $params = $pagerQuery->getParams(); if (!empty($params['xm_category_ids'])) { - $xmCategoryIds = explode(',', $params['xm_category_ids']); - $params['category_id'] = count($xmCategoryIds) > 1 ? $xmCategoryIds : $xmCategoryIds[0]; + $params['category_id'] = explode(',', $params['xm_category_ids']); } if (!empty($params['xm_teacher_ids'])) { - $xmTeacherIds = explode(',', $params['xm_teacher_ids']); - $params['teacher_id'] = count($xmTeacherIds) > 1 ? $xmTeacherIds : $xmTeacherIds[0]; + $params['teacher_id'] = explode(',', $params['xm_teacher_ids']); } $params['deleted'] = $params['deleted'] ?? 0; @@ -288,7 +286,7 @@ class Course extends Service $allCategories = $categoryRepo->findAll([ 'type' => CategoryModel::TYPE_COURSE, - 'deleted' => 0, + 'published' => 1, ]); if ($allCategories->count() == 0) return []; @@ -456,12 +454,11 @@ class Course extends Service if ($addedTeacherIds) { foreach ($addedTeacherIds as $teacherId) { $courseTeacher = new CourseUserModel(); - $courseTeacher->create([ - 'course_id' => $course->id, - 'user_id' => $teacherId, - 'role_type' => CourseUserModel::ROLE_TEACHER, - 'source_type' => CourseUserModel::SOURCE_IMPORT, - ]); + $courseTeacher->course_id = $course->id; + $courseTeacher->user_id = $teacherId; + $courseTeacher->role_type = CourseUserModel::ROLE_TEACHER; + $courseTeacher->source_type = CourseUserModel::SOURCE_IMPORT; + $courseTeacher->create(); } } @@ -509,10 +506,9 @@ class Course extends Service if ($addedCategoryIds) { foreach ($addedCategoryIds as $categoryId) { $courseCategory = new CourseCategoryModel(); - $courseCategory->create([ - 'course_id' => $course->id, - 'category_id' => $categoryId, - ]); + $courseCategory->course_id = $course->id; + $courseCategory->category_id = $categoryId; + $courseCategory->create(); } } @@ -568,18 +564,16 @@ class Course extends Service $record = $courseRelatedRepo->findCourseRelated($course->id, $relatedId); if (!$record) { $courseRelated = new CourseRelatedModel(); - $courseRelated->create([ - 'course_id' => $course->id, - 'related_id' => $relatedId, - ]); + $courseRelated->course_id = $course->id; + $courseRelated->related_id = $relatedId; + $courseRelated->create(); } $record = $courseRelatedRepo->findCourseRelated($relatedId, $course->id); if (!$record) { $courseRelated = new CourseRelatedModel(); - $courseRelated->create([ - 'course_id' => $relatedId, - 'related_id' => $course->id, - ]); + $courseRelated->course_id = $relatedId; + $courseRelated->related_id = $course->id; + $courseRelated->create(); } } } diff --git a/app/Http/Admin/Services/Page.php b/app/Http/Admin/Services/Page.php index 91f33750..50f6184c 100644 --- a/app/Http/Admin/Services/Page.php +++ b/app/Http/Admin/Services/Page.php @@ -109,11 +109,11 @@ class Page extends Service return $page; } - protected function rebuildPageCache(PageModel $help) + protected function rebuildPageCache(PageModel $page) { $cache = new PageCache(); - $cache->rebuild($help->id); + $cache->rebuild($page->id); } protected function findOrFail($id) diff --git a/app/Http/Admin/Services/Student.php b/app/Http/Admin/Services/Student.php index 188693e8..a8e9ea5c 100644 --- a/app/Http/Admin/Services/Student.php +++ b/app/Http/Admin/Services/Student.php @@ -63,8 +63,6 @@ class Student extends Service $params = $pagerQuery->getParams(); - $params['deleted'] = 0; - $sort = $pagerQuery->getSort(); $page = $pagerQuery->getPage(); $limit = $pagerQuery->getLimit(); diff --git a/app/Http/Admin/Services/Tag.php b/app/Http/Admin/Services/Tag.php new file mode 100644 index 00000000..b0a75ef5 --- /dev/null +++ b/app/Http/Admin/Services/Tag.php @@ -0,0 +1,126 @@ +getParams(); + + $params['deleted'] = $params['deleted'] ?? 0; + + $sort = 'priority'; + $page = $pagerQuery->getPage(); + $limit = $pagerQuery->getLimit(); + + $tagRepo = new TagRepo(); + + return $tagRepo->paginate($params, $sort, $page, $limit); + } + + public function getTag($id) + { + return $this->findOrFail($id); + } + + public function createTag() + { + $post = $this->request->getPost(); + + $validator = new TagValidator(); + + $tag = new TagModel(); + + $tag->name = $validator->checkName($post['name']); + $tag->published = $validator->checkPublishStatus($post['published']); + + $tag->create(); + + $this->rebuildTagCache($tag); + + return $tag; + } + + public function updateTag($id) + { + $tag = $this->findOrFail($id); + + $post = $this->request->getPost(); + + $validator = new TagValidator(); + + $data = []; + + if (isset($post['name'])) { + $data['name'] = $validator->checkName($post['name']); + if ($data['name'] != $tag->name) { + $validator->checkIfNameExists($data['name']); + } + } + + if (isset($post['priority'])) { + $data['priority'] = $validator->checkPriority($post['priority']); + } + + if (isset($post['published'])) { + $data['published'] = $validator->checkPublishStatus($post['published']); + } + + $tag->update($data); + + $this->rebuildTagCache($tag); + + return $tag; + } + + public function deleteTag($id) + { + $tag = $this->findOrFail($id); + + $tag->deleted = 1; + + $tag->update(); + + $this->rebuildTagCache($tag); + + return $tag; + } + + public function restoreTag($id) + { + $tag = $this->findOrFail($id); + + $tag->deleted = 0; + + $tag->update(); + + $this->rebuildTagCache($tag); + + return $tag; + } + + protected function rebuildTagCache(TagModel $tag) + { + $cache = new TagCache(); + + $cache->rebuild($tag->id); + } + + protected function findOrFail($id) + { + $validator = new TagValidator(); + + return $validator->checkTag($id); + } + +} diff --git a/app/Http/Admin/Views/article/add.volt b/app/Http/Admin/Views/article/add.volt new file mode 100644 index 00000000..81e6d1e4 --- /dev/null +++ b/app/Http/Admin/Views/article/add.volt @@ -0,0 +1,35 @@ +{% extends 'templates/main.volt' %} + +{% block content %} + +

+
+ 添加文章 +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + +
+
+
+ +{% endblock %} diff --git a/app/Http/Admin/Views/article/edit.volt b/app/Http/Admin/Views/article/edit.volt new file mode 100644 index 00000000..49ad9cc1 --- /dev/null +++ b/app/Http/Admin/Views/article/edit.volt @@ -0,0 +1,72 @@ +{% extends 'templates/main.volt' %} + +{% block content %} + +
+ 编辑文章 +
+ +
+
    +
  • 基本信息
  • +
  • 文章内容
  • +
+
+
+ {{ partial('article/edit_basic') }} +
+
+ {{ partial('article/edit_desc') }} +
+
+
+ +{% endblock %} + +{% block link_css %} + + {{ css_link('https://cdn.jsdelivr.net/npm/vditor/dist/index.css', false) }} + +{% endblock %} + +{% block include_js %} + + {{ js_include('https://cdn.jsdelivr.net/npm/vditor/dist/index.min.js', false) }} + {{ js_include('lib/xm-select.js') }} + {{ js_include('admin/js/cover.upload.js') }} + {{ js_include('admin/js/vditor.js') }} + +{% endblock %} + +{% block inline_js %} + + + +{% endblock %} \ No newline at end of file diff --git a/app/Http/Admin/Views/article/edit_basic.volt b/app/Http/Admin/Views/article/edit_basic.volt new file mode 100644 index 00000000..70d75e4a --- /dev/null +++ b/app/Http/Admin/Views/article/edit_basic.volt @@ -0,0 +1,67 @@ +{% set source_url_display = article.source_type == 1 ? 'display:none' : 'display:block' %} + +
+
+ +
+ + +
+
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+
+
+
+ +
+ {% for value,title in source_types %} + + {% endfor %} +
+
+
+
+ +
+ +
+
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
\ No newline at end of file diff --git a/app/Http/Admin/Views/article/edit_desc.volt b/app/Http/Admin/Views/article/edit_desc.volt new file mode 100644 index 00000000..70123beb --- /dev/null +++ b/app/Http/Admin/Views/article/edit_desc.volt @@ -0,0 +1,22 @@ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+ +
+ + +
+
+
\ No newline at end of file diff --git a/app/Http/Admin/Views/article/list.volt b/app/Http/Admin/Views/article/list.volt new file mode 100644 index 00000000..4dde3172 --- /dev/null +++ b/app/Http/Admin/Views/article/list.volt @@ -0,0 +1,183 @@ +{% extends 'templates/main.volt' %} + +{% block content %} + + {{ partial('macros/article') }} + + {% set add_url = url({'for':'admin.article.add'}) %} + {% set search_url = url({'for':'admin.article.search'}) %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + {% for item in pager.items %} + {% set preview_url = url({'for':'home.article.show','id':item.id}) %} + {% set edit_url = url({'for':'admin.article.edit','id':item.id}) %} + {% set update_url = url({'for':'admin.article.update','id':item.id}) %} + {% set delete_url = url({'for':'admin.article.delete','id':item.id}) %} + {% set restore_url = url({'for':'admin.article.restore','id':item.id}) %} + {% set comment_url = url({'for':'admin.comment.list'},{'item_id':item.id,'item_type':2}) %} + + + + + + + + + + + {% endfor %} + +
文章来源作者统计推荐评论发布操作
+

标题:{{ item.title }}({{ item.id }})

+

+ {% if item.category.id is defined %} + 分类:{{ item.category.name }} + {% endif %} + {% if item.tags %} + 标签:{{ tags_info(item.tags) }} + {% endif %} +

+

创建:{{ date('Y-m-d H:i',item.create_time) }},更新:{{ date('Y-m-d H:i',item.update_time) }}

+
{{ source_info(item.source_type,item.source_url) }} +

昵称:{{ item.owner.name }}

+

编号:{{ item.owner.id }}

+
+

浏览:{{ item.view_count }},评论:{{ item.comment_count }}

+

点赞:{{ item.like_count }},收藏:{{ item.favorite_count }}

+
+
+ + +
+
+ + {{ partial('partials/pager') }} + +{% endblock %} + +{% block inline_js %} + + + +{% endblock %} \ No newline at end of file diff --git a/app/Http/Admin/Views/article/search.volt b/app/Http/Admin/Views/article/search.volt new file mode 100644 index 00000000..a71ed0d8 --- /dev/null +++ b/app/Http/Admin/Views/article/search.volt @@ -0,0 +1,104 @@ +{% extends 'templates/main.volt' %} + +{% block content %} + +
+
+ 搜索文章 +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+
+
+
+ +
+ {% for value,title in source_types %} + + {% endfor %} +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +{% endblock %} + +{% block include_js %} + + {{ js_include('lib/xm-select.js') }} + +{% endblock %} + +{% block inline_js %} + + + +{% endblock %} \ No newline at end of file diff --git a/app/Http/Admin/Views/category/list.volt b/app/Http/Admin/Views/category/list.volt index 65a614ad..dec3b755 100644 --- a/app/Http/Admin/Views/category/list.volt +++ b/app/Http/Admin/Views/category/list.volt @@ -4,7 +4,7 @@ {% 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 allow_add = (type == 1 and parent.level < 2) or (type == 2 and parent.level < 1) %} + {% set allow_add = (type == 1 and parent.level < 2) or (type == 2 and parent.level < 1) or (type == 3 and parent.level < 1) %}
@@ -55,7 +55,9 @@ {{ item.id }} {% if item.type == 1 and item.level < 2 %} {{ item.name }} - {% else %} + {% elseif item.type == 2 %} + {{ item.name }} + {% elseif item.type == 3 %} {{ item.name }} {% endif %} {{ item.level }} diff --git a/app/Http/Admin/Views/comment/edit.volt b/app/Http/Admin/Views/comment/edit.volt new file mode 100644 index 00000000..292772af --- /dev/null +++ b/app/Http/Admin/Views/comment/edit.volt @@ -0,0 +1,98 @@ +{% extends 'templates/main.volt' %} + +{% block content %} + +
+
+ 编辑评价 +
+
+ +
+
+ +
+
+
+ +
+
+ +
+
+
+ +
+
+ +
+
+
+ +
+
{{ review.content }}
+
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +{% endblock %} + +{% block inline_js %} + + + +{% endblock %} \ No newline at end of file diff --git a/app/Http/Admin/Views/comment/list.volt b/app/Http/Admin/Views/comment/list.volt new file mode 100644 index 00000000..64071a58 --- /dev/null +++ b/app/Http/Admin/Views/comment/list.volt @@ -0,0 +1,63 @@ +{% extends 'templates/main.volt' %} + +{% block content %} + + {{ partial('macros/common') }} + + + + + + + + + + + + + + + + + + + + {% for item in pager.items %} + {% set update_url = url({'for':'admin.comment.update','id':item.id}) %} + {% set delete_url = url({'for':'admin.comment.delete','id':item.id}) %} + {% set restore_url = url({'for':'admin.comment.restore','id':item.id}) %} + + + + + + + + {% endfor %} + +
评论用户终端发布操作
+

内容:{{ substr(item.content,0,30) }}

+

时间:{{ date('Y-m-d H:i',item.create_time) }},点赞:{{ item.like_count }}

+
+

昵称:{{ item.owner.name }}

+

编号:{{ item.owner.id }}

+
+

类型:{{ client_type(item.client_type) }}

+

地址:查看

+
+ {% if item.deleted == 0 %} + 删除 + {% else %} + 还原 + {% endif %} +
+ + {{ partial('partials/pager') }} + +{% endblock %} + +{% block include_js %} + + {{ js_include('admin/js/ip2region.js') }} + +{% endblock %} \ No newline at end of file diff --git a/app/Http/Admin/Views/comment/search.volt b/app/Http/Admin/Views/comment/search.volt new file mode 100644 index 00000000..b0c4a8b7 --- /dev/null +++ b/app/Http/Admin/Views/comment/search.volt @@ -0,0 +1,50 @@ +{% extends 'templates/main.volt' %} + +{% block content %} + +
+
+ 搜索评价 +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +{% endblock %} \ No newline at end of file diff --git a/app/Http/Admin/Views/macros/article.volt b/app/Http/Admin/Views/macros/article.volt new file mode 100644 index 00000000..0c025121 --- /dev/null +++ b/app/Http/Admin/Views/macros/article.volt @@ -0,0 +1,18 @@ +{%- macro source_info(type,url) %} + {% if type == 1 %} + 原创 + {% elseif type == 2 %} + 转载 + {% elseif type == 3 %} + 翻译 + {% else %} + N/A + {% endif %} +{%- endmacro %} + +{%- macro tags_info(items) %} + {% for item in items %} + {% set comma = loop.last ? '' : ',' %} + {{ item.name ~ comma }} + {% endfor %} +{%- endmacro %} \ No newline at end of file diff --git a/app/Http/Admin/Views/macros/common.volt b/app/Http/Admin/Views/macros/common.volt new file mode 100644 index 00000000..3cbb38fd --- /dev/null +++ b/app/Http/Admin/Views/macros/common.volt @@ -0,0 +1,13 @@ +{%- macro client_type(value) %} + {% if value == 1 %} + PC + {% elseif value == 2 %} + H5 + {% elseif value == 3 %} + APP + {% elseif value == 4 %} + 小程序 + {% else %} + N/A + {% endif %} +{%- endmacro %} \ No newline at end of file diff --git a/app/Http/Admin/Views/macros/course.volt b/app/Http/Admin/Views/macros/course.volt index 5b513d11..2f7de032 100644 --- a/app/Http/Admin/Views/macros/course.volt +++ b/app/Http/Admin/Views/macros/course.volt @@ -4,7 +4,7 @@ {% elseif value == 2 %} 直播 {% elseif value == 3 %} - 专栏 + 图文 {% elseif value == 4 %} 面授 {% else %} diff --git a/app/Http/Admin/Views/setting/site.volt b/app/Http/Admin/Views/setting/site.volt index 59dab4c0..a7ace3ba 100644 --- a/app/Http/Admin/Views/setting/site.volt +++ b/app/Http/Admin/Views/setting/site.volt @@ -141,7 +141,6 @@ {% endblock %} - {% block inline_js %}