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
bd73a0e1
Commit
bd73a0e1
authored
Feb 19, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
77e86f3b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
10 deletions
+12
-10
center-app/app/base/db/impl/dbproduct/productinterfaceDao.js
+4
-3
center-app/app/base/db/models/dbproduct/productprice.js
+1
-0
center-app/app/base/service/impl/dbproduct/productSve.js
+7
-7
No files found.
center-app/app/base/db/impl/dbproduct/productinterfaceDao.js
View file @
bd73a0e1
...
...
@@ -4,13 +4,14 @@ class ProductInterfaceDao extends Dao {
constructor
()
{
super
(
Dao
.
getModelName
(
ProductInterfaceDao
));
}
async
get
ItemByProductId
(
product
Id
)
{
return
this
.
model
.
findOne
({
async
get
ListByProductPriceId
(
productPrice
Id
)
{
return
await
this
.
productpriceDao
.
model
.
findAll
({
where
:
{
product_
id
:
product
Id
product_
price_id
:
productPrice
Id
},
attributes
:
[
"id"
,
"op_type"
,
"interface_url"
,
"interface_type"
,
"interface_type_name"
,
...
...
center-app/app/base/db/models/dbproduct/productprice.js
View file @
bd73a0e1
...
...
@@ -25,6 +25,7 @@ module.exports = (db, DataTypes) => {
price_type_name
:
DataTypes
.
STRING
(
10
),
//定价类型名称
sort
:
DataTypes
.
INTEGER
,
price_desc
:
DataTypes
.
STRING
(
255
),
//价格描述
service_code
:
DataTypes
.
STRING
(
255
),
min_qty
:
DataTypes
.
INTEGER
,
//最小数量
max_qty
:
DataTypes
.
INTEGER
,
//最大数量
...
...
center-app/app/base/service/impl/dbproduct/productSve.js
View file @
bd73a0e1
...
...
@@ -33,8 +33,8 @@ class ProductService extends ServiceBase {
}
var
pList
=
await
this
.
productpriceDao
.
model
.
findAll
({
where
:
{
product_id
:
item
.
id
},
attributes
:
[
"pay_code"
,
"price"
,
"supply_price"
,
"service_charge"
,
"public_expense"
,
"is_default"
,
"price_type"
,
"price_type_name"
,
"sort"
,
"price_desc"
,
"min_qty"
,
"max_qty"
attributes
:
[
"
id"
,
"
pay_code"
,
"price"
,
"supply_price"
,
"service_charge"
,
"public_expense"
,
"is_default"
,
"price_type"
,
"price_type_name"
,
"sort"
,
"price_desc"
,
"min_qty"
,
"max_qty"
,
"service_code"
],
raw
:
true
});
...
...
@@ -49,11 +49,11 @@ class ProductService extends ServiceBase {
* @param {*} actionBody productId产品id
*/
async
getProductInterface
(
actionBody
)
{
var
item
=
await
this
.
productinterfaceDao
.
getItemByProductId
(
actionBody
.
product
Id
);
if
(
!
item
)
{
return
system
.
getResult
(
null
,
"product to interface is data empty !"
);
}
return
system
.
getResultSuccess
(
item
);
var
list
=
await
this
.
productinterfaceDao
.
getListByProductPriceId
(
actionBody
.
productPrice
Id
);
//
if (!item) {
//
return system.getResult(null, "product to interface is data empty !");
//
}
return
system
.
getResultSuccess
(
list
);
}
}
...
...
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