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
dbf57255
authored
Nov 24, 2024
by
lujunyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加筛选和状态显示
parent
f5ac9356
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
70 additions
and
4 deletions
+70
-4
app/Admin/Controllers/DoctorController.php
+3
-0
app/Admin/Controllers/InquiryController.php
+1
-0
app/Admin/Controllers/PharmacistController.php
+2
-1
app/Admin/Controllers/PharmacyController.php
+5
-1
app/Models/DoctorModel.php
+17
-0
app/Models/PharmacistModel.php
+17
-0
app/Models/PharmacyModel.php
+25
-2
No files found.
app/Admin/Controllers/DoctorController.php
View file @
dbf57255
...
...
@@ -3,6 +3,7 @@
namespace
App\Admin\Controllers
;
use
App\Admin\Repositories\DoctorRepository
;
use
App\Models\DoctorModel
;
use
Dcat\Admin\Form
;
use
Dcat\Admin\Grid
;
use
Dcat\Admin\Http\Controllers\AdminController
;
...
...
@@ -24,6 +25,7 @@ protected function grid()
$grid
->
column
(
'id'
)
->
sortable
();
$grid
->
column
(
'name'
);
$grid
->
column
(
'is_auto'
)
->
using
(
DoctorModel
::
IS_AUTO_MAP
)
->
dot
(
DoctorModel
::
IS_AUTO_MAP_COLOR
);
$grid
->
column
(
'id_card'
)
->
display
(
function
(
$content
)
{
return
data_masking
(
$content
,
'idcard'
);
});
...
...
@@ -57,6 +59,7 @@ protected function grid()
$filter
->
like
(
'name'
)
->
width
(
3
);
$filter
->
like
(
'id_card'
)
->
width
(
3
);
$filter
->
like
(
'mobile'
)
->
width
(
3
);
$filter
->
in
(
'is_auto'
,
'自动开方'
)
->
checkbox
(
DoctorModel
::
IS_AUTO_MAP
)
->
width
(
3
);
});
$grid
->
setActionClass
(
Grid\Displayers\Actions
::
class
);
...
...
app/Admin/Controllers/InquiryController.php
View file @
dbf57255
...
...
@@ -31,6 +31,7 @@ protected function grid()
$filter
->
expand
();
// 默认展开搜索框
$filter
->
like
(
'question'
)
->
width
(
3
);
$filter
->
in
(
'is_common'
)
->
checkbox
(
InquiryModel
::
INQUIRY_COMMON_MAP
)
->
width
(
3
);
});
$grid
->
setActionClass
(
Grid\Displayers\Actions
::
class
);
...
...
app/Admin/Controllers/PharmacistController.php
View file @
dbf57255
...
...
@@ -3,6 +3,7 @@
namespace
App\Admin\Controllers
;
use
App\Admin\Repositories\PharmacistRepository
;
use
App\Models\PharmacistModel
;
use
App\Models\PharmacyModel
;
use
Carbon\Carbon
;
use
Dcat\Admin\Admin
;
...
...
@@ -75,7 +76,7 @@ protected function grid()
});
$grid
->
column
(
'practicing_license_expired_time'
);
$grid
->
column
(
'pharmacy.name'
,
'关联药店'
);
$grid
->
column
(
'is_default'
)
->
using
(
[
0
=>
'否'
,
1
=>
'是'
]
);
$grid
->
column
(
'is_default'
)
->
using
(
PharmacistModel
::
IS_DEFAULT_MAP
)
->
dot
(
PharmacistModel
::
IS_DEFAULT_MAP_COLOR
);
// $grid->column('practicing_license')->image('', 50, 50);
// $grid->column('physician_license')->image('', 50, 50);
// $grid->column('created_at');
...
...
app/Admin/Controllers/PharmacyController.php
View file @
dbf57255
...
...
@@ -30,7 +30,8 @@ protected function grid()
$grid
->
column
(
'id'
)
->
sortable
();
$grid
->
column
(
'status'
)
->
switch
(
''
,
true
);
$grid
->
column
(
'is_open'
)
->
using
(
PharmacyModel
::
IS_OPEN_MAP
)
->
help
(
'药店控制'
);
$grid
->
column
(
'is_open'
)
->
using
(
PharmacyModel
::
IS_OPEN_MAP
)
->
help
(
'药店控制'
)
->
dot
(
PharmacyModel
::
IS_OPEN_MAP_COLOR
);
$grid
->
column
(
'is_auto'
)
->
using
(
PharmacyModel
::
IS_AUTO_MAP
)
->
dot
(
PharmacyModel
::
IS_AUTO_MAP_COLOR
);
$grid
->
column
(
'name'
);
// $grid->column('business_license')->image('', 50, 50);
// $grid->column('drug_biz_license')->image('', 50, 50);
...
...
@@ -62,6 +63,9 @@ protected function grid()
$filter
->
like
(
'name'
)
->
width
(
3
);
$filter
->
like
(
'mobile'
)
->
width
(
3
);
$filter
->
in
(
'status'
,
'平台启用状态'
)
->
checkbox
(
PharmacyModel
::
STATUS_MAP
)
->
width
(
3
);
$filter
->
in
(
'is_open'
,
'开店状态'
)
->
checkbox
(
PharmacyModel
::
IS_OPEN_MAP
)
->
width
(
3
);
$filter
->
in
(
'is_auto'
,
'自动审方'
)
->
checkbox
(
PharmacyModel
::
IS_AUTO_MAP
)
->
width
(
3
);
});
$grid
->
setActionClass
(
Grid\Displayers\Actions
::
class
);
...
...
app/Models/DoctorModel.php
View file @
dbf57255
...
...
@@ -26,6 +26,23 @@ class DoctorModel extends Model
self
::
STATUS_TRUE
=>
'启用'
,
];
// 自动开放[0=否,1=是]
const
IS_AUTO_FALSE
=
0
;
const
IS_AUTO_TRUE
=
1
;
// 自动开放-文字映射
const
IS_AUTO_MAP
=
[
self
::
IS_AUTO_FALSE
=>
'否'
,
self
::
IS_AUTO_TRUE
=>
'是'
,
];
// 自动开放-颜色映射
const
IS_AUTO_MAP_COLOR
=
[
self
::
IS_AUTO_FALSE
=>
'gray'
,
self
::
IS_AUTO_TRUE
=>
'success'
,
];
// 医师所属于的用户,一对一
public
function
user
()
{
...
...
app/Models/PharmacistModel.php
View file @
dbf57255
...
...
@@ -15,6 +15,23 @@ class PharmacistModel extends Model
protected
$table
=
'pharmacist'
;
// 是否默认[0=否,1=是]
const
IS_DEFAULT_FALSE
=
0
;
const
IS_DEFAULT_TRUE
=
1
;
// 是否默认-文字映射
const
IS_DEFAULT_MAP
=
[
self
::
IS_DEFAULT_FALSE
=>
'否'
,
self
::
IS_DEFAULT_TRUE
=>
'是'
,
];
// 是否默认-颜色映射
const
IS_DEFAULT_MAP_COLOR
=
[
self
::
IS_DEFAULT_FALSE
=>
'gray'
,
self
::
IS_DEFAULT_TRUE
=>
'success'
,
];
// 药师关联的药店,多对一
public
function
pharmacy
()
{
...
...
app/Models/PharmacyModel.php
View file @
dbf57255
...
...
@@ -23,8 +23,8 @@ class PharmacyModel extends Model
// 平台启用店铺状态状态-文字映射
const
STATUS_MAP
=
[
self
::
STATUS_FALSE
=>
'
闭店
'
,
self
::
STATUS_TRUE
=>
'
开店
'
,
self
::
STATUS_FALSE
=>
'
禁用
'
,
self
::
STATUS_TRUE
=>
'
启用
'
,
];
// 开店状态[0=闭店,1=开店]
...
...
@@ -38,6 +38,29 @@ class PharmacyModel extends Model
self
::
IS_OPEN_TRUE
=>
'开店'
,
];
// 是否默认-颜色映射
const
IS_OPEN_MAP_COLOR
=
[
self
::
IS_OPEN_FALSE
=>
'danger'
,
self
::
IS_OPEN_TRUE
=>
'success'
,
];
// 自动审方[0=否,1=是]
const
IS_AUTO_FALSE
=
0
;
const
IS_AUTO_TRUE
=
1
;
// 自动审方-文字映射
const
IS_AUTO_MAP
=
[
self
::
IS_AUTO_FALSE
=>
'否'
,
self
::
IS_AUTO_TRUE
=>
'是'
,
];
// 自动审方-颜色映射
const
IS_AUTO_MAP_COLOR
=
[
self
::
IS_AUTO_FALSE
=>
'gray'
,
self
::
IS_AUTO_TRUE
=>
'success'
,
];
// 药店所属于的用户,一对一
public
function
user
()
{
...
...
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