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
e2796ff9
authored
Nov 21, 2024
by
lujunyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改期
parent
8b46e869
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
+6
-4
app/Admin/Controllers/DrugController.php
+1
-1
app/Models/DiagnosiModel.php
+1
-1
app/Models/DrugModel.php
+4
-2
No files found.
app/Admin/Controllers/DrugController.php
View file @
e2796ff9
...
@@ -121,7 +121,7 @@ protected function form()
...
@@ -121,7 +121,7 @@ protected function form()
return
Form
::
make
(
new
DrugRepository
(
'tag'
),
function
(
Form
$form
)
{
return
Form
::
make
(
new
DrugRepository
(
'tag'
),
function
(
Form
$form
)
{
$form
->
display
(
'id'
)
->
width
(
4
);
$form
->
display
(
'id'
)
->
width
(
4
);
$form
->
text
(
'name'
)
->
width
(
4
)
->
required
()
->
maxLength
(
64
,
'最多输入64个字符'
);
$form
->
text
(
'name'
)
->
width
(
4
)
->
required
()
->
maxLength
(
64
,
'最多输入64个字符'
);
$form
->
text
(
'code'
)
->
readonly
(
)
->
width
(
4
);
$form
->
display
(
'code'
)
->
width
(
4
);
$form
->
select
(
'unit'
)
->
options
(
DrugUnitModel
::
all
()
->
pluck
(
'name'
,
'name'
))
->
width
(
4
);
$form
->
select
(
'unit'
)
->
options
(
DrugUnitModel
::
all
()
->
pluck
(
'name'
,
'name'
))
->
width
(
4
);
$form
->
text
(
'spec'
)
->
width
(
4
)
->
required
()
->
maxLength
(
128
,
'最多输入128个字符'
);
$form
->
text
(
'spec'
)
->
width
(
4
)
->
required
()
->
maxLength
(
128
,
'最多输入128个字符'
);
$form
->
text
(
'dosage_form'
)
->
width
(
4
)
->
required
()
->
maxLength
(
128
,
'最多输入128个字符'
);
$form
->
text
(
'dosage_form'
)
->
width
(
4
)
->
required
()
->
maxLength
(
128
,
'最多输入128个字符'
);
...
...
app/Models/DiagnosiModel.php
View file @
e2796ff9
...
@@ -20,7 +20,7 @@ public function setNameAttribute($value)
...
@@ -20,7 +20,7 @@ public function setNameAttribute($value)
$this
->
attributes
[
'name'
]
=
$value
;
$this
->
attributes
[
'name'
]
=
$value
;
$pinyin
=
new
Pinyin
();
$pinyin
=
new
Pinyin
();
$abbr
=
$pinyin
->
abbr
(
$
this
->
nam
e
)
->
join
(
''
);
// 获取拼音首字母
$abbr
=
$pinyin
->
abbr
(
$
valu
e
)
->
join
(
''
);
// 获取拼音首字母
$this
->
attributes
[
'code'
]
=
strtoupper
(
$abbr
);
$this
->
attributes
[
'code'
]
=
strtoupper
(
$abbr
);
}
}
}
}
app/Models/DrugModel.php
View file @
e2796ff9
...
@@ -36,10 +36,12 @@ class DrugModel extends Model
...
@@ -36,10 +36,12 @@ class DrugModel extends Model
self
::
RX_FALSE
=>
'否'
,
self
::
RX_FALSE
=>
'否'
,
];
];
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
->
nam
e
)
->
join
(
''
);
// 获取拼音首字母
$abbr
=
$pinyin
->
abbr
(
$
valu
e
)
->
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