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
b66cb1eb
Commit
b66cb1eb
authored
Jul 03, 2020
by
wkliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分转元
parent
d768840b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
engine-product/app/base/service/impl/product/productSve.js
+13
-2
No files found.
engine-product/app/base/service/impl/product/productSve.js
View file @
b66cb1eb
...
@@ -9,7 +9,6 @@ class ProductService extends ServiceBase {
...
@@ -9,7 +9,6 @@ class ProductService extends ServiceBase {
async
getPage
(
page
,
limit
,
type
,
keywords
)
{
async
getPage
(
page
,
limit
,
type
,
keywords
)
{
let
result
=
await
this
.
dao
.
getPage
(
page
,
limit
,
type
,
keywords
)
let
result
=
await
this
.
dao
.
getPage
(
page
,
limit
,
type
,
keywords
)
for
(
let
i
=
0
;
i
<
result
.
rows
.
length
;
++
i
)
{
for
(
let
i
=
0
;
i
<
result
.
rows
.
length
;
++
i
)
{
console
.
log
(
result
[
i
])
if
(
result
.
rows
[
i
].
price
)
{
if
(
result
.
rows
[
i
].
price
)
{
result
.
rows
[
i
].
setDataValue
(
"price"
,
result
.
rows
[
i
].
price
/
100
)
result
.
rows
[
i
].
setDataValue
(
"price"
,
result
.
rows
[
i
].
price
/
100
)
}
}
...
@@ -58,7 +57,13 @@ class ProductService extends ServiceBase {
...
@@ -58,7 +57,13 @@ class ProductService extends ServiceBase {
}
}
async
getByIds
(
ids
)
{
async
getByIds
(
ids
)
{
return
await
this
.
dao
.
getByIds
(
ids
)
let
result
=
await
this
.
dao
.
getByIds
(
ids
)
for
(
let
i
=
0
;
i
<
result
.
rows
.
length
;
++
i
)
{
if
(
result
.
rows
[
i
].
price
)
{
result
.
rows
[
i
].
setDataValue
(
"price"
,
result
.
rows
[
i
].
price
/
100
)
}
}
return
result
}
}
async
getItems
(
id
)
{
async
getItems
(
id
)
{
...
@@ -73,6 +78,11 @@ class ProductService extends ServiceBase {
...
@@ -73,6 +78,11 @@ class ProductService extends ServiceBase {
arr
.
push
(
i
.
product_id
)
arr
.
push
(
i
.
product_id
)
}
}
let
result
=
await
this
.
dao
.
getByIds
(
arr
)
let
result
=
await
this
.
dao
.
getByIds
(
arr
)
for
(
let
i
in
result
)
{
if
(
result
[
i
].
price
)
{
result
[
i
].
setDataValue
(
"price"
,
result
[
i
].
price
/
100
)
}
}
let
res
=
result
.
map
((
data
)
=>
{
let
res
=
result
.
map
((
data
)
=>
{
return
data
.
id
return
data
.
id
})
})
...
@@ -80,6 +90,7 @@ class ProductService extends ServiceBase {
...
@@ -80,6 +90,7 @@ class ProductService extends ServiceBase {
ans
.
items
=
result
ans
.
items
=
result
ans
.
ids
=
res
ans
.
ids
=
res
let
pro
=
await
this
.
dao
.
model
.
findOne
({
where
:
{
id
:
id
}
})
let
pro
=
await
this
.
dao
.
model
.
findOne
({
where
:
{
id
:
id
}
})
pro
.
setDataValue
(
"price"
,
pro
.
price
/
100
)
ans
.
pro
=
pro
ans
.
pro
=
pro
return
ans
return
ans
}
}
...
...
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