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
88712760
authored
Dec 25, 2024
by
赵增煜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
详情页显示调整
parent
375271f9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
4 deletions
+34
-4
app/Admin/Controllers/ExternalPrescriptionController.php
+17
-2
app/Admin/Controllers/PharmacyExternalPrescriptionController.php
+17
-2
No files found.
app/Admin/Controllers/ExternalPrescriptionController.php
View file @
88712760
...
@@ -102,12 +102,27 @@ protected function detail($id)
...
@@ -102,12 +102,27 @@ protected function detail($id)
$show
->
field
(
'agent'
);
$show
->
field
(
'agent'
);
$show
->
field
(
'patient_name'
);
$show
->
field
(
'patient_name'
);
$show
->
field
(
'patient_mobile'
);
$show
->
field
(
'patient_mobile'
);
$show
->
field
(
'patient_gender'
);
$show
->
field
(
'patient_gender'
)
->
using
(
ExternalPrescriptionModel
::
SEX_MAP
)
->
width
(
3
)
;
$show
->
field
(
'patient_age'
);
$show
->
field
(
'patient_age'
);
$show
->
field
(
'patient_id_card'
);
$show
->
field
(
'patient_id_card'
);
$show
->
field
(
'doctor_name'
);
$show
->
field
(
'doctor_name'
);
$show
->
field
(
'diagnosis'
);
$show
->
field
(
'diagnosis'
);
$show
->
field
(
'drug_info'
);
$show
->
field
(
'drug_info'
)
->
display
(
function
(
$drugInfoJson
)
{
// 尝试将 $drugInfoJson 解码为数组
$drugInfoArray
=
json_decode
(
$drugInfoJson
,
true
);
// 检查解码是否成功且 $drugInfoArray 是一个数组
if
(
is_array
(
$drugInfoArray
))
{
// 使用 array_map 来格式化每个药物的信息
$formattedDrugs
=
array_map
(
function
(
$item
)
{
return
$item
[
'drug_name'
]
.
' : '
.
(
$item
[
'drug_spec'
]
??
''
)
.
' : '
.
$item
[
'drug_num'
];
},
$drugInfoArray
);
// 将数组转换为以逗号分隔的字符串(或根据您的需求进行其他格式化)
return
implode
(
', '
,
$formattedDrugs
);
}
else
{
// 如果解码失败或 $drugInfoJson 不是一个有效的 JSON 字符串,返回原始值或错误消息
return
$drugInfoJson
;
// 或者返回一个错误消息,如 'Invalid JSON'
}
})
->
label
();
// 设置列的标签
$show
->
field
(
'pharmacist_name'
);
$show
->
field
(
'pharmacist_name'
);
$show
->
field
(
'review_at'
);
$show
->
field
(
'review_at'
);
$show
->
field
(
'pharmacist_attr'
);
$show
->
field
(
'pharmacist_attr'
);
...
...
app/Admin/Controllers/PharmacyExternalPrescriptionController.php
View file @
88712760
...
@@ -117,12 +117,27 @@ protected function detail($id)
...
@@ -117,12 +117,27 @@ protected function detail($id)
$show
->
field
(
'agent'
);
$show
->
field
(
'agent'
);
$show
->
field
(
'patient_name'
);
$show
->
field
(
'patient_name'
);
$show
->
field
(
'patient_mobile'
);
$show
->
field
(
'patient_mobile'
);
$show
->
field
(
'patient_gender'
);
$show
->
field
(
'patient_gender'
)
->
using
(
ExternalPrescriptionModel
::
SEX_MAP
)
->
width
(
3
)
;
$show
->
field
(
'patient_age'
);
$show
->
field
(
'patient_age'
);
$show
->
field
(
'patient_id_card'
);
$show
->
field
(
'patient_id_card'
);
$show
->
field
(
'doctor_name'
);
$show
->
field
(
'doctor_name'
);
$show
->
field
(
'diagnosis'
);
$show
->
field
(
'diagnosis'
);
$show
->
field
(
'drug_info'
);
$show
->
field
(
'drug_info'
)
->
display
(
function
(
$drugInfoJson
)
{
// 尝试将 $drugInfoJson 解码为数组
$drugInfoArray
=
json_decode
(
$drugInfoJson
,
true
);
// 检查解码是否成功且 $drugInfoArray 是一个数组
if
(
is_array
(
$drugInfoArray
))
{
// 使用 array_map 来格式化每个药物的信息
$formattedDrugs
=
array_map
(
function
(
$item
)
{
return
$item
[
'drug_name'
]
.
' : '
.
(
$item
[
'drug_spec'
]
??
''
)
.
' : '
.
$item
[
'drug_num'
];
},
$drugInfoArray
);
// 将数组转换为以逗号分隔的字符串(或根据您的需求进行其他格式化)
return
implode
(
', '
,
$formattedDrugs
);
}
else
{
// 如果解码失败或 $drugInfoJson 不是一个有效的 JSON 字符串,返回原始值或错误消息
return
$drugInfoJson
;
// 或者返回一个错误消息,如 'Invalid JSON'
}
})
->
label
();
// 设置列的标签
$show
->
field
(
'pharmacist_name'
);
$show
->
field
(
'pharmacist_name'
);
$show
->
field
(
'review_at'
);
$show
->
field
(
'review_at'
);
$show
->
field
(
'pharmacist_attr'
);
$show
->
field
(
'pharmacist_attr'
);
...
...
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