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
3c7afe5c
Commit
3c7afe5c
authored
Jun 30, 2020
by
xsren@gongsibao.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
9e270903
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletions
+22
-1
center-app/app/base/api/impl/action/opProduct.js
+3
-0
center-app/app/base/service/impl/dbproduct/productSve.js
+19
-1
No files found.
center-app/app/base/api/impl/action/opProduct.js
View file @
3c7afe5c
...
...
@@ -47,6 +47,9 @@ class OpProductAPI extends APIBase {
case
"getProductPrice"
:
//询价
opResult
=
await
this
.
productSve
.
getProductPrice
(
pobj
.
actionBody
);
break
;
case
"getMinPrice"
:
//最低价
opResult
=
await
this
.
productSve
.
getMinPrice
(
pobj
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
...
...
center-app/app/base/service/impl/dbproduct/productSve.js
View file @
3c7afe5c
...
...
@@ -35,6 +35,7 @@ class ProductService extends ServiceBase {
attributes
:
[
"id"
,
"pay_code"
,
"price"
,
"supply_price"
,
"service_charge"
,
"public_expense"
,
"is_default"
,
"is_show"
,
"price_type"
,
"price_type_name"
,
"sort"
,
"price_desc"
,
"min_qty"
,
"max_qty"
,
"service_code"
],
order
:
[
[
"price"
,
'ASC'
]
],
raw
:
true
});
if
(
!
pList
||
pList
.
length
==
0
)
{
...
...
@@ -118,7 +119,7 @@ class ProductService extends ServiceBase {
if
(
actionBody
.
time
!=
''
){
const
index
=
actionBody
.
time
.
indexOf
(
'个'
);
const
time
=
actionBody
.
time
.
substring
(
0
,
index
);
producesql
+=
` AND pc.additions_desc
LIKE
= '
${
time
}
'`
;
producesql
+=
` AND pc.additions_desc = '
${
time
}
'`
;
}
else
{
return
system
.
getResultFail
(
null
,
'actionBody.time can not be empty!'
)
}
...
...
@@ -175,5 +176,22 @@ class ProductService extends ServiceBase {
}
return
system
.
getResultSuccess
(
actionBody
);
}
/**
* 获取最低价
* @returns {Promise<void>}
*/
async
getMinPrice
(
pobj
){
let
data
=
{};
if
(
!
pobj
.
actionBody
.
product_id
){
return
system
.
getResultFail
(
-
1
,
'product_id is empty'
);
}
let
sql
=
`select min(price) price from p_product_price where product_id =
${
pobj
.
actionBody
.
product_id
}
`
;
let
result
=
await
this
.
customQuery
(
sql
);
if
(
result
){
data
=
result
[
0
];
}
return
system
.
getResultSuccess
(
data
);
}
}
module
.
exports
=
ProductService
;
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