Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qsh-wc
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
honghuiliu
qsh-wc
Commits
1416c0b1
Commit
1416c0b1
authored
Sep 02, 2022
by
honghuiliu
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日常提交
parent
9308c6db
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
11 deletions
+12
-11
qsh_partol.go
server/model/admin/qsh_partol.go
+8
-7
qsh_partol.go
server/service/admin/qsh_partol.go
+2
-2
patrolService.go
server/service/web/patrolService.go
+2
-2
No files found.
server/model/admin/qsh_partol.go
View file @
1416c0b1
...
@@ -8,13 +8,14 @@ import (
...
@@ -8,13 +8,14 @@ import (
// QshPartol 结构体
// QshPartol 结构体
type
QshPatrol
struct
{
type
QshPatrol
struct
{
global
.
GVA_MODEL
global
.
GVA_MODEL
Content
string
`json:"content" form:"content" gorm:"column:content;comment:巡检内容;"`
Content
string
`json:"content" form:"content" gorm:"column:content;comment:巡检内容;"`
Description
string
`json:"description" form:"description" gorm:"column:description;comment:异常描述;size:300;"`
Description
string
`json:"description" form:"description" gorm:"column:description;comment:异常描述;size:300;"`
Image
string
`json:"image" form:"image" gorm:"column:image;comment:巡检图片多个逗号分隔;"`
Image
string
`json:"image" form:"image" gorm:"column:image;comment:巡检图片多个逗号分隔;"`
PartolName
string
`json:"partolName" form:"partolName" gorm:"column:partol_name;comment:巡视人;size:255;"`
PartolName
string
`json:"partolName" form:"partolName" gorm:"column:partol_name;comment:巡视人;size:255;"`
Title
string
`json:"title" form:"title" gorm:"column:title;comment:工单标题;size:255;"`
Title
string
`json:"title" form:"title" gorm:"column:title;comment:工单标题;size:255;"`
ToiletId
*
int
`json:"toiletId" form:"toiletId" gorm:"column:toilet_id;comment:巡检公厕;size:10;"`
ToiletId
int
`json:"toiletId" form:"toiletId" gorm:"column:toilet_id;comment:巡检公厕;size:10;"`
Type
*
int
`json:"type" form:"type" gorm:"column:type;comment:巡检类型 1=>一体化设备 2=>玻璃钢;"`
Type
int
`json:"type" form:"type" gorm:"column:type;comment:巡检类型 1=>一体化设备 2=>玻璃钢;"`
Toilet
QshToilet
`json:"toilet" form:"toilet" gorm:"foreignkey:ID;references:ToiletId"`
}
}
// TableName QshPartol 表名
// TableName QshPartol 表名
...
...
server/service/admin/qsh_partol.go
View file @
1416c0b1
...
@@ -57,13 +57,13 @@ func (qshPartolService *QshPartolService) GetQshPartolInfoList(info adminReq.Qsh
...
@@ -57,13 +57,13 @@ func (qshPartolService *QshPartolService) GetQshPartolInfoList(info adminReq.Qsh
if
info
.
Title
!=
""
{
if
info
.
Title
!=
""
{
db
=
db
.
Where
(
"title LIKE ?"
,
"%"
+
info
.
Title
+
"%"
)
db
=
db
.
Where
(
"title LIKE ?"
,
"%"
+
info
.
Title
+
"%"
)
}
}
if
info
.
Type
!=
nil
{
if
info
.
Type
!=
0
{
db
=
db
.
Where
(
"type = ?"
,
info
.
Type
)
db
=
db
.
Where
(
"type = ?"
,
info
.
Type
)
}
}
err
=
db
.
Count
(
&
total
)
.
Error
err
=
db
.
Count
(
&
total
)
.
Error
if
err
!=
nil
{
if
err
!=
nil
{
return
return
}
}
err
=
db
.
Limit
(
limit
)
.
Offset
(
offset
)
.
Find
(
&
qshPartols
)
.
Error
err
=
db
.
Limit
(
limit
)
.
Offset
(
offset
)
.
Preload
(
"Toilet"
)
.
Find
(
&
qshPartols
)
.
Error
return
qshPartols
,
total
,
err
return
qshPartols
,
total
,
err
}
}
server/service/web/patrolService.go
View file @
1416c0b1
...
@@ -32,7 +32,7 @@ func (l *PatrolService) GetPatrolList(arg request.PatrolList) ([]admin.QshPatrol
...
@@ -32,7 +32,7 @@ func (l *PatrolService) GetPatrolList(arg request.PatrolList) ([]admin.QshPatrol
if
err
!=
nil
{
if
err
!=
nil
{
return
patrolList
,
total
,
err
return
patrolList
,
total
,
err
}
}
err
=
db
.
Limit
(
limit
)
.
Offset
(
offset
)
.
Find
(
&
patrolList
)
.
Error
err
=
db
.
Limit
(
limit
)
.
Offset
(
offset
)
.
Preload
(
"Toilet"
)
.
Find
(
&
patrolList
)
.
Error
if
err
!=
nil
{
if
err
!=
nil
{
return
patrolList
,
total
,
err
return
patrolList
,
total
,
err
}
}
...
@@ -44,7 +44,7 @@ func (l *PatrolService) GetPatrolDetail(arg request.GetPatrolId) (admin.QshPatro
...
@@ -44,7 +44,7 @@ func (l *PatrolService) GetPatrolDetail(arg request.GetPatrolId) (admin.QshPatro
db
:=
global
.
GVA_DB
.
Model
(
admin
.
QshPatrol
{})
db
:=
global
.
GVA_DB
.
Model
(
admin
.
QshPatrol
{})
db
.
Where
(
"id = ?"
,
arg
.
ID
)
db
.
Where
(
"id = ?"
,
arg
.
ID
)
err
:=
db
.
First
(
&
patrolList
)
.
Error
err
:=
db
.
First
(
&
patrolList
)
.
Preload
(
"Toilet"
)
.
Error
if
err
!=
nil
{
if
err
!=
nil
{
return
patrolList
,
err
return
patrolList
,
err
}
}
...
...
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