Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
webman-blog
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
魏洲
webman-blog
Commits
564341a9
Commit
564341a9
authored
May 17, 2022
by
wolfocde
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
58ae7c14
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
83 additions
and
88 deletions
+83
-88
edit.html
app/admin/view/article/edit.html
+1
-1
index.html
app/admin/view/article/index.html
+3
-3
BlogBase.php
app/common/controller/BlogBase.php
+1
-1
Category.php
app/controller/Category.php
+2
-2
Index.php
app/controller/Index.php
+1
-1
Info.php
app/controller/Info.php
+3
-3
InstallCheck.php
app/middleware/InstallCheck.php
+61
-66
Article.php
app/model/Article.php
+1
-1
index.html
app/view/category/index.html
+2
-2
index.html
app/view/index/index.html
+2
-2
index.html
app/view/info/index.html
+2
-2
database.sql
extend/database.sql
+2
-2
my_blog.sql
extend/my_blog.sql
+2
-2
No files found.
app/admin/view/article/edit.html
View file @
564341a9
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label required"
>
分类
</label>
<label
class=
"layui-form-label required"
>
分类
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<select
class=
"layui-select"
name=
"c_id"
>
<select
class=
"layui-select"
name=
"c
ategory
_id"
>
{volist name='category' id='vo'}
{volist name='category' id='vo'}
<option
value=
"{$key}"
>
{$vo}
</option>
<option
value=
"{$key}"
>
{$vo}
</option>
{/volist}
{/volist}
...
...
app/admin/view/article/index.html
View file @
564341a9
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
<div
class=
"layui-inline"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
分类
</label>
<label
class=
"layui-form-label"
>
分类
</label>
<div
class=
"layui-input-inline"
>
<div
class=
"layui-input-inline"
>
<select
class=
"layui-select"
name=
"c_id"
data-search-op=
"="
>
<select
class=
"layui-select"
name=
"c
ategory
_id"
data-search-op=
"="
>
<option
value=
""
>
- 全部 -
</option>
<option
value=
""
>
- 全部 -
</option>
{volist name='category' id='vo'}
{volist name='category' id='vo'}
<option
value=
"{$key}"
>
{$vo}
</option>
<option
value=
"{$key}"
>
{$vo}
</option>
...
@@ -88,9 +88,9 @@
...
@@ -88,9 +88,9 @@
{
field
:
'id'
,
width
:
80
,
title
:
'ID'
},
{
field
:
'id'
,
width
:
80
,
title
:
'ID'
},
{
field
:
'title'
,
minWidth
:
200
,
title
:
'标题'
},
{
field
:
'title'
,
minWidth
:
200
,
title
:
'标题'
},
{
{
field
:
'c_id'
,
minWidth
:
100
,
title
:
'分类'
,
templet
:
function
(
res
)
{
field
:
'c
ategory
_id'
,
minWidth
:
100
,
title
:
'分类'
,
templet
:
function
(
res
)
{
let
category
=
JSON
.
parse
(
category_json
)
let
category
=
JSON
.
parse
(
category_json
)
return
category
[
res
.
c_id
]
return
category
[
res
.
c
ategory
_id
]
}
}
},
},
{
{
...
...
app/common/controller/BlogBase.php
View file @
564341a9
...
@@ -20,7 +20,7 @@ class BlogBase
...
@@ -20,7 +20,7 @@ class BlogBase
$template
=
$controller
.
'/'
.
$action
;
$template
=
$controller
.
'/'
.
$action
;
$category
=
Category
::
getColumn
([
'status'
=>
1
],
'title'
,
'id'
,
'sort desc,id asc'
);
$category
=
Category
::
getColumn
([
'status'
=>
1
],
'title'
,
'id'
,
'sort desc,id asc'
);
$map
[]
=
[
'status'
,
'='
,
1
];
$map
[]
=
[
'status'
,
'='
,
1
];
$popular_list
=
Article
::
getList
(
$map
,
'id,title,img,desc,c_time,article_date,c_id'
,
'click desc,id desc'
,
1
,
10
);
$popular_list
=
Article
::
getList
(
$map
,
'id,title,img,desc,c_time,article_date,c
ategory
_id'
,
'click desc,id desc'
,
1
,
10
);
$assign
=
$assign
+
compact
(
'category'
,
'controller'
,
'action'
,
'popular_list'
);
$assign
=
$assign
+
compact
(
'category'
,
'controller'
,
'action'
,
'popular_list'
);
return
view
(
$template
,
$assign
);
return
view
(
$template
,
$assign
);
}
}
...
...
app/controller/Category.php
View file @
564341a9
...
@@ -19,8 +19,8 @@ class Category extends BlogBase
...
@@ -19,8 +19,8 @@ class Category extends BlogBase
if
(
empty
(
$categoryInfo
))
return
$this
->
jump404
();
if
(
empty
(
$categoryInfo
))
return
$this
->
jump404
();
$limit
=
10
;
$limit
=
10
;
$where
[]
=
[
'status'
,
'='
,
1
];
$where
[]
=
[
'status'
,
'='
,
1
];
$where
[]
=
[
'c_id'
,
'='
,
$id
];
$where
[]
=
[
'c
ategory
_id'
,
'='
,
$id
];
$list
=
Article
::
getList
(
$where
,
'id,title,img,desc,c_time,article_date,c_id'
,
'id desc'
,
$page
,
$limit
);
$list
=
Article
::
getList
(
$where
,
'id,title,img,desc,c_time,article_date,c
ategory
_id'
,
'id desc'
,
$page
,
$limit
);
if
(
empty
(
$list
))
return
redirect
(
"/category/
{
$id
}
/"
);
if
(
empty
(
$list
))
return
redirect
(
"/category/
{
$id
}
/"
);
$paginator
=
new
Paginator
(
Article
::
getCount
(
$where
),
$limit
,
$page
,
"/category/
{
$id
}
/page/(:num)/"
);
$paginator
=
new
Paginator
(
Article
::
getCount
(
$where
),
$limit
,
$page
,
"/category/
{
$id
}
/page/(:num)/"
);
$paginator
->
setPreviousText
(
'上页'
);
$paginator
->
setPreviousText
(
'上页'
);
...
...
app/controller/Index.php
View file @
564341a9
...
@@ -15,7 +15,7 @@ class Index extends BlogBase
...
@@ -15,7 +15,7 @@ class Index extends BlogBase
{
{
$limit
=
10
;
$limit
=
10
;
$where
[]
=
[
'status'
,
'='
,
1
];
$where
[]
=
[
'status'
,
'='
,
1
];
$list
=
Article
::
getList
(
$where
,
'id,title,img,desc,c_time,article_date,c_id'
,
'article_date desc,id desc'
,
$page
,
$limit
);
$list
=
Article
::
getList
(
$where
,
'id,title,img,desc,c_time,article_date,c
ategory
_id'
,
'article_date desc,id desc'
,
$page
,
$limit
);
if
(
empty
(
$list
))
return
redirect
(
'/'
);
if
(
empty
(
$list
))
return
redirect
(
'/'
);
$banner
=
Banner
::
getList
(
$where
,
'id,title,img,link,target,desc'
,
'id desc'
,
1
,
10
);
$banner
=
Banner
::
getList
(
$where
,
'id,title,img,link,target,desc'
,
'id desc'
,
1
,
10
);
$paginator
=
new
Paginator
(
Article
::
getCount
(
$where
),
$limit
,
$page
,
'/page/(:num)/'
);
$paginator
=
new
Paginator
(
Article
::
getCount
(
$where
),
$limit
,
$page
,
'/page/(:num)/'
);
...
...
app/controller/Info.php
View file @
564341a9
...
@@ -14,13 +14,13 @@ class Info extends BlogBase
...
@@ -14,13 +14,13 @@ class Info extends BlogBase
if
(
empty
(
$id
))
return
$this
->
jump404
();
if
(
empty
(
$id
))
return
$this
->
jump404
();
$where
[]
=
[
'status'
,
'='
,
1
];
$where
[]
=
[
'status'
,
'='
,
1
];
$where
[]
=
[
'id'
,
'='
,
$id
];
$where
[]
=
[
'id'
,
'='
,
$id
];
$info
=
Article
::
getOne
(
$where
,
'id,title,img,desc,c_time,article_date,c_id,content,click'
);
$info
=
Article
::
getOne
(
$where
,
'id,title,img,desc,c_time,article_date,c
ategory
_id,content,click'
);
if
(
empty
(
$info
))
return
$this
->
jump404
();
if
(
empty
(
$info
))
return
$this
->
jump404
();
Article
::
incClick
(
$id
);
// 增加 点击 次数
Article
::
incClick
(
$id
);
// 增加 点击 次数
$map
[]
=
[
'status'
,
'='
,
1
];
$map
[]
=
[
'status'
,
'='
,
1
];
$map
[]
=
[
'id'
,
'<>'
,
$id
];
$map
[]
=
[
'id'
,
'<>'
,
$id
];
$map
[]
=
[
'c
_id'
,
'='
,
$info
[
'c
_id'
]];
$map
[]
=
[
'c
ategory_id'
,
'='
,
$info
[
'category
_id'
]];
$more
=
Article
::
getList
(
$map
,
'id,title,img,desc,c_time,article_date,c_id'
,
'article_date desc,id desc'
,
1
,
6
);
$more
=
Article
::
getList
(
$map
,
'id,title,img,desc,c_time,article_date,c
ategory
_id'
,
'article_date desc,id desc'
,
1
,
6
);
return
$this
->
blog_tpl
(
compact
(
'info'
,
'more'
));
return
$this
->
blog_tpl
(
compact
(
'info'
,
'more'
));
}
}
...
...
app/middleware/InstallCheck.php
View file @
564341a9
...
@@ -15,71 +15,66 @@ class InstallCheck implements MiddlewareInterface
...
@@ -15,71 +15,66 @@ class InstallCheck implements MiddlewareInterface
{
{
public
function
process
(
Request
$request
,
callable
$handler
)
:
Response
public
function
process
(
Request
$request
,
callable
$handler
)
:
Response
{
{
$base_path
=
base_path
()
.
DIRECTORY_SEPARATOR
.
'extend'
.
DIRECTORY_SEPARATOR
;
return
$handler
(
$request
);
$lock_file
=
$base_path
.
'install.lock'
;
// $base_path = base_path() . DIRECTORY_SEPARATOR . 'extend' . DIRECTORY_SEPARATOR;
if
(
file_exists
(
$lock_file
))
{
// $lock_file = $base_path . 'install.lock';
return
$handler
(
$request
);
// if (file_exists($lock_file)) {
}
// return $handler($request);
if
(
version_compare
(
PHP_VERSION
,
'7.4.0'
,
'<'
))
{
// }
$errorMsg
=
"PHP版本需要7.4或者以上,推荐8.1+"
;
// if (version_compare(PHP_VERSION, '7.1.0', '<')) {
return
response
(
$errorMsg
,
400
);
// $errorMsg = "PHP版本需要7.4或者以上,推荐8.1+";
}
// return response($errorMsg, 400);
$db_base_data
=
$base_path
.
'database.sql'
;
// }
$sql_data
=
$base_path
.
'sqldata.sql'
;
// $db_base_data = $base_path . 'database.sql';
if
(
file_exists
(
$db_base_data
)
===
false
)
{
// $sql_data = $base_path . 'my_blog.sql';
$errorMsg
=
"数据库基础获取异常,请确认
{
$db_base_data
}
文件是否存在"
;
// if (file_exists($db_base_data) === false) {
return
response
(
$errorMsg
,
400
);
// $errorMsg = "数据库基础获取异常,请确认{$db_base_data}文件是否存在";
}
// return response($errorMsg, 400);
if
(
file_exists
(
$sql_data
)
===
false
)
{
// }
$errorMsg
=
"数据库基础获取异常,请确认
{
$sql_data
}
文件是否存在"
;
// if (file_exists($sql_data) === false) {
return
response
(
$errorMsg
,
400
);
// $errorMsg = "数据库基础获取异常,请确认{$sql_data}文件是否存在";
}
// return response($errorMsg, 400);
$dbHost
=
env
(
'db_host'
);
// }
$dbUser
=
env
(
'db_username'
);
// $dbHost = env('db_host');
$dbPwd
=
env
(
'db_password'
);
// $dbUser = env('db_username');
$dbPort
=
env
(
'db_port'
);
// $dbPwd = env('db_password');
$dbCharset
=
env
(
'db_charset'
);
// $dbPort = env('db_port');
$dbName
=
env
(
'db_database'
);
// $dbCharset = env('db_charset');
try
{
// $dbName = env('db_database');
$conn
=
mysqli_connect
(
$dbHost
,
$dbUser
,
$dbPwd
,
null
,
$dbPort
);
// try {
mysqli_query
(
$conn
,
"SET NAMES
{
$dbCharset
}
"
);
// $conn = mysqli_connect($dbHost, $dbUser, $dbPwd, null, $dbPort);
$initDb
=
mysqli_select_db
(
$conn
,
$dbName
);
// mysqli_query($conn, "SET NAMES {$dbCharset}");
if
(
!
$initDb
)
{
// $initDb = mysqli_select_db($conn, $dbName);
if
(
!
mysqli_query
(
$conn
,
"CREATE DATABASE IF NOT EXISTS `
{
$dbName
}
` DEFAULT CHARACTER SET
{
$dbCharset
}
;"
))
{
// if (!$initDb) {
$errorMsg
=
"数据库
{
$dbName
}
不存在,也没权限创建新的数据库!"
;
// if (!mysqli_query($conn, "CREATE DATABASE IF NOT EXISTS `{$dbName}` DEFAULT CHARACTER SET {$dbCharset};")) {
mysqli_close
(
$conn
);
// $errorMsg = "数据库{$dbName} 不存在,也没权限创建新的数据库!";
return
response
(
$errorMsg
,
400
);
// mysqli_close($conn);
}
// return response($errorMsg, 400);
}
// }
// 先建表
// }
$db_data
=
file_get_contents
(
$db_base_data
);
// // 先建表
$sqlFormat
=
sql_split
(
$db_data
);
// $db_data = file_get_contents($db_base_data);
$counts
=
count
(
$sqlFormat
);
// $sqlFormat = sql_split($db_data);
mysqli_select_db
(
$conn
,
$dbName
);
// $counts = count($sqlFormat);
for
(
$index
=
0
;
$index
<
$counts
;
$index
++
)
{
// mysqli_select_db($conn, $dbName);
$sql
=
trim
(
$sqlFormat
[
$index
]);
// for ($index = 0; $index < $counts; $index++) {
if
(
strstr
(
$sql
,
'CREATE TABLE'
))
{
// $sql = trim($sqlFormat[$index]);
mysqli_query
(
$conn
,
$sql
);
// if (strstr($sql, 'CREATE TABLE')) {
}
// mysqli_query($conn, $sql);
$index
++
;
// }
}
// $index++;
$sql2
=
file_get_contents
(
$sql_data
);
// }
$exp
=
array_filter
(
explode
(
'INSERT INTO'
,
(
$sql2
)));
// @touch($base_path . 'install.lock');
foreach
(
$exp
as
$value
)
{
// // $sql = file_get_contents($sql_data);
$query_sql
=
'INSERT INTO '
.
htmlspecialchars_decode
(
$value
);
// // if (!mysqli_select_db($conn, $dbName)) {
mysqli_query
(
$conn
,
$query_sql
);
// // $errorMsg = "数据表{$dbName}不存在!";
}
// // return response($errorMsg, 400);
mysqli_close
(
$conn
);
// // }
// @touch($base_path . 'install.lock');
// // $exp = array_filter(explode('INSERT INTO', ($sql)));
return
$handler
(
$request
);
// // foreach ($exp as $value) {
}
catch
(
\Exception
$e
)
{
// // $query_sql = 'INSERT INTO ' . htmlspecialchars_decode($value);
$errorMsg
=
"连接 MySQL 失败: "
.
mysqli_connect_error
()
.
$e
->
getMessage
();
// // mysqli_query($conn, $query_sql);
return
response
(
$errorMsg
,
400
);
// // }
}
// return $handler($request);
// } catch (\Exception $e) {
// $errorMsg = "连接 MySQL 失败: " . mysqli_connect_error() . $e->getMessage();
// return response($errorMsg, 400);
// }
}
}
}
}
\ No newline at end of file
app/model/Article.php
View file @
564341a9
...
@@ -18,7 +18,7 @@ class Article extends Model
...
@@ -18,7 +18,7 @@ class Article extends Model
public
function
categoryInfo
()
:
HasOne
public
function
categoryInfo
()
:
HasOne
{
{
return
$this
->
hasOne
(
Category
::
class
,
'id'
,
'c_id'
)
->
field
(
'id,title'
);
return
$this
->
hasOne
(
Category
::
class
,
'id'
,
'c
ategory
_id'
)
->
field
(
'id,title'
);
}
}
public
static
function
incClick
(
int
$id
=
0
,
int
$i
=
1
)
public
static
function
incClick
(
int
$id
=
0
,
int
$i
=
1
)
...
...
app/view/category/index.html
View file @
564341a9
...
@@ -31,8 +31,8 @@
...
@@ -31,8 +31,8 @@
<a
href=
"/info/{$vo.id}/"
>
{$vo.article_date}
</a>
<a
href=
"/info/{$vo.id}/"
>
{$vo.article_date}
</a>
</div>
</div>
<div
class=
"gdlr-core-blog-info gdlr-core-blog-info-font gdlr-core-skin-caption gdlr-core-blog-info-category"
>
<div
class=
"gdlr-core-blog-info gdlr-core-blog-info-font gdlr-core-skin-caption gdlr-core-blog-info-category"
>
<a
href=
"/category/{$vo.c_id}/"
rel=
"tag"
>
<a
href=
"/category/{$vo.c
ategory
_id}/"
rel=
"tag"
>
{$category[$vo['c_id']]|default='-'}
{$category[$vo['c
ategory
_id']]|default='-'}
</a>
</a>
</div>
</div>
</div>
</div>
...
...
app/view/index/index.html
View file @
564341a9
...
@@ -55,8 +55,8 @@
...
@@ -55,8 +55,8 @@
<a
href=
"/info/{$vo.id}/"
>
{$vo.article_date}
</a>
<a
href=
"/info/{$vo.id}/"
>
{$vo.article_date}
</a>
</div>
</div>
<div
class=
"gdlr-core-blog-info gdlr-core-blog-info-font gdlr-core-skin-caption gdlr-core-blog-info-category"
>
<div
class=
"gdlr-core-blog-info gdlr-core-blog-info-font gdlr-core-skin-caption gdlr-core-blog-info-category"
>
<a
href=
"/category/{$vo.c_id}/"
rel=
"tag"
>
<a
href=
"/category/{$vo.c
ategory
_id}/"
rel=
"tag"
>
{$category[$vo['c_id']]|default='-'}
{$category[$vo['c
ategory
_id']]|default='-'}
</a>
</a>
</div>
</div>
</div>
</div>
...
...
app/view/info/index.html
View file @
564341a9
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<div
class=
"gdlr-core-page-builder-body"
>
<div
class=
"gdlr-core-page-builder-body"
>
<div
class=
"gdlr-core-pbf-sidebar-wrapper "
>
<div
class=
"gdlr-core-pbf-sidebar-wrapper "
>
<div
class=
"gdlr-core-pbf-sidebar-container gdlr-core-line-height-0 clearfix gdlr-core-js gdlr-core-container"
>
<div
class=
"gdlr-core-pbf-sidebar-container gdlr-core-line-height-0 clearfix gdlr-core-js gdlr-core-container"
>
<div
class=
"sitemap"
>
当前位置:
<a
href=
"/"
>
首页
</a>
>
<a
href=
"/category/{$info.c
_id}/"
>
{$category[$info.c
_id]|default='-'}
</a>
>
{$info.title}
</div>
<div
class=
"sitemap"
>
当前位置:
<a
href=
"/"
>
首页
</a>
>
<a
href=
"/category/{$info.c
ategory_id}/"
>
{$category[$info.category
_id]|default='-'}
</a>
>
{$info.title}
</div>
<div
class=
"gdlr-core-pbf-sidebar-content gdlr-core-column-40 gdlr-core-pbf-sidebar-padding gdlr-core-line-height gdlr-core-column-extend-left"
>
<div
class=
"gdlr-core-pbf-sidebar-content gdlr-core-column-40 gdlr-core-pbf-sidebar-padding gdlr-core-line-height gdlr-core-column-extend-left"
>
<div
class=
"gdlr-core-pbf-sidebar-content-inner"
data-skin=
"Blog List"
>
<div
class=
"gdlr-core-pbf-sidebar-content-inner"
data-skin=
"Blog List"
>
<div
class=
"gdlr-core-pbf-element"
>
<div
class=
"gdlr-core-pbf-element"
>
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
<a
href=
"javascript:;"
>
{$info.article_date}
</a>
<a
href=
"javascript:;"
>
{$info.article_date}
</a>
</div>
</div>
<div
class=
"akea-blog-info akea-blog-info-font akea-blog-info-tag "
>
<div
class=
"akea-blog-info akea-blog-info-font akea-blog-info-tag "
>
<a
href=
"/category/{$info.c
_id}"
>
{$category[$info.c
_id]}
</a>
<a
href=
"/category/{$info.c
ategory_id}"
>
{$category[$info.category
_id]}
</a>
</div>
</div>
<div
class=
"akea-blog-info akea-blog-info-font akea-blog-info-comment-number"
>
<div
class=
"akea-blog-info akea-blog-info-font akea-blog-info-comment-number"
>
<span
class=
"akea-head"
><i
class=
"fa fa-clipboard"
></i></span>
{$info.click}
<span
class=
"akea-head"
><i
class=
"fa fa-clipboard"
></i></span>
{$info.click}
...
...
extend/database.sql
View file @
564341a9
...
@@ -6,7 +6,7 @@ CREATE TABLE `article`
...
@@ -6,7 +6,7 @@ CREATE TABLE `article`
`id`
bigint
(
20
)
unsigned
NOT
NULL
AUTO_INCREMENT
,
`id`
bigint
(
20
)
unsigned
NOT
NULL
AUTO_INCREMENT
,
`title`
varchar
(
100
)
NOT
NULL
DEFAULT
''
,
`title`
varchar
(
100
)
NOT
NULL
DEFAULT
''
,
`desc`
varchar
(
255
)
NOT
NULL
DEFAULT
''
,
`desc`
varchar
(
255
)
NOT
NULL
DEFAULT
''
,
`c_id`
int
(
10
)
unsigned
NOT
NULL
DEFAULT
'0'
,
`c
ategory
_id`
int
(
10
)
unsigned
NOT
NULL
DEFAULT
'0'
,
`img`
varchar
(
255
)
NOT
NULL
DEFAULT
''
,
`img`
varchar
(
255
)
NOT
NULL
DEFAULT
''
,
`content`
longtext
,
`content`
longtext
,
`article_date`
date
DEFAULT
NULL
,
`article_date`
date
DEFAULT
NULL
,
...
@@ -16,7 +16,7 @@ CREATE TABLE `article`
...
@@ -16,7 +16,7 @@ CREATE TABLE `article`
`c_time`
datetime
DEFAULT
NULL
,
`c_time`
datetime
DEFAULT
NULL
,
`u_time`
datetime
DEFAULT
NULL
,
`u_time`
datetime
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
,
KEY
`c
_id`
(
`c
_id`
)
USING
BTREE
,
KEY
`c
ategory_id`
(
`category
_id`
)
USING
BTREE
,
KEY
`article_time`
(
`article_date`
)
USING
BTREE
,
KEY
`article_time`
(
`article_date`
)
USING
BTREE
,
KEY
`status`
(
`status`
)
USING
BTREE
KEY
`status`
(
`status`
)
USING
BTREE
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
DYNAMIC
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
DYNAMIC
;
...
...
extend/my_blog.sql
View file @
564341a9
...
@@ -25,7 +25,7 @@ CREATE TABLE `article` (
...
@@ -25,7 +25,7 @@ CREATE TABLE `article` (
`id`
bigint
UNSIGNED
NOT
NULL
AUTO_INCREMENT
,
`id`
bigint
UNSIGNED
NOT
NULL
AUTO_INCREMENT
,
`title`
varchar
(
100
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_general_ci
NOT
NULL
DEFAULT
''
,
`title`
varchar
(
100
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_general_ci
NOT
NULL
DEFAULT
''
,
`desc`
varchar
(
255
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_general_ci
NOT
NULL
DEFAULT
''
,
`desc`
varchar
(
255
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_general_ci
NOT
NULL
DEFAULT
''
,
`c_id`
int
UNSIGNED
NOT
NULL
DEFAULT
0
,
`c
ategory
_id`
int
UNSIGNED
NOT
NULL
DEFAULT
0
,
`img`
varchar
(
255
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_general_ci
NOT
NULL
DEFAULT
''
,
`img`
varchar
(
255
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_general_ci
NOT
NULL
DEFAULT
''
,
`content`
longtext
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_general_ci
NULL
,
`content`
longtext
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_general_ci
NULL
,
`article_date`
date
NULL
DEFAULT
NULL
,
`article_date`
date
NULL
DEFAULT
NULL
,
...
@@ -35,7 +35,7 @@ CREATE TABLE `article` (
...
@@ -35,7 +35,7 @@ CREATE TABLE `article` (
`c_time`
datetime
NULL
DEFAULT
NULL
ON
UPDATE
CURRENT_TIMESTAMP
,
`c_time`
datetime
NULL
DEFAULT
NULL
ON
UPDATE
CURRENT_TIMESTAMP
,
`u_time`
datetime
NULL
DEFAULT
NULL
,
`u_time`
datetime
NULL
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
,
INDEX
`c
_id`
(
`c
_id`
)
USING
BTREE
,
INDEX
`c
ategory_id`
(
`category
_id`
)
USING
BTREE
,
INDEX
`article_time`
(
`article_date`
)
USING
BTREE
,
INDEX
`article_time`
(
`article_date`
)
USING
BTREE
,
INDEX
`status`
(
`status`
)
USING
BTREE
INDEX
`status`
(
`status`
)
USING
BTREE
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
6
CHARACTER
SET
=
utf8mb4
COLLATE
=
utf8mb4_general_ci
ROW_FORMAT
=
Dynamic
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
6
CHARACTER
SET
=
utf8mb4
COLLATE
=
utf8mb4_general_ci
ROW_FORMAT
=
Dynamic
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment