Toggle navigation
Toggle navigation
This project
Loading...
Sign in
OnePoem
/
OnePoem-Server
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
李帅
2023-03-28 15:21:25 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
bb0ce89f3d0d906f66c77d8de11a03a38399d198
bb0ce89f
1 parent
3011228e
1.又重构一言表,新增一个字段
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
3 deletions
app/Admin/Controllers/OnePoemController.php
app/Jobs/AdminMakeImmerse.php
app/Models/OneSentence.php
database/migrations/2023_03_28_150848_alter_one_sentences_table.php
resources/lang/zh_CN/one-poem.php
app/Admin/Controllers/OnePoemController.php
View file @
bb0ce89
...
...
@@ -48,7 +48,7 @@ class OnePoemController extends AdminController
$grid
->
column
(
''
,
'诗句组'
)
->
display
(
'展开'
)
->
expand
(
function
(){
$th
=
[
'id'
,
'一言Id'
,
'正文'
,
'注释'
,
'拼音'
,
'英文'
,
'创建时间'
,
'修改时间'
];
$th
=
[
'id'
,
'一言Id'
,
'正文'
,
'注释'
,
'拼音'
,
'英文'
,
'
出处'
,
'
创建时间'
,
'修改时间'
];
return
Table
::
make
(
$th
,
$this
->
verses
->
toArray
())
->
withBorder
();
});
$grid
->
column
(
'created_at'
);
...
...
@@ -76,6 +76,7 @@ class OnePoemController extends AdminController
$show
->
field
(
'annotate'
);
$show
->
field
(
'spelling'
);
$show
->
field
(
'en'
);
$show
->
field
(
'source'
);
$show
->
field
(
'poetry_id'
);
$show
->
field
(
'created_at'
);
$show
->
field
(
'updated_at'
);
...
...
@@ -112,6 +113,7 @@ class OnePoemController extends AdminController
$form
->
textarea
(
'annotate'
);
$form
->
textarea
(
'spelling'
);
$form
->
textarea
(
'en'
);
$form
->
textarea
(
'source'
);
})
->
useTable
();
$form
->
display
(
'created_at'
);
...
...
app/Jobs/AdminMakeImmerse.php
View file @
bb0ce89
...
...
@@ -226,7 +226,23 @@ class AdminMakeImmerse implements ShouldQueue
case
'one_poem_with_annotate'
:
foreach
(
$this
->
adminMakeVideo
->
poem2
->
verses
as
$item
)
{
if
(
$item
->
content
!=
''
)
$contents
[]
=
$this
->
autoEnter
(
$item
->
content
,
$font_size
,
$this
->
output_width
);
if
(
$item
->
annotate
!=
''
)
$contents
[]
=
$this
->
autoEnter
(
$item
->
content
,
$font_size
,
$this
->
output_width
);
if
(
$item
->
annotate
!=
''
)
$contents
[]
=
$this
->
autoEnter
(
$item
->
annotate
,
$font_size
,
$this
->
output_width
);
}
break
;
case
'one_poem_with_annotate_and_source'
:
foreach
(
$this
->
adminMakeVideo
->
poem2
->
verses
as
$item
)
{
if
(
$item
->
content
!=
''
)
$contents
[]
=
$this
->
autoEnter
(
$item
->
content
,
$font_size
,
$this
->
output_width
);
if
(
$item
->
annotate
!=
''
)
$contents
[]
=
$this
->
autoEnter
(
$item
->
annotate
,
$font_size
,
$this
->
output_width
);
if
(
$item
->
source
!=
''
)
$contents
[]
=
$this
->
autoEnter
(
$item
->
source
,
$font_size
,
$this
->
output_width
);
}
break
;
case
'one_poem_with_all'
:
foreach
(
$this
->
adminMakeVideo
->
poem2
->
verses
as
$item
)
{
if
(
$item
->
content
!=
''
)
$contents
[]
=
$this
->
autoEnter
(
$item
->
content
,
$font_size
,
$this
->
output_width
);
if
(
$item
->
annotate
!=
''
)
$contents
[]
=
$this
->
autoEnter
(
$item
->
annotate
,
$font_size
,
$this
->
output_width
);
if
(
$item
->
spelling
!=
''
)
$contents
[]
=
$this
->
autoEnter
(
$item
->
spelling
,
$font_size
,
$this
->
output_width
);
if
(
$item
->
en
!=
''
)
$contents
[]
=
$this
->
autoEnter
(
$item
->
en
,
$font_size
,
$this
->
output_width
);
if
(
$item
->
source
!=
''
)
$contents
[]
=
$this
->
autoEnter
(
$item
->
source
,
$font_size
,
$this
->
output_width
);
}
break
;
case
'weather'
:
...
...
@@ -268,6 +284,8 @@ class AdminMakeImmerse implements ShouldQueue
$contents
=
[];
//
switch
(
$component
->
name
){
case
'one_poem_with_annotate'
:
case
'one_poem_with_annotate_and_source'
:
case
'one_poem_with_all'
:
case
'one_poem'
:
$stanzas
=
''
;
foreach
(
$this
->
adminMakeVideo
->
poem2
->
verses
as
$item
)
{
...
...
app/Models/OneSentence.php
View file @
bb0ce89
...
...
@@ -9,7 +9,7 @@ class OneSentence extends Model
{
use
HasFactory
;
protected
$fillable
=
[
'content'
,
'annotate'
,
'spelling'
,
'en'
];
protected
$fillable
=
[
'content'
,
'annotate'
,
'spelling'
,
'en'
,
'source'
];
public
function
poem2
()
{
...
...
database/migrations/2023_03_28_150848_alter_one_sentences_table.php
0 → 100644
View file @
bb0ce89
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
AlterOneSentencesTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
table
(
'one_sentences'
,
function
(
Blueprint
$table
)
{
$table
->
string
(
'source'
)
->
after
(
'en'
)
->
default
(
''
)
->
comment
(
'出处'
);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
dropColumns
(
'one_sentences'
,
[
'source'
]);
}
}
resources/lang/zh_CN/one-poem.php
View file @
bb0ce89
...
...
@@ -11,6 +11,7 @@ return [
'annotate'
=>
'注解'
,
'spelling'
=>
'拼音'
,
'en'
=>
'英文解释'
,
'source'
=>
'出处'
,
'poetry_id'
=>
'诗词id'
,
'state'
=>
'状态'
,
...
...
Please
register
or
login
to post a comment