Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
53fc5d9f
Commit
53fc5d9f
authored
Sep 09, 2020
by
庄冰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
getProductTypeInfo
parent
f2e6bb61
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
2 deletions
+32
-2
gsb-marketplat-mag/app/base/controller/impl/aggregation/producttypeCtl.js
+5
-0
gsb-marketplat-mag/app/base/service/impl/aggregation/producttypeSve.js
+27
-2
No files found.
gsb-marketplat-mag/app/base/controller/impl/aggregation/producttypeCtl.js
View file @
53fc5d9f
...
...
@@ -16,5 +16,10 @@ class ProductTypeCtl extends CtlBase {
const
up
=
await
this
.
service
.
update
(
pobj
);
return
up
;
}
async
getProductTypeInfo
(
pobj
){
const
res
=
await
this
.
service
.
getProductTypeInfo
(
pobj
);
return
res
;
}
}
module
.
exports
=
ProductTypeCtl
;
gsb-marketplat-mag/app/base/service/impl/aggregation/producttypeSve.js
View file @
53fc5d9f
...
...
@@ -57,6 +57,31 @@ class ProducttypeService extends ServiceBase {
}
return
system
.
getResultSuccess
(
this
.
dao
.
update
(
pobj
));
}
//获取产品类型信息-用于后台管理页面
async
getProductTypeInfo
(
obj
){
// if(!obj || !obj.company_id){
// return system.getResultFail();
// }
var
typeones
=
await
this
.
dao
.
model
.
findAll
({
attributes
:[
"id"
,
"code"
,
"name"
,
"pic_url"
,
"jump_link_type"
,
"jump_link"
],
where
:{
p_id
:
0
},
raw
:
true
,
order
:[[
"sequence"
,
"desc"
]]
});
for
(
var
i
=
0
;
i
<
typeones
.
length
;
i
++
){
if
(
typeones
[
i
]
&&
typeones
[
i
].
id
)
var
typetwos
=
await
this
.
dao
.
model
.
findAll
({
attributes
:[
"id"
,
"code"
,
"name"
,
"pic_url"
],
where
:{
p_id
:
typeones
[
i
].
id
},
raw
:
true
,
order
:[[
"sequence"
,
"desc"
]]
});
typeones
[
i
][
"children"
]
=
typetwos
}
return
system
.
getResultSuccess
(
typeones
);
}
}
module
.
exports
=
ProducttypeService
;
\ No newline at end of file
module
.
exports
=
ProducttypeService
;
// var task = new ProducttypeService();
// task.getProductTypeInfo(null).then(d=>{
// console.log(JSON.stringify(d));
// })
\ No newline at end of file
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