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
cee3d9ae
authored
Nov 19, 2024
by
lujunyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
返回图片
parent
745d2b68
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
0 deletions
+51
-0
app/Models/DoctorModel.php
+11
-0
app/Models/PharmacistModel.php
+11
-0
app/Models/PrescriptionModel.php
+29
-0
No files found.
app/Models/DoctorModel.php
View file @
cee3d9ae
...
...
@@ -5,6 +5,8 @@
use
Dcat\Admin\Traits\HasDateTimeFormatter
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\SoftDeletes
;
use
Illuminate\Support\Facades\Storage
;
use
Illuminate\Support\Str
;
class
DoctorModel
extends
Model
{
...
...
@@ -18,4 +20,13 @@ public function user()
{
return
$this
->
belongsTo
(
User
::
class
,
'user_id'
,
'id'
);
}
public
function
getSignedPicAttribute
(
$value
)
{
if
(
Str
::
contains
(
$value
,
'//'
))
{
return
$value
;
}
return
Storage
::
url
(
$value
);
}
}
app/Models/PharmacistModel.php
View file @
cee3d9ae
...
...
@@ -5,6 +5,8 @@
use
Dcat\Admin\Traits\HasDateTimeFormatter
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\SoftDeletes
;
use
Illuminate\Support\Facades\Storage
;
use
Illuminate\Support\Str
;
class
PharmacistModel
extends
Model
{
...
...
@@ -18,4 +20,13 @@ public function pharmacy()
{
return
$this
->
belongsTo
(
PharmacyModel
::
class
,
'pharmacy_id'
,
'id'
);
}
public
function
getSignedPicAttribute
(
$value
)
{
if
(
Str
::
contains
(
$value
,
'//'
))
{
return
$value
;
}
return
Storage
::
url
(
$value
);
}
}
app/Models/PrescriptionModel.php
View file @
cee3d9ae
...
...
@@ -5,6 +5,8 @@
use
Dcat\Admin\Traits\HasDateTimeFormatter
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\SoftDeletes
;
use
Illuminate\Support\Facades\Storage
;
use
Illuminate\Support\Str
;
class
PrescriptionModel
extends
Model
{
...
...
@@ -37,4 +39,31 @@ class PrescriptionModel extends Model
self
::
OPEN_SOURCE_CUSTOMER
=>
'客开'
,
self
::
OPEN_SOURCE_PHARMACY
=>
'店开'
,
];
public
function
getDoctorSignedPicAttribute
(
$value
)
{
if
(
Str
::
contains
(
$value
,
'//'
))
{
return
$value
;
}
return
Storage
::
url
(
$value
);
}
public
function
getPharmacistSignedPicAttribute
(
$value
)
{
if
(
Str
::
contains
(
$value
,
'//'
))
{
return
$value
;
}
return
Storage
::
url
(
$value
);
}
public
function
getPrescriptionPicAttribute
(
$value
)
{
if
(
Str
::
contains
(
$value
,
'//'
))
{
return
$value
;
}
return
Storage
::
url
(
$value
);
}
}
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