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
3ed9dc55
authored
Nov 13, 2024
by
赵增煜
Browse files
Options
Browse Files
Download
Plain Diff
合并冲突
parents
f4ad1080
b73d1225
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
7 deletions
+22
-7
app/Api/Controllers/PrescriptionController.php
+2
-0
app/Models/PharmacistModel.php
+3
-3
app/Models/PharmacyModel.php
+12
-0
app/Models/User.php
+3
-3
database/migrations/2024_11_04_223543_create_pharmacy_table.php
+1
-0
database/migrations/2024_11_04_224709_create_pharmacist_table.php
+1
-1
No files found.
app/Api/Controllers/PrescriptionController.php
View file @
3ed9dc55
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
// 问诊人控制器
// 问诊人控制器
class
PrescriptionController
extends
BaseApiController
class
PrescriptionController
extends
BaseApiController
{
{
public
function
test
()
public
function
test
()
{
{
// 分派医师 医师当日开方未达到上限以及是否在时间段的搜索出来
// 分派医师 医师当日开方未达到上限以及是否在时间段的搜索出来
...
@@ -121,4 +122,5 @@ public function create(Request $request)
...
@@ -121,4 +122,5 @@ public function create(Request $request)
return
$this
->
success
(
$data
);
return
$this
->
success
(
$data
);
}
}
}
}
app/Models/PharmacistModel.php
View file @
3ed9dc55
...
@@ -13,9 +13,9 @@ class PharmacistModel extends Model
...
@@ -13,9 +13,9 @@ class PharmacistModel extends Model
protected
$table
=
'pharmacist'
;
protected
$table
=
'pharmacist'
;
// 药师
所属于的用户,一
对一
// 药师
关联的药店,多
对一
public
function
user
()
public
function
pharmacy
()
{
{
return
$this
->
belongsTo
(
User
::
class
,
'user
_id'
,
'id'
);
return
$this
->
belongsTo
(
PharmacyModel
::
class
,
'pharmacy
_id'
,
'id'
);
}
}
}
}
app/Models/PharmacyModel.php
View file @
3ed9dc55
...
@@ -12,4 +12,16 @@ class PharmacyModel extends Model
...
@@ -12,4 +12,16 @@ class PharmacyModel extends Model
use
SoftDeletes
;
use
SoftDeletes
;
protected
$table
=
'pharmacy'
;
protected
$table
=
'pharmacy'
;
// 药店所属于的用户,一对一
public
function
user
()
{
return
$this
->
belongsTo
(
User
::
class
,
'user_id'
,
'id'
);
}
// 药店关联的药师,一对多
public
function
pharmacy
()
{
return
$this
->
hasMany
(
User
::
class
,
'pharmacy_id'
,
'id'
);
}
}
}
app/Models/User.php
View file @
3ed9dc55
...
@@ -68,10 +68,10 @@ public function doctor()
...
@@ -68,10 +68,10 @@ public function doctor()
return
$this
->
hasOne
(
DoctorModel
::
class
,
'user_id'
,
'id'
);
return
$this
->
hasOne
(
DoctorModel
::
class
,
'user_id'
,
'id'
);
}
}
// 用户关联的药
师
,一对一
// 用户关联的药
店
,一对一
public
function
pharmac
ist
()
public
function
pharmac
y
()
{
{
return
$this
->
hasOne
(
Pharmac
ist
Model
::
class
,
'user_id'
,
'id'
);
return
$this
->
hasOne
(
Pharmac
y
Model
::
class
,
'user_id'
,
'id'
);
}
}
// 用户关联的问诊人,一对多
// 用户关联的问诊人,一对多
...
...
database/migrations/2024_11_04_223543_create_pharmacy_table.php
View file @
3ed9dc55
...
@@ -30,6 +30,7 @@ public function up()
...
@@ -30,6 +30,7 @@ public function up()
$table
->
string
(
'lng'
,
12
)
->
comment
(
'经度'
);
$table
->
string
(
'lng'
,
12
)
->
comment
(
'经度'
);
$table
->
string
(
'lat'
,
12
)
->
comment
(
'纬度'
);
$table
->
string
(
'lat'
,
12
)
->
comment
(
'纬度'
);
$table
->
boolean
(
'status'
)
->
default
(
0
)
->
comment
(
'启用[0=未启用,1=启用]'
);
$table
->
boolean
(
'status'
)
->
default
(
0
)
->
comment
(
'启用[0=未启用,1=启用]'
);
$table
->
bigInteger
(
'user_id'
)
->
nullable
()
->
unique
(
'uk_userid'
)
->
comment
(
'用户表ID'
);
$table
->
timestamps
();
$table
->
timestamps
();
$table
->
softDeletes
();
$table
->
softDeletes
();
});
});
...
...
database/migrations/2024_11_04_224709_create_pharmacist_table.php
View file @
3ed9dc55
...
@@ -25,7 +25,7 @@ public function up()
...
@@ -25,7 +25,7 @@ public function up()
$table
->
string
(
'physician_license'
)
->
comment
(
'执业资格证书'
);
$table
->
string
(
'physician_license'
)
->
comment
(
'执业资格证书'
);
$table
->
string
(
'signed_pic'
)
->
comment
(
'签名照'
);
$table
->
string
(
'signed_pic'
)
->
comment
(
'签名照'
);
$table
->
boolean
(
'status'
)
->
default
(
0
)
->
comment
(
'启用[0=未启用,1=启用]'
);
$table
->
boolean
(
'status'
)
->
default
(
0
)
->
comment
(
'启用[0=未启用,1=启用]'
);
$table
->
bigInteger
(
'
user_id'
)
->
nullable
()
->
unique
(
'uk_userid'
)
->
comment
(
'用户表
ID'
);
$table
->
bigInteger
(
'
pharmacy_id'
)
->
index
(
'idx_pharmacyid'
)
->
comment
(
'药店
ID'
);
$table
->
timestamps
();
$table
->
timestamps
();
$table
->
softDeletes
();
$table
->
softDeletes
();
});
});
...
...
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