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
9131d414
authored
Nov 21, 2024
by
赵增煜
Browse files
Options
Browse Files
Download
Plain Diff
增加筛选
parents
5665ed04
19d88d2e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
7 deletions
+15
-7
app/Admin/Controllers/DiagnosiController.php
+3
-1
app/Admin/Controllers/DrugController.php
+0
-1
app/Admin/Controllers/DrugUnitController.php
+1
-1
app/Admin/Controllers/PharmacyController.php
+5
-2
app/Models/DiagnosiModel.php
+3
-1
app/Models/DrugModel.php
+3
-1
No files found.
app/Admin/Controllers/DiagnosiController.php
View file @
9131d414
...
...
@@ -23,6 +23,7 @@ protected function grid()
$grid
->
column
(
'id'
)
->
sortable
();
$grid
->
column
(
'name'
);
$grid
->
column
(
'code'
);
$grid
->
column
(
'encoding'
);
$grid
->
column
(
'content'
);
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
...
...
@@ -31,6 +32,7 @@ protected function grid()
$filter
->
like
(
'name'
)
->
width
(
3
);
$filter
->
like
(
'code'
)
->
width
(
3
);
$filter
->
like
(
'encoding'
)
->
width
(
3
);
$filter
->
like
(
'content'
)
->
width
(
3
);
});
...
...
@@ -77,8 +79,8 @@ protected function form()
$form
->
display
(
'id'
)
->
width
(
4
);
$form
->
text
(
'name'
)
->
width
(
4
)
->
required
()
->
maxLength
(
128
,
'最多输入128个字符'
);
$form
->
text
(
'content'
)
->
width
(
4
)
->
required
()
->
maxLength
(
255
,
'最多输入255个字符'
);
$form
->
text
(
'encoding'
)
->
width
(
4
)
->
required
()
->
maxLength
(
128
);
$form
->
display
(
'code'
)
->
width
(
4
);
$form
->
display
(
'encoding'
)
->
width
(
4
);
$form
->
display
(
'created_at'
)
->
width
(
4
);
$form
->
display
(
'updated_at'
)
->
width
(
4
);
...
...
app/Admin/Controllers/DrugController.php
View file @
9131d414
...
...
@@ -74,7 +74,6 @@ protected function grid()
$grid
->
disableViewButton
();
// 禁用详情按钮
// 工具栏按钮控制
$grid
->
disableCreateButton
();
// 禁用创建按钮
$grid
->
disableBatchDelete
();
// 禁用批量删除
// 导出按钮
...
...
app/Admin/Controllers/DrugUnitController.php
View file @
9131d414
...
...
@@ -70,7 +70,7 @@ protected function form()
{
return
Form
::
make
(
new
DrugUnitRepository
(),
function
(
Form
$form
)
{
$form
->
display
(
'id'
)
->
width
(
4
);
$form
->
text
(
'name'
)
->
width
(
4
)
->
maxLength
(
32
,
'最多输入32个字符'
);
$form
->
text
(
'name'
)
->
width
(
4
)
->
required
()
->
maxLength
(
32
);
$form
->
display
(
'created_at'
)
->
width
(
4
);
$form
->
display
(
'updated_at'
)
->
width
(
4
);
...
...
app/Admin/Controllers/PharmacyController.php
View file @
9131d414
...
...
@@ -128,7 +128,9 @@ protected function form()
$form
->
timeRange
(
'business_start'
,
'business_end'
,
'营业时间'
)
->
required
();
$form
->
map
(
'lat'
,
'lng'
,
'经纬度坐标'
);
// $form->select('user_id')->options(User::all()->pluck('openid', 'id'))->width(6)->help('实际后台操作可以不用关联');
$form
->
switch
(
'status'
);
if
(
$form
->
isEditing
())
{
$form
->
switch
(
'status'
);
}
$form
->
display
(
'created_at'
);
$form
->
display
(
'updated_at'
);
...
...
@@ -144,7 +146,8 @@ protected function form()
$form
->
saving
(
function
(
Form
$form
)
{
$status
=
$form
->
status
;
$pharmacyId
=
$form
->
getKey
();
$pharmacistNum
=
PharmacistModel
::
where
(
'status'
,
1
)
->
where
(
'pharmacy_id'
,
$pharmacyId
)
->
count
();
$pharmacistNum
=
PharmacistModel
::
where
(
'status'
,
PharmacyModel
::
STATUS_TRUE
)
->
where
(
'pharmacy_id'
,
$pharmacyId
)
->
count
();
if
(
$status
==
1
&&
$pharmacistNum
<=
0
)
{
return
$form
->
response
()
->
error
(
'开启失败,至少添加并且启用一个药师才可以开启药店~'
);
}
...
...
app/Models/DiagnosiModel.php
View file @
9131d414
...
...
@@ -15,8 +15,10 @@ class DiagnosiModel extends Model
protected
$table
=
'diagnosis'
;
public
function
set
Cod
eAttribute
(
$value
)
public
function
set
Nam
eAttribute
(
$value
)
{
$this
->
attributes
[
'name'
]
=
$value
;
$pinyin
=
new
Pinyin
();
$abbr
=
$pinyin
->
abbr
(
$this
->
name
)
->
join
(
''
);
// 获取拼音首字母
$this
->
attributes
[
'code'
]
=
strtoupper
(
$abbr
);
...
...
app/Models/DrugModel.php
View file @
9131d414
...
...
@@ -36,8 +36,10 @@ class DrugModel extends Model
self
::
RX_FALSE
=>
'否'
,
];
public
function
set
Cod
eAttribute
(
$value
)
public
function
set
Nam
eAttribute
(
$value
)
{
$this
->
attributes
[
'name'
]
=
$value
;
$pinyin
=
new
Pinyin
();
$abbr
=
$pinyin
->
abbr
(
$this
->
name
)
->
join
(
''
);
// 获取拼音首字母
$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