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
ef89c955
Commit
ef89c955
authored
Jan 05, 2021
by
任晓松
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取渠道和产品
parent
af672e67
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
0 deletions
+59
-0
center-app/app/base/api/impl/action/opProduct.js
+3
-0
center-app/app/base/api/impl/auth/accessAuth.js
+9
-0
center-app/app/base/service/impl/dbproduct/productSve.js
+37
-0
center-app/app/base/service/impl/utilsSve/utilsappSve.js
+10
-0
No files found.
center-app/app/base/api/impl/action/opProduct.js
View file @
ef89c955
...
...
@@ -65,6 +65,9 @@ class OpProductAPI extends APIBase {
break
;
//2020-12-17 baidu reg end -----------------
case
"getAllProducts"
:
opResult
=
await
this
.
productSve
.
getAllProducts
();
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
...
...
center-app/app/base/api/impl/auth/accessAuth.js
View file @
ef89c955
...
...
@@ -110,6 +110,14 @@ class AccessAuthAPI extends APIBase {
return
result
;
}
/**
* 获取所有渠道
* @returns {Promise<void>}
*/
async
getAllChannels
(){
var
result
=
await
this
.
utilsappSve
.
getAllChannels
();
return
result
;
}
}
module
.
exports
=
AccessAuthAPI
;
\ No newline at end of file
center-app/app/base/service/impl/dbproduct/productSve.js
View file @
ef89c955
...
...
@@ -487,5 +487,42 @@ class ProductService extends ServiceBase {
}
return
system
.
getResultSuccess
({
successRet
,
failRet
})
}
/**
* 获取所有渠道的产品
* @returns {Promise<void>}
*/
async
getAllProducts
(){
let
sql
=
`select DISTINCT(channel_item_name),item_code from p_product`
;
let
result
=
await
this
.
customQuery
(
sql
);
let
arr
=
[];
result
.
forEach
(
item
=>
{
if
(
item
.
channel_item_name
.
indexOf
(
'市'
)
==
item
.
channel_item_name
.
length
-
1
)
{
item
.
channel_item_name
+=
'公司注册'
}
if
(
item
.
channel_item_name
.
indexOf
(
'区'
)
==
item
.
channel_item_name
.
length
-
1
)
{
item
.
channel_item_name
+=
'公司注册'
}
if
(
item
.
item_code
==
'10202010202001'
){
item
.
item_code
=
'zzsbzc'
;
}
if
(
item
.
item_code
==
'10202010202002'
){
item
.
item_code
=
'fzsbzc'
;
}
if
(
item
.
item_code
==
'10202010202003'
){
item
.
item_code
=
'dbsbzc'
;
}
if
(
item
.
item_code
==
'10202010204002'
){
item
.
item_code
=
'icpsq'
;
}
if
(
item
.
item_code
==
'10202010204001'
){
item
.
item_code
=
'edisq'
;
}
if
(
!
arr
.
includes
(
item
)){
arr
.
push
(
item
)
}
})
return
system
.
getResultSuccess
(
arr
);
}
}
module
.
exports
=
ProductService
;
center-app/app/base/service/impl/utilsSve/utilsappSve.js
View file @
ef89c955
...
...
@@ -60,5 +60,15 @@ class UtilsAppSve extends AppServiceBase {
return
system
.
getResult
(
null
,
"渠道码错误"
)
}
}
/**
* 获取所有渠道
* @returns {Promise<{msg: *, data: (*|null), status: number}>}
*/
async
getAllChannels
(){
let
sql
=
`SELECT DISTINCT(uapp_id),app_name FROM p_app`
;
let
result
=
await
this
.
appDao
.
customQuery
(
sql
);
return
system
.
getResultSuccess
(
result
);
}
}
module
.
exports
=
UtilsAppSve
;
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