Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mp_estate_server
Project
Project
Details
Activity
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
mp_estate_backstage
mp_estate_server
Commits
9ea0fddc
Commit
9ea0fddc
authored
Sep 11, 2020
by
成旭东
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
ec51a6bc
Pipeline
#28110
passed with stage
in 5 minutes 21 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
11 deletions
+43
-11
list.ts
app/controller/mpEstate/list.ts
+6
-1
tag.ts
app/controller/mpEstate/tag.ts
+4
-10
wafangTag.js
app/model/wafang/wafangTag.js
+33
-0
No files found.
app/controller/mpEstate/list.ts
View file @
9ea0fddc
...
...
@@ -395,6 +395,11 @@ export default class EstateListController extends Controller {
async
tag
()
{
const
{
ctx
,
service
,
serviceGroupName
,
serviceName
}
=
this
;
const
{
type
}
=
ctx
.
params
;
const
whereInfo
=
ctx
.
helper
.
switchQueryToWhere
(
ctx
.
query
,
{
in_house
:
(
item
:
any
)
=>
Number
(
item
),
in_business
:
(
item
:
any
)
=>
Number
(
item
),
in_office
:
(
item
:
any
)
=>
Number
(
item
),
},
[
'in_house'
,
'in_business'
,
'in_office'
]);
const
typeMap
:
any
=
{
house
:
'is_house'
,
...
...
@@ -402,7 +407,7 @@ export default class EstateListController extends Controller {
office
:
'is_office'
,
};
const
where
=
{}
;
const
where
=
whereInfo
;
where
[
typeMap
[
type
]]
=
1
;
...
...
app/controller/mpEstate/tag.ts
View file @
9ea0fddc
...
...
@@ -59,20 +59,14 @@ export default class EstateTagController extends Controller {
async
batchUpdate
()
{
const
{
ctx
,
service
,
serviceGroupName
,
serviceName
}
=
this
;
const
{
data
,
type
}
=
ctx
.
request
.
body
;
const
typeMap
=
{
house
:
'is_house'
,
business
:
'is_business'
,
office
:
'is_office'
,
};
const
{
data
}
=
ctx
.
request
.
body
;
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
const
item
=
data
[
i
];
const
updateId
=
item
.
id
;
delete
item
.
id
;
await
service
[
serviceGroupName
][
serviceName
].
update
(
item
.
id
,
{
[
typeMap
[
type
]]:
item
[
typeMap
[
type
]],
});
await
service
[
serviceGroupName
][
serviceName
].
update
(
updateId
,
item
);
}
ctx
.
success
();
...
...
app/model/wafang/wafangTag.js
View file @
9ea0fddc
...
...
@@ -33,6 +33,39 @@ module.exports = app => {
defaultValue
:
1
,
comment
:
'是否办公标签'
,
},
in_house
:
{
type
:
DataTypes
.
INTEGER
(
1
),
allowNull
:
false
,
defaultValue
:
0
,
comment
:
'是否在house下展示标签'
,
},
in_house_order
:
{
type
:
DataTypes
.
INTEGER
(
11
),
allowNull
:
false
,
defaultValue
:
0
,
},
in_business
:
{
type
:
DataTypes
.
INTEGER
(
1
),
allowNull
:
false
,
defaultValue
:
0
,
comment
:
'是否在business下展示标签'
,
},
in_business_order
:
{
type
:
DataTypes
.
INTEGER
(
11
),
allowNull
:
false
,
defaultValue
:
0
,
},
in_office
:
{
type
:
DataTypes
.
INTEGER
(
1
),
allowNull
:
false
,
defaultValue
:
0
,
comment
:
'是否在office下展示标签'
,
},
in_office_order
:
{
type
:
DataTypes
.
INTEGER
(
11
),
allowNull
:
false
,
defaultValue
:
0
,
},
status
:
{
type
:
DataTypes
.
ENUM
(
'online'
,
'offline'
),
allowNull
:
false
,
...
...
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