Skip to content

Commit 2b3db21

Browse files
committed
feat: reward
1 parent 9cd99dd commit 2b3db21

File tree

193 files changed

+1525
-540
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+1525
-540
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,21 @@ AdminMenu::register(function () {
283283
- [https://modstart.com/forum](https://modstart.com/forum)
284284

285285

286+
## ⭐️ 贡献代码
287+
288+
系统接受 Github 和 Gitee 的 Pull Request,欢迎提交代码。
289+
290+
文件 `/vendor/modstart/modstart` 底层代码修改,可以提交 PR 到以下仓库,该仓库会在每次发版自动合入所有系统。
291+
292+
- `Github` [https://github.com/modstart-lib/modstart](https://github.com/modstart-lib/modstart)
293+
- `Gitee` [https://gitee.com/modstart-lib/modstart](https://gitee.com/modstart-lib/modstart)
294+
295+
如果是非底层代码修改,可具体提交 PR 到以下仓库
296+
297+
- `Github` [https://github.com/modstart/ModStartBlog](https://github.com/modstart/ModStartBlog)
298+
- `Gitee` [https://gitee.com/modstart/ModStartBlog](https://gitee.com/modstart/ModStartBlog)
299+
300+
286301
## ✉️ 使用交流
287302

288303
### QQ交流群

module/AdminManager/Asset/entry/upgrade.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

module/AdminManager/resources/asset/src/pages/Upgrade.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@
179179
class="tw-bg-white tw-rounded-sm tw-mb-2 tw-box tw-px-5 tw-py-3 tw-mb-3 tw-flex tw-items-center tw-zoom-in">
180180
<div class="tw-w-10 tw-h-10 tw-flex-none tw-image-fit tw-rounded-full tw-overflow-hidden">
181181
<div class="circle tw-border tw-border-gray-200 tw-border-solid tw-shadow ub-cover-1-1"
182-
:style="{backgroundImage:`url(${memberUser.avatar||'/asset/image/avatar.png'})`}"></div>
182+
:style="{backgroundImage:`url(${memberUser.avatar||'/asset/image/avatar.svg'})`}"></div>
183183
</div>
184184
<div class="tw-ml-4 tw-mr-auto">
185185
<div class="tw-font-medium">{{memberUser.username || ''}}</div>

module/Blog/Admin/Controller/BlogController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ protected function crud(AdminCRUDBuilder $builder)
4141
$builder->textarea('seoDescription', 'SEO描述')->listable(false);
4242
$builder->datetime('postTime', '发布时间')->defaultValue(date('Y-m-d H:i:s'));
4343
$builder->switch('isTop', '置顶')->gridEditable(true);
44+
$builder->switch('isHot', '热门')->gridEditable(true);
45+
$builder->switch('isRecommend', '推荐')->gridEditable(true);
4446
$builder->switch('isPublished', '发布')->optionsYesNo()->defaultValue(true);
4547
$builder->display('created_at', L('Created At'))->listable(false);
4648
$builder->display('updated_at', L('Updated At'))->listable(false);

module/Blog/Core/BlogRewardBiz.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
4+
namespace Module\Blog\Core;
5+
6+
7+
use Module\Reward\Biz\AbstractRewardBiz;
8+
9+
class BlogRewardBiz extends AbstractRewardBiz
10+
{
11+
const NAME = 'blog';
12+
13+
public function name()
14+
{
15+
return self::NAME;
16+
}
17+
18+
public function title()
19+
{
20+
return '博客';
21+
}
22+
23+
}

module/Blog/Core/MBlog.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,33 @@ public static function latestBlog($limit)
2222
return $paginateData['records'];
2323
}
2424

25+
26+
public static function topestBlog($limit)
27+
{
28+
$paginateData = self::paginateBlog(0, 1, $limit, [
29+
'isTop' => true,
30+
]);
31+
return $paginateData['records'];
32+
}
33+
34+
35+
public static function hotBlog($limit)
36+
{
37+
$paginateData = self::paginateBlog(0, 1, $limit, [
38+
'isHot' => true,
39+
]);
40+
return $paginateData['records'];
41+
}
42+
43+
44+
public static function recommendBlog($limit)
45+
{
46+
$paginateData = self::paginateBlog(0, 1, $limit, [
47+
'isRecommend' => true,
48+
]);
49+
return $paginateData['records'];
50+
}
51+
2552

2653

2754
public static function hottestBlog($limit)

module/Blog/Core/ModuleServiceProvider.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Module\Banner\Biz\BannerPositionBiz;
1313
use Module\Banner\Biz\QuickBannerPositionBiz;
1414
use Module\Blog\Util\BlogCategoryUtil;
15+
use Module\Reward\Biz\RewardBiz;
1516
use Module\Vendor\Admin\Config\AdminWidgetDashboard;
1617
use Module\Vendor\Admin\Config\AdminWidgetLink;
1718
use Module\Vendor\Provider\HomePage\HomePageProvider;
@@ -98,6 +99,9 @@ public function boot(Dispatcher $events)
9899
if (class_exists(SiteUrlBiz::class)) {
99100
SiteUrlBiz::register(BlogSiteUrlBiz::class);
100101
}
102+
if (modstart_module_enabled('Reward')) {
103+
RewardBiz::register(BlogRewardBiz::class);
104+
}
101105
}
102106

103107

module/Blog/Docs/release.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
## 2.4.0
1+
## 2.5.0
2+
3+
- 新增:置顶、热门、推荐博客获取函数
4+
- 新增:博客热门、博客推荐功能
5+
- 新增:适配通用打赏功能,需安装 Reward 和 PayCenter
6+
7+
---
8+
9+
## 2.4.0 博客内容置顶,界面样式和动效优化
210

311
- 新增:博客内容置顶功能,后台快捷编辑
412
- 优化:博客标签、分类、最近内容、信息等样式优化

module/Blog/Migrate/2022_05_26_000000_blog_fields_modify.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public function up()
1111
Schema::table('blog', function (Blueprint $table) {
1212

1313
$table->tinyInteger('isTop')->nullable()->comment('置顶');
14-
$table->integer('commentCount')->nullable()->comment('置顶');
14+
$table->integer('commentCount')->nullable()->comment('评论数量');
1515

1616
});
1717
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
use Illuminate\Database\Schema\Blueprint;
4+
use Illuminate\Database\Migrations\Migration;
5+
6+
class BlogFieldsRecommendHotModify extends Migration
7+
{
8+
9+
public function up()
10+
{
11+
Schema::table('blog', function (Blueprint $table) {
12+
13+
$table->tinyInteger('isHot')->nullable()->comment('热门');
14+
$table->tinyInteger('isRecommend')->nullable()->comment('推荐');
15+
16+
});
17+
}
18+
19+
20+
public function down()
21+
{
22+
23+
}
24+
}

0 commit comments

Comments
 (0)