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
李帅
2022-03-24 23:38:04 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
bdf202739bea208e3da62cbc1d0e239a2de362ce
bdf20273
1 parent
3a3decf5
1.丰富了setting
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
2 deletions
app/Admin/Controllers/SettingController.php
app/Admin/Repositories/PaySetting.php
app/Admin/Controllers/SettingController.php
View file @
bdf2027
...
...
@@ -3,11 +3,13 @@
namespace
App\Admin\Controllers
;
use
App\Admin\Repositories\LoginSetting
;
use
App\Admin\Repositories\PaySetting
;
use
Dcat\Admin\Grid
;
use
Dcat\Admin\Http\Controllers\AdminController
;
use
Dcat\Admin\Layout\Content
;
use
Dcat\Admin\Layout\Row
;
use
Dcat\Admin\Widgets\Card
;
use
Dcat\Admin\Widgets\Tab
;
class
SettingController
extends
AdminController
{
...
...
@@ -29,7 +31,7 @@ class SettingController extends AdminController
// 一行多列
$content
->
row
(
function
(
Row
$row
)
{
$row
->
column
(
4
,
$this
->
loginGrid
());
// $row->column(6, $this->g
rid());
$row
->
column
(
4
,
$this
->
payG
rid
());
});
});
}
...
...
@@ -51,7 +53,7 @@ class SettingController extends AdminController
$grid
->
column
(
'icon'
)
->
display
(
function
(
$item
){
return
"<i class='
$item
'></i>"
;
});
})
->
badge
()
;
$grid
->
column
(
'name'
);
$grid
->
column
(
'state'
)
->
switch
();
...
...
@@ -61,4 +63,28 @@ class SettingController extends AdminController
$card
->
title
(
'登录设置'
)
->
withHeaderBorder
()
->
content
(
$grid
);
return
$card
;
}
protected
function
payGrid
()
{
$grid
=
Grid
::
make
(
new
PaySetting
(),
function
(
Grid
$grid
)
{
$grid
->
disablePagination
();
$grid
->
disableActions
();
$grid
->
tableCollapse
(
false
);
$grid
->
disableCreateButton
();
$grid
->
disableRefreshButton
();
$grid
->
disableRowSelector
();
$grid
->
column
(
'icon'
)
->
display
(
function
(
$item
){
return
"<i class='
$item
'></i>"
;
})
->
badge
();
$grid
->
column
(
'name'
);
$grid
->
column
(
'state'
)
->
switch
();
});
$card
=
new
Card
();
$card
->
title
(
'支付设置'
)
->
withHeaderBorder
()
->
content
(
$grid
);
return
$card
;
}
}
...
...
app/Admin/Repositories/PaySetting.php
0 → 100755
View file @
bdf2027
<?php
namespace
App\Admin\Repositories
;
use
App\Models\Setting
as
Model
;
use
Dcat\Admin\Grid
;
use
Dcat\Admin\Repositories\EloquentRepository
;
use
Illuminate\Support\Str
;
class
PaySetting
extends
EloquentRepository
{
/**
* Model.
*
* @var string
*/
protected
$eloquentClass
=
Model
::
class
;
public
function
get
(
Grid\Model
$model
)
{
$terminal
=
Str
::
contains
(
request
()
->
path
(),
'ios'
)
?
2
:
1
;
$setting
=
Model
::
query
()
->
where
(
'keyword'
,
'pay_setting'
)
->
where
(
'terminal'
,
$terminal
)
->
first
();
if
(
$setting
==
null
)
return
[];
return
json_decode
(
$setting
->
content
,
true
);
}
}
Please
register
or
login
to post a comment