Skip to content

Commit d3bcc06

Browse files
committed
feat: blog category keywords
1 parent 42f45c6 commit d3bcc06

File tree

7 files changed

+71
-10
lines changed

7 files changed

+71
-10
lines changed

module/Blog/Admin/Controller/BlogCategoryController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ protected function crud(AdminCRUDBuilder $builder)
2424

2525
$builder->id('id', 'ID');
2626
$builder->text('title', '名称');
27+
$builder->text('keywords', '关键词');
28+
$builder->textarea('description', '描述');
2729
$builder->display('blogCount', '博客数')->listable(true)->addable(false)->editable(false);
2830
$builder->display('created_at', L('Created At'))->listable(false);
2931
$builder->display('updated_at', L('Updated At'))->listable(false);

module/Blog/Api/Controller/BlogController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ public function paginate()
4545
$category = \MBlog::getCategory($categoryId);
4646
BizException::throwsIfEmpty('分类不存在', $category);
4747
$pageTitle = $category['title'];
48-
$pageKeywords = $category['title'];
49-
$pageDescription = $category['title'];
48+
$pageKeywords = $category['keywords'];
49+
$pageDescription = $category['description'];
5050
}
5151
return Response::generateSuccessData([
5252
'pageTitle' => $pageTitle,

module/Blog/Docs/release.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 2.2.0
2+
3+
- 新增:博客分类增加关键词和描述字段
4+
5+
---
6+
17
## 2.1.0 留言接口,布局优化
28

39
- 新增:博客留言新增接口
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
6+
class ModifyBlogCategoryKeywords extends Migration
7+
{
8+
9+
public function up()
10+
{
11+
Schema::table('blog_category', function (Blueprint $table) {
12+
13+
$table->string('cover', 200)->nullable()->comment('');
14+
$table->string('keywords', 200)->nullable()->comment('');
15+
$table->string('description', 400)->nullable()->comment('');
16+
17+
});
18+
}
19+
20+
21+
public function down()
22+
{
23+
24+
}
25+
}

vendor/modstart/modstart/src/Core/Input/Request.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,15 @@ public static function domainUrl($subdirFix = false)
195195
return $url;
196196
}
197197

198+
/**
199+
* check if current request is get
200+
* @return bool
201+
*/
202+
public static function isGet()
203+
{
204+
return \Illuminate\Support\Facades\Request::isMethod('get');
205+
}
206+
198207
/**
199208
* check if current request is post
200209
* @return bool

vendor/modstart/modstart/src/Widget/TextAjaxRequest.php

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616
* @method static string danger($text, $url, $confirm = null, $disabled = false)
1717
* @method static string success($text, $url, $confirm = null, $disabled = false)
1818
*
19-
* @method void text($text)
20-
* @method void type($type)
21-
* @method void confirm($text)
22-
* @method void url($url)
23-
* @method void disabled($boolean)
19+
* @method $this text($text)
20+
* @method $this type($type)
21+
* @method $this confirm($text)
22+
* @method $this url($url)
23+
* @method $this disabled($boolean)
24+
* @method $this attr($attr)
2425
*/
2526
class TextAjaxRequest extends AbstractWidget
2627
{
@@ -31,6 +32,19 @@ public static function getAssets()
3132
];
3233
}
3334

35+
/**
36+
* @param ...$arguments string type,text,url
37+
* @return $this
38+
*/
39+
public static function make(...$arguments)
40+
{
41+
$ins = new static();
42+
$ins->type($arguments[0]);
43+
$ins->text($arguments[1]);
44+
$ins->url($arguments[2]);
45+
return $ins;
46+
}
47+
3448
public static function __callStatic($name, $arguments)
3549
{
3650
$methods = ['primary', 'muted', 'warning', 'danger', 'success',];
@@ -51,7 +65,12 @@ public function render()
5165
if ($this->disabled) {
5266
return '<a href="javascript:;" class="ub-text-ajax-request ub-text-' . $this->type . '">' . $this->text . '</a>';
5367
} else {
54-
return '<a href="javascript:;" ' . ($this->confirm ? 'data-confirm="' . $this->confirm . '"' : '') . ' data-ajax-request-loading data-ajax-request="' . $this->url . '" class="ub-text-ajax-request ub-text-' . $this->type . '">' . $this->text . '</a>';
68+
return '<a href="javascript:;" ' . ($this->confirm ? 'data-confirm="' . $this->confirm . '"' : '')
69+
. ' data-ajax-request-loading data-ajax-request="' . $this->url
70+
. '" class="ub-text-ajax-request ub-text-' . $this->type . '" '
71+
. ' ' . ($this->attr ? $this->attr : '')
72+
. '>'
73+
. $this->text . '</a>';
5574
}
5675
}
57-
}
76+
}

vendor/modstart/modstart/views/admin/login.blade.php

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)