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
13b1b812
authored
Nov 11, 2024
by
lujunyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改表名
parent
6985b8b4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
7 deletions
+12
-7
app/Admin/Repositories/DrugTagRelatedInquiryRepository.php
+2
-2
app/Models/DrugRelatedTagModel.php
+5
-0
app/Models/DrugTagModel.php
+1
-1
app/Models/DrugTagRelatedInquiryModel.php
+2
-2
database/migrations/2024_11_11_153233_create_drug_tag_related_inquiry_table.php
+2
-2
No files found.
app/Admin/Repositories/DrugTagInquiryRepository.php
→
app/Admin/Repositories/DrugTag
Related
InquiryRepository.php
View file @
13b1b812
...
@@ -2,10 +2,10 @@
...
@@ -2,10 +2,10 @@
namespace
App\Admin\Repositories
;
namespace
App\Admin\Repositories
;
use
App\Models\DrugTagInquiryModel
as
Model
;
use
App\Models\DrugTag
Related
InquiryModel
as
Model
;
use
Dcat\Admin\Repositories\EloquentRepository
;
use
Dcat\Admin\Repositories\EloquentRepository
;
class
DrugTagInquiryRepository
extends
EloquentRepository
class
DrugTag
Related
InquiryRepository
extends
EloquentRepository
{
{
/**
/**
* Model.
* Model.
...
...
app/Models/DrugRelatedTagModel.php
View file @
13b1b812
...
@@ -10,4 +10,9 @@ class DrugRelatedTagModel extends Model
...
@@ -10,4 +10,9 @@ class DrugRelatedTagModel extends Model
use
HasDateTimeFormatter
;
use
HasDateTimeFormatter
;
protected
$table
=
'drug_related_tag'
;
protected
$table
=
'drug_related_tag'
;
protected
$fillable
=
[
'drug_id'
,
'tag_id'
,
];
}
}
app/Models/DrugTagModel.php
View file @
13b1b812
...
@@ -18,7 +18,7 @@ public function inquiry()
...
@@ -18,7 +18,7 @@ public function inquiry()
{
{
$relatedModel
=
InquiryModel
::
class
;
// 药品标签要关联的问诊问题模型类名
$relatedModel
=
InquiryModel
::
class
;
// 药品标签要关联的问诊问题模型类名
$pivotTable
=
'drug_tag_inquiry'
;
// 药品标签和问诊问题关联中间表
$pivotTable
=
'drug_tag_
related_
inquiry'
;
// 药品标签和问诊问题关联中间表
return
$this
->
belongsToMany
(
$relatedModel
,
$pivotTable
,
'tag_id'
,
'inquiry_id'
)
->
withTimestamps
();
return
$this
->
belongsToMany
(
$relatedModel
,
$pivotTable
,
'tag_id'
,
'inquiry_id'
)
->
withTimestamps
();
}
}
...
...
app/Models/DrugTagInquiryModel.php
→
app/Models/DrugTag
Related
InquiryModel.php
View file @
13b1b812
...
@@ -5,11 +5,11 @@
...
@@ -5,11 +5,11 @@
use
Dcat\Admin\Traits\HasDateTimeFormatter
;
use
Dcat\Admin\Traits\HasDateTimeFormatter
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\Model
;
class
DrugTagInquiryModel
extends
Model
class
DrugTag
Related
InquiryModel
extends
Model
{
{
use
HasDateTimeFormatter
;
use
HasDateTimeFormatter
;
protected
$table
=
'drug_tag_inquiry'
;
protected
$table
=
'drug_tag_
related_
inquiry'
;
protected
$fillable
=
[
protected
$fillable
=
[
'tag_id'
,
'tag_id'
,
...
...
database/migrations/2024_11_11_153233_create_drug_tag_inquiry_table.php
→
database/migrations/2024_11_11_153233_create_drug_tag_
related_
inquiry_table.php
View file @
13b1b812
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
*/
*/
public
function
up
()
:
void
public
function
up
()
:
void
{
{
Schema
::
create
(
'drug_tag_inquiry'
,
function
(
Blueprint
$table
)
{
Schema
::
create
(
'drug_tag_
related_
inquiry'
,
function
(
Blueprint
$table
)
{
$table
->
comment
(
'药品标签和问诊问题关联表'
);
$table
->
comment
(
'药品标签和问诊问题关联表'
);
$table
->
bigIncrements
(
'id'
);
$table
->
bigIncrements
(
'id'
);
$table
->
bigInteger
(
'tag_id'
)
->
comment
(
'药品标签ID'
);
$table
->
bigInteger
(
'tag_id'
)
->
comment
(
'药品标签ID'
);
...
@@ -25,6 +25,6 @@ public function up(): void
...
@@ -25,6 +25,6 @@ public function up(): void
*/
*/
public
function
down
()
:
void
public
function
down
()
:
void
{
{
Schema
::
dropIfExists
(
'drug_tag_inquiry'
);
Schema
::
dropIfExists
(
'drug_tag_
related_
inquiry'
);
}
}
};
};
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