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
4e7ae425
authored
Nov 21, 2024
by
lujunyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
诊断
parent
f32612a4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
app/Admin/Controllers/DiagnosiController.php
+3
-1
app/Models/DiagnosiModel.php
+3
-1
No files found.
app/Admin/Controllers/DiagnosiController.php
View file @
4e7ae425
...
@@ -23,6 +23,7 @@ protected function grid()
...
@@ -23,6 +23,7 @@ protected function grid()
$grid
->
column
(
'id'
)
->
sortable
();
$grid
->
column
(
'id'
)
->
sortable
();
$grid
->
column
(
'name'
);
$grid
->
column
(
'name'
);
$grid
->
column
(
'code'
);
$grid
->
column
(
'code'
);
$grid
->
column
(
'encoding'
);
$grid
->
column
(
'content'
);
$grid
->
column
(
'content'
);
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
...
@@ -31,6 +32,7 @@ protected function grid()
...
@@ -31,6 +32,7 @@ protected function grid()
$filter
->
like
(
'name'
)
->
width
(
3
);
$filter
->
like
(
'name'
)
->
width
(
3
);
$filter
->
like
(
'code'
)
->
width
(
3
);
$filter
->
like
(
'code'
)
->
width
(
3
);
$filter
->
like
(
'encoding'
)
->
width
(
3
);
$filter
->
like
(
'content'
)
->
width
(
3
);
$filter
->
like
(
'content'
)
->
width
(
3
);
});
});
...
@@ -77,8 +79,8 @@ protected function form()
...
@@ -77,8 +79,8 @@ protected function form()
$form
->
display
(
'id'
)
->
width
(
4
);
$form
->
display
(
'id'
)
->
width
(
4
);
$form
->
text
(
'name'
)
->
width
(
4
)
->
required
()
->
maxLength
(
128
,
'最多输入128个字符'
);
$form
->
text
(
'name'
)
->
width
(
4
)
->
required
()
->
maxLength
(
128
,
'最多输入128个字符'
);
$form
->
text
(
'content'
)
->
width
(
4
)
->
required
()
->
maxLength
(
255
,
'最多输入255个字符'
);
$form
->
text
(
'content'
)
->
width
(
4
)
->
required
()
->
maxLength
(
255
,
'最多输入255个字符'
);
$form
->
text
(
'encoding'
)
->
width
(
4
)
->
required
()
->
maxLength
(
128
);
$form
->
display
(
'code'
)
->
width
(
4
);
$form
->
display
(
'code'
)
->
width
(
4
);
$form
->
display
(
'encoding'
)
->
width
(
4
);
$form
->
display
(
'created_at'
)
->
width
(
4
);
$form
->
display
(
'created_at'
)
->
width
(
4
);
$form
->
display
(
'updated_at'
)
->
width
(
4
);
$form
->
display
(
'updated_at'
)
->
width
(
4
);
...
...
app/Models/DiagnosiModel.php
View file @
4e7ae425
...
@@ -15,8 +15,10 @@ class DiagnosiModel extends Model
...
@@ -15,8 +15,10 @@ class DiagnosiModel extends Model
protected
$table
=
'diagnosis'
;
protected
$table
=
'diagnosis'
;
public
function
set
Cod
eAttribute
(
$value
)
public
function
set
Nam
eAttribute
(
$value
)
{
{
$this
->
attributes
[
'name'
]
=
$value
;
$pinyin
=
new
Pinyin
();
$pinyin
=
new
Pinyin
();
$abbr
=
$pinyin
->
abbr
(
$this
->
name
)
->
join
(
''
);
// 获取拼音首字母
$abbr
=
$pinyin
->
abbr
(
$this
->
name
)
->
join
(
''
);
// 获取拼音首字母
$this
->
attributes
[
'code'
]
=
strtoupper
(
$abbr
);
$this
->
attributes
[
'code'
]
=
strtoupper
(
$abbr
);
...
...
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