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
db93227d
Commit
db93227d
authored
Nov 20, 2019
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
bea5d42e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
3 deletions
+31
-3
igirl-channel/app/base/db/impl/dbapp/appproductDao.js
+27
-0
igirl-channel/app/base/db/models/dbapp/appproduct.js
+2
-1
igirl-channel/app/base/service/impl/dborder/ordertmproductSve.js
+2
-2
No files found.
igirl-channel/app/base/db/impl/dbapp/appproductDao.js
View file @
db93227d
...
@@ -4,6 +4,33 @@ class AppProductDao extends Dao {
...
@@ -4,6 +4,33 @@ class AppProductDao extends Dao {
constructor
()
{
constructor
()
{
super
(
Dao
.
getModelName
(
AppProductDao
));
super
(
Dao
.
getModelName
(
AppProductDao
));
}
}
async
findOneByServiceItemCode
(
itemCode
,
appId
)
{
return
this
.
model
.
findOne
({
where
:
{
serviceItemCode
:
itemCode
,
app_id
:
appId
},
attributes
:
[
"id"
,
"app_id"
,
// 应用id
"itemCode"
,
// 产品编码
"itemName"
,
// 产品名称
"picUrl"
,
// 产品图片地址
"channelItemCode"
,
// 渠道产品编码
"channelItemName"
,
// 渠道产品名称
"status"
,
// 状态 0禁用 1启用
"verifyPrice"
,
// 是否验证价格 0不验证 1验证
"proPrice"
,
// 产品价格
"serviceCharge"
,
// 服务费
"publicExpense"
,
// 官费
"rateConfig"
,
// 税率
"discountsRateConfig"
,
// 优惠税率
"channelProfitRate"
,
// 渠道利润分成比率(只分订单中毛利润总额的分成)
"sort"
,
"productType_id"
,
"productOneType_id"
],
raw
:
true
});
}
async
findOneByCode
(
itemCode
,
appId
)
{
async
findOneByCode
(
itemCode
,
appId
)
{
return
this
.
model
.
findOne
({
return
this
.
model
.
findOne
({
where
:
{
where
:
{
...
...
igirl-channel/app/base/db/models/dbapp/appproduct.js
View file @
db93227d
...
@@ -8,7 +8,8 @@ module.exports = (db, DataTypes) => {
...
@@ -8,7 +8,8 @@ module.exports = (db, DataTypes) => {
itemName
:
DataTypes
.
STRING
(
100
),
// 产品名称
itemName
:
DataTypes
.
STRING
(
100
),
// 产品名称
picUrl
:
DataTypes
.
STRING
(
500
),
// 产品图片地址
picUrl
:
DataTypes
.
STRING
(
500
),
// 产品图片地址
channelItemCode
:
DataTypes
.
STRING
(
100
),
// 渠道产品编码
channelItemCode
:
DataTypes
.
STRING
(
100
),
// 渠道产品编码
channelItemName
:
DataTypes
.
STRING
(
100
),
// 渠道产品名称
channelItemName
:
DataTypes
.
STRING
(
100
),
// 渠道产品名称
serviceItemCode
:
DataTypes
.
STRING
(
100
),
// 服务商产品编码
status
:
DataTypes
.
BOOLEAN
,
// 状态 0禁用 1启用
status
:
DataTypes
.
BOOLEAN
,
// 状态 0禁用 1启用
verifyPrice
:
DataTypes
.
BOOLEAN
,
// 是否验证价格 0不验证 1验证
verifyPrice
:
DataTypes
.
BOOLEAN
,
// 是否验证价格 0不验证 1验证
proPrice
:
DataTypes
.
DOUBLE
,
// 产品价格
proPrice
:
DataTypes
.
DOUBLE
,
// 产品价格
...
...
igirl-channel/app/base/service/impl/dborder/ordertmproductSve.js
View file @
db93227d
...
@@ -761,7 +761,7 @@ class OrderTmProductService extends ServiceBase {
...
@@ -761,7 +761,7 @@ class OrderTmProductService extends ServiceBase {
return
system
.
getResult
(
null
,
"itemCode参数错误"
);
return
system
.
getResult
(
null
,
"itemCode参数错误"
);
}
}
// itemCode="zzsbzc";//测试
// itemCode="zzsbzc";//测试
var
productItem
=
await
this
.
appproductDao
.
findOneByCode
(
itemCode
,
user
.
app_id
);
//获取产品
var
productItem
=
await
this
.
appproductDao
.
findOneBy
ServiceItem
Code
(
itemCode
,
user
.
app_id
);
//获取产品
if
(
!
productItem
)
{
if
(
!
productItem
)
{
return
system
.
getResult
(
null
,
"未知的产品"
);
return
system
.
getResult
(
null
,
"未知的产品"
);
}
}
...
@@ -948,7 +948,7 @@ class OrderTmProductService extends ServiceBase {
...
@@ -948,7 +948,7 @@ class OrderTmProductService extends ServiceBase {
if
(
!
itemCode
)
{
if
(
!
itemCode
)
{
return
system
.
getResultFail
(
-
106
,
"产品编码参数错误"
);
return
system
.
getResultFail
(
-
106
,
"产品编码参数错误"
);
}
}
var
productItem
=
await
this
.
appproductDao
.
findOneByCode
(
itemCode
,
app
.
id
);
//获取产品
var
productItem
=
await
this
.
appproductDao
.
findOneBy
ServiceItem
Code
(
itemCode
,
app
.
id
);
//获取产品
if
(
!
productItem
)
{
if
(
!
productItem
)
{
return
system
.
getResultFail
(
-
107
,
"未知的产品"
);
return
system
.
getResultFail
(
-
107
,
"未知的产品"
);
}
}
...
...
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