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-21 16:49:33 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
420c7c36e9c358c31020aa04f1b236c6882729a1
420c7c36
1 parent
8982a1b7
1.重构一言表
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
2 deletions
app/Admin/Controllers/AdminMakeVideoController.php
app/Admin/Renderable/PoemTable2.php
app/Admin/Controllers/AdminMakeVideoController.php
View file @
420c7c3
...
...
@@ -3,11 +3,13 @@
namespace
App\Admin\Controllers
;
use
App\Admin\Renderable\PoemTable
;
use
App\Admin\Renderable\PoemTable2
;
use
App\Admin\Renderable\TemplateTable
;
use
App\Jobs\AdminMakeImmerse
;
use
App\Admin\Repositories\AdminMakeVideo
;
use
App\Models\AdminMakeVideo
as
AdminVideo
;
use
App\Models\OnePoem
;
use
App\Models\OnePoem2
;
use
App\Models\VideoTemp
;
use
Dcat\Admin\Form
;
use
Dcat\Admin\Grid
;
...
...
@@ -122,8 +124,8 @@ class AdminMakeVideoController extends AdminController
$form
->
selectTable
(
'poem_id'
,
'选择一言'
)
->
title
(
'一言诗词库'
)
->
from
(
PoemTable
::
make
())
->
model
(
OnePoem
::
class
,
'id'
,
'title'
);
->
from
(
PoemTable
2
::
make
())
->
model
(
OnePoem
2
::
class
,
'id'
,
'title'
);
$form
->
textarea
(
'feel'
,
'有感'
);
$form
->
text
(
'weather'
,
'天气'
);
$form
->
text
(
'huangli'
,
'黄历'
)
->
default
(
'宜'
);
...
...
app/Admin/Renderable/PoemTable2.php
0 → 100644
View file @
420c7c3
<?php
/**
* Created by PhpStorm.
* User: lishuai
* Date: 2022/1/10
* Time: 5:57 PM
*/
namespace
App\Admin\Renderable
;
use
App\Admin\Repositories\OnePoem
;
use
App\Models\OnePoem2
;
use
Dcat\Admin\Grid
;
use
Dcat\Admin\Grid\LazyRenderable
;
class
PoemTable2
extends
LazyRenderable
{
public
function
grid
()
:
Grid
{
return
Grid
::
make
(
new
OnePoem2
(),
function
(
Grid
$grid
)
{
$grid
->
model
()
->
with
(
'verses'
);
$grid
->
column
(
'id'
)
->
sortable
();
$grid
->
column
(
'title'
);
$grid
->
column
(
'author'
);
$grid
->
verses
(
'正文'
)
->
pluck
(
'stanza'
)
->
label
();
$grid
->
column
(
'created_at'
);
$grid
->
column
(
'updated_at'
)
->
sortable
();
$grid
->
quickSearch
([
'title'
,
'author'
]);
$grid
->
paginate
(
10
);
$grid
->
disableActions
();
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
$filter
->
like
(
'title'
)
->
width
(
3
);
$filter
->
like
(
'author'
)
->
width
(
3
);
});
});
}
}
\ No newline at end of file
Please
register
or
login
to post a comment