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
2141605f
Commit
2141605f
authored
Jan 08, 2020
by
庄冰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
productSve
parent
ed885bf9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
center-app/app/base/api/impl/action/opProduct.js
+4
-3
center-app/app/base/service/impl/dbproduct/productSve.js
+6
-6
No files found.
center-app/app/base/api/impl/action/opProduct.js
View file @
2141605f
...
@@ -39,17 +39,18 @@ class OpProductAPI extends APIBase {
...
@@ -39,17 +39,18 @@ class OpProductAPI extends APIBase {
async
opActionProcess
(
action_process
,
action_type
,
action_body
,
pobj
,
req
)
{
async
opActionProcess
(
action_process
,
action_type
,
action_body
,
pobj
,
req
)
{
// action_body.app = req.app;
// action_body.app = req.app;
// action_body.user = req.user;
// action_body.user = req.user;
action_body
.
app
=
{
id
:
7
};
var
opResult
=
null
;
var
opResult
=
null
;
switch
(
action_type
)
{
switch
(
action_type
)
{
case
"findByTypeCode"
:
//通过产品类别编码获取产品列表
case
"findByTypeCode"
:
//通过产品类别编码获取产品列表
action_body
[
"app"
]
=
pobj
.
app
;
opResult
=
await
this
.
productSve
.
findByTypeCode
(
action_body
);
opResult
=
await
this
.
productSve
.
findByTypeCode
(
action_body
);
break
;
break
;
case
"findByTypeOneCode"
:
//通过产品大类编码获取产品列表
case
"findByTypeOneCode"
:
//通过产品大类编码获取产品列表
action_body
[
"app"
]
=
pobj
.
app
;
opResult
=
await
this
.
productSve
.
findByTypeOneCode
(
action_body
);
opResult
=
await
this
.
productSve
.
findByTypeOneCode
(
action_body
);
break
;
break
;
case
"getProductDetailByCode"
:
//
通过产品大类编码获取产品列表
case
"getProductDetailByCode"
:
//
获取产品详情
opResult
=
await
this
.
productSve
.
getProductDetailByCode
(
action_body
.
itemCode
,
action_body
.
app
.
id
);
opResult
=
await
this
.
productSve
.
getProductDetailByCode
(
action_body
.
itemCode
,
pobj
.
uapp_
id
);
break
;
break
;
default
:
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
...
...
center-app/app/base/service/impl/dbproduct/productSve.js
View file @
2141605f
...
@@ -39,14 +39,14 @@ class ProductService extends ServiceBase {
...
@@ -39,14 +39,14 @@ class ProductService extends ServiceBase {
* @param {*} pcode 产品码
* @param {*} pcode 产品码
* @param {*} appid 渠道id
* @param {*} appid 渠道id
*/
*/
async
getProductDetailByCode
(
pcode
,
appid
){
async
getProductDetailByCode
(
pcode
,
u
appid
){
if
(
!
pcode
){
if
(
!
pcode
){
return
system
.
getResult
(
null
,
"产品编码有误"
);
return
system
.
getResult
(
null
,
"产品编码有误"
);
}
}
if
(
!
appid
){
if
(
!
u
appid
){
return
system
.
getResult
(
null
,
"渠道编码有误"
);
return
system
.
getResult
(
null
,
"渠道编码有误"
);
}
}
var
sql
=
"select * from v_product where uapp_id="
+
appid
+
" and item_code='"
+
pcode
+
"'"
;
var
sql
=
"select * from v_product where uapp_id="
+
u
appid
+
" and item_code='"
+
pcode
+
"'"
;
var
tmpResult
=
await
this
.
customQuery
(
sql
);
var
tmpResult
=
await
this
.
customQuery
(
sql
);
if
(
tmpResult
&&
tmpResult
.
length
>
0
){
if
(
tmpResult
&&
tmpResult
.
length
>
0
){
for
(
var
i
=
0
;
i
<
tmpResult
.
length
;
i
++
){
for
(
var
i
=
0
;
i
<
tmpResult
.
length
;
i
++
){
...
@@ -73,14 +73,14 @@ class ProductService extends ServiceBase {
...
@@ -73,14 +73,14 @@ class ProductService extends ServiceBase {
*/
*/
async
findByTypeCode
(
obj
){
async
findByTypeCode
(
obj
){
var
app
=
obj
.
app
;
var
app
=
obj
.
app
;
if
(
!
app
||
!
app
.
id
){
if
(
!
app
||
!
app
.
uapp_
id
){
return
system
.
getResult
(
null
,
"渠道参数有误"
);
return
system
.
getResult
(
null
,
"渠道参数有误"
);
}
}
var
typeCode
=
obj
.
typeCode
;
var
typeCode
=
obj
.
typeCode
;
if
(
!
typeCode
){
if
(
!
typeCode
){
return
system
.
getResult
(
null
,
"产品类别编码有误"
);
return
system
.
getResult
(
null
,
"产品类别编码有误"
);
}
}
var
sql
=
"select * from v_product where uapp_id="
+
app
.
id
+
" and type_code='"
+
typeCode
+
"'"
;
var
sql
=
"select * from v_product where uapp_id="
+
app
.
uapp_
id
+
" and type_code='"
+
typeCode
+
"'"
;
var
tmpResult
=
await
this
.
customQuery
(
sql
);
var
tmpResult
=
await
this
.
customQuery
(
sql
);
return
system
.
getResultSuccess
(
tmpResult
);
return
system
.
getResultSuccess
(
tmpResult
);
}
}
...
@@ -97,7 +97,7 @@ class ProductService extends ServiceBase {
...
@@ -97,7 +97,7 @@ class ProductService extends ServiceBase {
if
(
!
typeOneCode
){
if
(
!
typeOneCode
){
return
system
.
getResult
(
null
,
"产品类别编码有误"
);
return
system
.
getResult
(
null
,
"产品类别编码有误"
);
}
}
var
sql
=
"select * from v_product where uapp_id="
+
app
.
id
+
" and p_type_code='"
+
typeOneCode
+
"'"
;
var
sql
=
"select * from v_product where uapp_id="
+
app
.
uapp_
id
+
" and p_type_code='"
+
typeOneCode
+
"'"
;
var
tmpResult
=
await
this
.
customQuery
(
sql
);
var
tmpResult
=
await
this
.
customQuery
(
sql
);
return
system
.
getResultSuccess
(
tmpResult
);
return
system
.
getResultSuccess
(
tmpResult
);
}
}
...
...
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