Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵增煜
/
tzt-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ca7e8853
authored
Nov 11, 2024
by
lujunyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化药店纠错
parent
add69948
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
71 additions
and
16 deletions
+71
-16
app/Admin/Controllers/PharmacyCorrectionController.php
+17
-13
app/Admin/Repositories/DoctorCorrectionRepository.php
+2
-2
app/Admin/Repositories/PharmacyCorrectionRepository.php
+16
-0
app/Models/DoctorCorrectionModel.php
+24
-0
app/Models/PharmacyCorrectionModel.php
+12
-1
No files found.
app/Admin/Controllers/PharmacyCorrectionController.php
View file @
ca7e8853
...
...
@@ -2,7 +2,8 @@
namespace
App\Admin\Controllers
;
use
App\Admin\Repositories\PharmacyCorrection
;
use
App\Admin\Repositories\PharmacyCorrectionRepository
;
use
App\Models\PharmacyCorrectionModel
;
use
Dcat\Admin\Form
;
use
Dcat\Admin\Grid
;
use
Dcat\Admin\Http\Controllers\AdminController
;
...
...
@@ -18,28 +19,31 @@ class PharmacyCorrectionController extends AdminController
*/
protected
function
grid
()
{
return
Grid
::
make
(
new
PharmacyCorrection
(),
function
(
Grid
$grid
)
{
return
Grid
::
make
(
new
PharmacyCorrection
Repository
(),
function
(
Grid
$grid
)
{
$grid
->
model
()
->
orderBy
(
'id'
,
'DESC'
);
$grid
->
column
(
'id'
)
->
sortable
();
$grid
->
column
(
'pharmacy_id'
);
//
$grid->column('pharmacy_id');
$grid
->
column
(
'pharmacy_name'
);
$grid
->
column
(
'is_handle'
);
$grid
->
column
(
'content'
);
$grid
->
column
(
'created_at'
);
$grid
->
column
(
'updated_at'
)
->
sortable
();
//
$grid->column('created_at');
//
$grid->column('updated_at')->sortable();
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
$filter
->
panel
();
// 更改为 panel 布局
$filter
->
expand
();
// 默认展开搜索框
$filter
->
like
(
'pharmacy_name'
)
->
width
(
3
);
$filter
->
in
(
'is_handle'
)
->
checkbox
(
PharmacyCorrectionModel
::
IS_HANDLE_MAP
)
->
width
(
3
);
});
// 行按钮控制
$grid
->
disable
DeleteButton
();
// 禁用删除
按钮
$grid
->
disable
Actions
();
// 禁用
按钮
// 工具栏按钮控制
$grid
->
disableBatchDelete
();
// 禁用批量删除
$grid
->
disableCreateButton
();
// 禁用创建按钮
$grid
->
disableBatchActions
();
// 禁用批量操作
});
}
...
...
@@ -51,7 +55,7 @@ protected function grid()
*/
protected
function
detail
(
$id
)
{
return
Show
::
make
(
$id
,
new
PharmacyCorrection
(),
function
(
Show
$show
)
{
return
Show
::
make
(
$id
,
new
PharmacyCorrection
Repository
(),
function
(
Show
$show
)
{
$show
->
field
(
'id'
);
$show
->
field
(
'pharmacy_id'
);
$show
->
field
(
'pharmacy_name'
);
...
...
@@ -73,12 +77,12 @@ protected function detail($id)
*/
protected
function
form
()
{
return
Form
::
make
(
new
PharmacyCorrection
(),
function
(
Form
$form
)
{
return
Form
::
make
(
new
PharmacyCorrection
Repository
(),
function
(
Form
$form
)
{
$form
->
display
(
'id'
)
->
width
(
4
);
$form
->
text
(
'pharmacy_id'
)
->
width
(
4
);
$form
->
text
(
'pharmacy_name'
)
->
width
(
4
);
$form
->
text
(
'
is_handle'
)
->
width
(
4
);
$form
->
text
(
'content
'
)
->
width
(
4
);
//
$form->text('pharmacy_id')->width(4);
$form
->
text
(
'pharmacy_name'
)
->
readonly
()
->
width
(
4
);
$form
->
text
(
'
content'
)
->
readonly
(
)
->
width
(
4
);
$form
->
switch
(
'is_handle
'
)
->
width
(
4
);
$form
->
display
(
'created_at'
)
->
width
(
4
);
$form
->
display
(
'updated_at'
)
->
width
(
4
);
...
...
app/Admin/Repositories/
PharmacyCorrection
.php
→
app/Admin/Repositories/
DoctorCorrectionRepository
.php
View file @
ca7e8853
...
...
@@ -2,10 +2,10 @@
namespace
App\Admin\Repositories
;
use
App\Models\
PharmacyCorrection
as
Model
;
use
App\Models\
DoctorCorrectionModel
as
Model
;
use
Dcat\Admin\Repositories\EloquentRepository
;
class
PharmacyCorrection
extends
EloquentRepository
class
DoctorCorrectionRepository
extends
EloquentRepository
{
/**
* Model.
...
...
app/Admin/Repositories/PharmacyCorrectionRepository.php
0 → 100644
View file @
ca7e8853
<?php
namespace
App\Admin\Repositories
;
use
App\Models\PharmacyCorrectionModel
as
Model
;
use
Dcat\Admin\Repositories\EloquentRepository
;
class
PharmacyCorrectionRepository
extends
EloquentRepository
{
/**
* Model.
*
* @var string
*/
protected
$eloquentClass
=
Model
::
class
;
}
app/Models/DoctorCorrectionModel.php
0 → 100644
View file @
ca7e8853
<?php
namespace
App\Models
;
use
Dcat\Admin\Traits\HasDateTimeFormatter
;
use
Illuminate\Database\Eloquent\Model
;
class
DoctorCorrectionModel
extends
Model
{
use
HasDateTimeFormatter
;
protected
$table
=
'doctor_correction'
;
// 是否处理[0=待处理,1=已处理]
const
IS_HANDLE_FALSE
=
0
;
const
IS_HANDLE_TRUE
=
1
;
// 是否处理-文字映射
const
IS_HANDLE_MAP
=
[
self
::
IS_HANDLE_FALSE
=>
'待处理'
,
self
::
IS_HANDLE_TRUE
=>
'已处理'
,
];
}
app/Models/PharmacyCorrection.php
→
app/Models/PharmacyCorrection
Model
.php
View file @
ca7e8853
...
...
@@ -5,9 +5,20 @@
use
Dcat\Admin\Traits\HasDateTimeFormatter
;
use
Illuminate\Database\Eloquent\Model
;
class
PharmacyCorrection
extends
Model
class
PharmacyCorrection
Model
extends
Model
{
use
HasDateTimeFormatter
;
protected
$table
=
'pharmacy_correction'
;
// 是否处理[0=待处理,1=已处理]
const
IS_HANDLE_FALSE
=
0
;
const
IS_HANDLE_TRUE
=
1
;
// 是否处理-文字映射
const
IS_HANDLE_MAP
=
[
self
::
IS_HANDLE_FALSE
=>
'待处理'
,
self
::
IS_HANDLE_TRUE
=>
'已处理'
,
];
}
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