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
9cdebda9
Commit
9cdebda9
authored
Sep 08, 2020
by
兰国旗
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
laolan
parent
bda0c1cf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
43 deletions
+52
-43
gsb-marketplat/app/base/api/impl/action/mediaaggregation.js
+1
-1
gsb-marketplat/app/base/db/impl/mediaaggregation/mediaaggregationDao.js
+42
-33
gsb-marketplat/app/base/service/impl/mediaaggregation/mediaaggregationSve.js
+9
-9
No files found.
gsb-marketplat/app/base/api/impl/action/mediaaggregation.js
View file @
9cdebda9
...
...
@@ -67,7 +67,7 @@ class Mediaaggregation extends APIBase {
case
"test"
:
//测试
opResult
=
system
.
getResultSuccess
(
"测试接口"
);
break
;
case
"productList"
:
//
首页产品
列表
case
"productList"
:
//
服务
列表
opResult
=
await
this
.
mediaaggregationSve
.
productList
(
pobj
);
break
;
case
"rotationChartList"
:
//首页轮播图
...
...
gsb-marketplat/app/base/db/impl/mediaaggregation/mediaaggregationDao.js
View file @
9cdebda9
...
...
@@ -6,9 +6,12 @@ class MediaaggregationDao extends Dao {
}
/**
*
获取产品
列表
*
服务
列表
*/
async
productList
()
{
async
productList
(
req
)
{
var
params
=
{
company_id
:
req
.
actionBody
.
company_id
};
var
returnRes
=
{
total
:
0
,
//总记录条数
rows
:
[]
...
...
@@ -16,10 +19,10 @@ class MediaaggregationDao extends Dao {
var
dataCount
=
"select count(1) as dataCount from mc_product where deleted_at is null "
;
var
sql
=
"select * from mc_product where deleted_at is null "
;
var
list
=
await
this
.
customQuery
(
sql
);
var
list
=
await
this
.
customQuery
(
sql
,
params
);
returnRes
.
rows
=
list
;
// var result = system.getResultSuccess(list);
var
tmpResultCount
=
await
this
.
customQuery
(
dataCount
);
var
tmpResultCount
=
await
this
.
customQuery
(
dataCount
,
params
);
returnRes
.
total
=
tmpResultCount
&&
tmpResultCount
.
length
>
0
?
tmpResultCount
[
0
].
dataCount
:
0
;
var
result
=
system
.
getResultSuccess
(
returnRes
);
return
result
;
...
...
@@ -28,18 +31,22 @@ class MediaaggregationDao extends Dao {
/**
* 轮播图
*/
async
rotationChartList
(){
async
rotationChartList
(
req
){
var
params
=
{
// company_id: req.actionBody.company_id
company_id
:
10
};
var
returnRes
=
{
total
:
0
,
//总记录条数
rows
:
[]
};
var
dataCount
=
"select count(1) as dataCount from mc_rotation_chart where deleted_at is null "
;
var
sql
=
"select * from mc_rotation_chart where deleted_at is null "
;
var
dataCount
=
"select count(1) as dataCount from mc_rotation_chart where deleted_at is null
and pic_type = 2
"
;
var
sql
=
"select * from mc_rotation_chart where deleted_at is null
and pic_type = 2
"
;
var
list
=
await
this
.
customQuery
(
sql
);
var
list
=
await
this
.
customQuery
(
sql
,
params
);
returnRes
.
rows
=
list
;
// var result = system.getResultSuccess(list);
var
tmpResultCount
=
await
this
.
customQuery
(
dataCount
);
var
tmpResultCount
=
await
this
.
customQuery
(
dataCount
,
params
);
returnRes
.
total
=
tmpResultCount
&&
tmpResultCount
.
length
>
0
?
tmpResultCount
[
0
].
dataCount
:
0
;
var
result
=
system
.
getResultSuccess
(
returnRes
);
return
result
;
...
...
@@ -49,7 +56,10 @@ class MediaaggregationDao extends Dao {
/**
* 留资表单产品
*/
async
needProductList
(){
async
needProductList
(
req
){
var
params
=
{
company_id
:
req
.
actionBody
.
company_id
};
var
returnRes
=
{
total
:
0
,
//总记录条数
rows
:
[]
...
...
@@ -57,10 +67,10 @@ class MediaaggregationDao extends Dao {
var
dataCount
=
"select count(1) as dataCount from mc_second_level_need_config where deleted_at is null "
;
var
sql
=
"select * from mc_second_level_need_config where deleted_at is null "
;
var
list
=
await
this
.
customQuery
(
sql
);
var
list
=
await
this
.
customQuery
(
sql
,
params
);
returnRes
.
rows
=
list
;
// var result = system.getResultSuccess(list);
var
tmpResultCount
=
await
this
.
customQuery
(
dataCount
);
var
tmpResultCount
=
await
this
.
customQuery
(
dataCount
,
params
);
returnRes
.
total
=
tmpResultCount
&&
tmpResultCount
.
length
>
0
?
tmpResultCount
[
0
].
dataCount
:
0
;
var
result
=
system
.
getResultSuccess
(
returnRes
);
return
result
;
...
...
@@ -69,7 +79,10 @@ class MediaaggregationDao extends Dao {
/**
* 热门推荐
*/
async
popularRecommendationList
(){
async
popularRecommendationList
(
req
){
var
params
=
{
company_id
:
req
.
actionBody
.
company_id
};
var
returnRes
=
{
total
:
0
,
//总记录条数
rows
:
[]
...
...
@@ -77,10 +90,10 @@ class MediaaggregationDao extends Dao {
var
dataCount
=
"select count(1) as dataCount from mc_popular_recommendation where deleted_at is null "
;
var
sql
=
"select * from mc_popular_recommendation where deleted_at is null "
;
var
list
=
await
this
.
customQuery
(
sql
);
var
list
=
await
this
.
customQuery
(
sql
,
params
);
returnRes
.
rows
=
list
;
// var result = system.getResultSuccess(list);
var
tmpResultCount
=
await
this
.
customQuery
(
dataCount
);
var
tmpResultCount
=
await
this
.
customQuery
(
dataCount
,
params
);
returnRes
.
total
=
tmpResultCount
&&
tmpResultCount
.
length
>
0
?
tmpResultCount
[
0
].
dataCount
:
0
;
var
result
=
system
.
getResultSuccess
(
returnRes
);
return
result
;
...
...
@@ -89,18 +102,21 @@ class MediaaggregationDao extends Dao {
/**
* 产品分类一类
*/
async
productTypeFirst
(){
async
productTypeFirst
(
req
){
var
params
=
{
company_id
:
req
.
actionBody
.
company_id
};
var
returnRes
=
{
total
:
0
,
//总记录条数
rows
:
[]
};
var
dataCount
=
"select count(1) as dataCount from mc_product_type where deleted_at is null and
p_id is null
"
;
var
sql
=
"select * from mc_product_type where deleted_at is null and
p_id is null
"
;
var
dataCount
=
"select count(1) as dataCount from mc_product_type where deleted_at is null and
(p_id is null or p_id = '' )
"
;
var
sql
=
"select * from mc_product_type where deleted_at is null and
( p_id is null or p_id = '' )
"
;
var
list
=
await
this
.
customQuery
(
sql
);
var
list
=
await
this
.
customQuery
(
sql
,
params
);
returnRes
.
rows
=
list
;
// var result = system.getResultSuccess(list);
var
tmpResultCount
=
await
this
.
customQuery
(
dataCount
);
var
tmpResultCount
=
await
this
.
customQuery
(
dataCount
,
params
);
returnRes
.
total
=
tmpResultCount
&&
tmpResultCount
.
length
>
0
?
tmpResultCount
[
0
].
dataCount
:
0
;
var
result
=
system
.
getResultSuccess
(
returnRes
);
return
result
;
...
...
@@ -111,7 +127,8 @@ class MediaaggregationDao extends Dao {
*/
async
productTypeSecend
(
req
){
var
params
=
{
product_type_code
:
req
.
actionBody
.
product_type_code
product_type_code
:
req
.
actionBody
.
product_type_code
,
company_id
:
req
.
actionBody
.
company_id
};
var
returnRes
=
{
total
:
0
,
//总记录条数
...
...
@@ -133,7 +150,9 @@ class MediaaggregationDao extends Dao {
*/
async
productDetail
(
req
)
{
var
params
=
{
product_type_code
:
req
.
actionBody
.
product_type_code
product_type_code
:
req
.
actionBody
.
product_type_code
,
company_id
:
req
.
actionBody
.
company_id
};
var
sql
=
"select * from mc_product where deleted_at is null and product_type_code = :product_type_code"
;
var
list
=
await
this
.
customQuery
(
sql
,
params
);
...
...
@@ -145,8 +164,7 @@ class MediaaggregationDao extends Dao {
*/
async
bottomMenuConfig
(
req
)
{
var
params
=
{
// company_id: req.actionBody.company_id,
company_id
:
10
company_id
:
req
.
actionBody
.
company_id
};
var
returnRes
=
{
total
:
0
,
//总记录条数
...
...
@@ -163,14 +181,6 @@ class MediaaggregationDao extends Dao {
var
result
=
system
.
getResultSuccess
(
returnRes
);
return
result
;
}
/**
*方案一
*/
// async firstAction(){
// }
}
module
.
exports
=
MediaaggregationDao
;
\ No newline at end of file
gsb-marketplat/app/base/service/impl/mediaaggregation/mediaaggregationSve.js
View file @
9cdebda9
...
...
@@ -5,9 +5,9 @@ class MediaaggregationSve {
constructor
()
{
}
//
首页产品
列表
//
服务
列表
async
productList
(
pobj
)
{
if
(
!
pobj
||
!
pobj
.
actionBody
)
{
if
(
!
pobj
||
!
pobj
.
actionBody
||
!
pobj
.
actionBody
.
company_id
)
{
return
system
.
getResultFail
(
-
100
,
"参数错误"
);
}
var
res
=
await
mediaaggregationDao
.
productList
(
pobj
);
...
...
@@ -16,7 +16,7 @@ class MediaaggregationSve {
//首页轮播图
async
rotationChartList
(
pobj
)
{
if
(
!
pobj
||
!
pobj
.
actionBody
)
{
if
(
!
pobj
||
!
pobj
.
actionBody
||
!
pobj
.
actionBody
.
company_id
)
{
return
system
.
getResultFail
(
-
100
,
"参数错误"
);
}
...
...
@@ -25,7 +25,7 @@ class MediaaggregationSve {
}
//留资表单产品
async
needProductList
(
pobj
)
{
if
(
!
pobj
||
!
pobj
.
actionBody
)
{
if
(
!
pobj
||
!
pobj
.
actionBody
||
!
pobj
.
actionBody
.
company_id
)
{
return
system
.
getResultFail
(
-
100
,
"参数错误"
);
}
...
...
@@ -36,7 +36,7 @@ class MediaaggregationSve {
//热门推荐
async
popularRecommendationList
(
pobj
)
{
if
(
!
pobj
||
!
pobj
.
actionBody
)
{
if
(
!
pobj
||
!
pobj
.
actionBody
||
!
pobj
.
actionBody
.
company_id
)
{
return
system
.
getResultFail
(
-
100
,
"参数错误"
);
}
...
...
@@ -48,7 +48,7 @@ class MediaaggregationSve {
//产品分类一类
async
productTypeFirst
(
pobj
)
{
if
(
!
pobj
||
!
pobj
.
actionBody
)
{
if
(
!
pobj
||
!
pobj
.
actionBody
||
!
pobj
.
actionBody
.
company_id
)
{
return
system
.
getResultFail
(
-
100
,
"参数错误"
);
}
...
...
@@ -58,7 +58,7 @@ class MediaaggregationSve {
//产品分类二类
async
productTypeSecend
(
pobj
)
{
if
(
!
pobj
||
!
pobj
.
actionBody
)
{
if
(
!
pobj
||
!
pobj
.
actionBody
||
!
pobj
.
actionBody
.
product_type_code
||
!
pobj
.
actionBody
.
company_id
)
{
return
system
.
getResultFail
(
-
100
,
"参数错误"
);
}
...
...
@@ -67,7 +67,7 @@ class MediaaggregationSve {
}
//产品详情
async
productDetail
(
pobj
)
{
if
(
!
pobj
||
!
pobj
.
actionBody
)
{
if
(
!
pobj
||
!
pobj
.
actionBody
||
!
pobj
.
actionBody
.
product_type_code
)
{
return
system
.
getResultFail
(
-
100
,
"参数错误"
);
}
...
...
@@ -77,7 +77,7 @@ class MediaaggregationSve {
//吸底菜单
async
bottomMenuConfig
(
pobj
)
{
if
(
!
pobj
||
!
pobj
.
actionBody
)
{
if
(
!
pobj
||
!
pobj
.
actionBody
||
!
pobj
.
actionBody
.
company_id
)
{
return
system
.
getResultFail
(
-
100
,
"参数错误"
);
}
...
...
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