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
29727f70
Commit
29727f70
authored
Aug 14, 2020
by
v_vjyjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
ad95aca8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
4 deletions
+29
-4
center-manage/app/base/api/impl/common/product.js
+11
-4
center-manage/app/base/service/impl/product/productpriceSve.js
+18
-0
No files found.
center-manage/app/base/api/impl/common/product.js
View file @
29727f70
...
@@ -16,13 +16,20 @@ class ProductAPI extends APIBase {
...
@@ -16,13 +16,20 @@ class ProductAPI extends APIBase {
* code:''
* code:''
* ]
* ]
*/
*/
async
findRegionsByProductName
(
p
,
q
,
req
)
{
async
findRegionsByProductName
(
p
,
q
,
req
)
{
let
pname
=
p
.
productname
;
let
pname
=
p
.
productname
;
let
sp
=
p
.
sp
;
let
sp
=
p
.
sp
;
let
rs
=
await
this
.
productpriceS
.
findRegionsByProductName
(
pname
,
sp
)
let
rs
=
await
this
.
productpriceS
.
findRegionsByProductName
(
pname
,
sp
)
return
system
.
getResult
(
rs
);
return
system
.
getResult
(
rs
);
}
}
classDesc
()
{
async
findCostBySkuCode
(
p
,
q
,
req
)
{
let
skucode
=
p
.
skucode
;
let
rs
=
await
this
.
productpriceS
.
findCostBySkuCode
(
skucode
)
return
system
.
getResult
({
cost
:
rs
});
}
classDesc
()
{
return
{
return
{
groupName
:
"auth"
,
groupName
:
"auth"
,
groupDesc
:
"认证相关的包"
,
groupDesc
:
"认证相关的包"
,
...
@@ -37,12 +44,12 @@ class ProductAPI extends APIBase {
...
@@ -37,12 +44,12 @@ class ProductAPI extends APIBase {
`
,
`
,
};
};
}
}
methodDescs
()
{
methodDescs
()
{
return
[
return
[
];
];
}
}
exam
()
{
exam
()
{
return
``
return
``
}
}
}
}
...
...
center-manage/app/base/service/impl/product/productpriceSve.js
View file @
29727f70
...
@@ -4,6 +4,24 @@ class ProductpriceService extends ServiceBase {
...
@@ -4,6 +4,24 @@ class ProductpriceService extends ServiceBase {
constructor
()
{
constructor
()
{
super
(
"product"
,
ServiceBase
.
getDaoName
(
ProductpriceService
));
super
(
"product"
,
ServiceBase
.
getDaoName
(
ProductpriceService
));
}
}
async
findCostBySkuCode
(
skucode
)
{
let
productpricetmp
=
await
this
.
dao
.
model
.
findOne
({
where
:
{
skucode
:
skucode
,
isEnabled
:
true
},
include
:
[
{
model
:
this
.
db
.
models
.
productcost
,
where
:
{
expensetype
:
'service'
},
as
:
"costs"
,
attributes
:
[
'id'
,
'expensetype'
,
'costamount'
]
}
],
raw
:
true
,
}
)
let
costAmount
=
0
//获取服务费成本
if
(
productpricetmp
&&
productpricetmp
[
'costs.costamount'
])
{
costAmount
=
Number
(
productpricetmp
[
'costs.costamount'
])
}
else
{
console
.
log
(
"skucode not find product:"
,
skucode
)
}
return
costAmount
}
/**
/**
* @param {*} pname 产品名称
* @param {*} pname 产品名称
* @param {*} spname 服务商名称
* @param {*} spname 服务商名称
...
...
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