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-24 02:06:14 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f36727f320e8c445e1729b444f2f2cb6ff37f16e
f36727f3
1 parent
2a2de295
1.优化一言添加
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
app/Admin/Controllers/VideoTempController.php
app/Admin/Renderable/VerseTable.php
app/Admin/Controllers/VideoTempController.php
View file @
f36727f
...
...
@@ -46,8 +46,8 @@ class VideoTempController extends AdminController
$grid
->
column
(
''
,
'组件信息'
)
->
display
(
'展开'
)
->
expand
(
function
(){
$th
=
[
'id'
,
'模板id'
,
'名称'
,
'位置'
,
'字号'
,
'
字体颜色'
,
'背景色'
,
'背景厚度'
,
'透明度'
,
'避免剪切'
,
'创建时间'
,
'修改时间
'
];
return
Table
::
make
(
$th
,
$this
->
components
->
toArray
())
->
withBorder
();
$th
=
[
'id'
,
'模板id'
,
'名称'
,
'位置'
,
'字号'
,
'
文字颜色'
,
'文字效果'
,
'fade时间'
,
'背景色'
,
'透明度'
,
'背景厚度
'
];
return
Table
::
make
(
$th
,
$this
->
components
Table
->
toArray
())
->
withBorder
();
});
$grid
->
column
(
'state'
)
->
switch
();
$grid
->
column
(
'created_at'
);
...
...
app/Admin/Renderable/VerseTable.php
View file @
f36727f
...
...
@@ -51,12 +51,12 @@ class VerseTable extends LazyRenderable
$grid
->
expandFilter
();
// 默认展开搜索
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
//
$filter->where('author_id',function ($query){
//
$author = Author::query()->where('name','like',"%{$this->input}%")->get()->pluck('id');
//
$poetry =Poetry::query()->whereIn('author_id',$author)->get()->pluck('id');
//
$query->whereIn('poetry_id',$poetry);
//
})->width(3);
$filter
->
like
(
'poetry.name'
)
->
width
(
6
);
$filter
->
where
(
'author_id'
,
function
(
$query
){
$author
=
Author
::
query
()
->
where
(
'name'
,
'like'
,
"%
{
$this
->
input
}
%"
)
->
get
()
->
pluck
(
'id'
);
$poetry
=
Poetry
::
query
()
->
whereIn
(
'author_id'
,
$author
)
->
get
()
->
pluck
(
'id'
);
$query
->
whereIn
(
'poetry_id'
,
$poetry
);
})
->
width
(
3
);
$filter
->
like
(
'poetry.name'
)
->
width
(
4
);
// $filter->like('stanza')->width(4);
$filter
->
panel
();
...
...
Please
register
or
login
to post a comment