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
4d46a261
Commit
4d46a261
authored
Jun 25, 2020
by
王勇飞
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ic-deliver' of gitlab.gongsibao.com:jiangyong/zhichan into ic-deliver
parents
186ce0e4
a16251a1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
0 deletions
+49
-0
ic-deliver/app/base/api/impl/bizDeliver/bizChance.js
+22
-0
ic-deliver/app/base/controller/impl/bizchance/bizoptCtl.js
+1
-0
ic-deliver/app/base/db/dao.base.js
+18
-0
ic-deliver/app/base/service/impl/bizchance/bizoptSve.js
+4
-0
ic-deliver/app/base/test.js
+4
-0
No files found.
ic-deliver/app/base/api/impl/bizDeliver/bizChance.js
View file @
4d46a261
...
...
@@ -7,6 +7,28 @@ class BizChanceAPI extends APIBase {
this
.
bizChanceS
=
system
.
getObject
(
"service.bizchance.bizoptSve"
)
}
/**
* 按照服务商进行分组统计
* @param {*} p
* @param {*} q
* @param {*} req
*/
async
statBizChanceCountBySp
(
p
,
q
,
req
){
let
params
=
{}
params
.
group
=
{
byFields
:[
'facilitator_name'
],
actionType
:
'count'
,
aggField
:
'id'
,
aliasField
:
' as chanceCount'
,
tblName
:
'bussiness_opportunity'
,
where
:
''
,
having
:
''
,
}
let
rtn
=
await
this
.
bizChanceS
.
statBizChanceCountBySp
(
params
)
return
system
.
getResult
(
rtn
)
}
/**
* 待处理商机beforeSubmission
* 处理中商机 beforeConfirmation
*累计处理商机 包括成单和关闭
...
...
ic-deliver/app/base/controller/impl/bizchance/bizoptCtl.js
View file @
4d46a261
...
...
@@ -35,6 +35,7 @@ class BizOptCtl extends CtlBase {
robj
.
updated_at
=
this
.
timeFormat
(
element
.
updated_at
);
//商机当前状态日期
robj
.
servicerName
=
element
.
facilitator_name
;
robj
.
facilitator_name
=
element
.
facilitator_name
;
robj
.
sourceName
=
element
.
source_name
;
//渠道来源
rarr
.
push
(
robj
);
...
...
ic-deliver/app/base/db/dao.base.js
View file @
4d46a261
...
...
@@ -218,6 +218,24 @@ class Dao {
async
customExecAddOrPutSql
(
sql
,
paras
=
null
)
{
return
this
.
db
.
query
(
sql
,
paras
);
}
/**
* p.group.fields=['','']
* p.group.sumField=''
* p.group.aliasField=' as xxx'
* @param {*} p
*/
async
statGroupBy
(
p
,
paras
,
t
){
let
groupFields
=
p
.
group
.
byFields
.
join
(
","
)
let
aggField
=
p
.
group
.
aggField
?
p
.
group
.
aggField
:
''
let
tblName
=
p
.
group
.
tblName
?
p
.
group
.
tblName
:
''
let
where
=
p
.
group
.
where
?
p
.
group
.
where
:
''
let
having
=
p
.
group
.
having
?
p
.
group
.
having
:
''
let
aliasField
=
p
.
group
.
aliasField
?
p
.
group
.
aliasField
:
''
let
actionType
=
p
.
group
.
actionType
?
p
.
group
.
actionType
:
'count'
let
sql
=
`select
${
groupFields
}
,
${
actionType
}
(
${
aggField
}
)
${
aliasField
}
from
${
tblName
}
${
where
}
group by
${
groupFields
}
${
having
}
WITH ROLLUP`
return
this
.
customQuery
(
sql
,
paras
,
t
)
}
async
customQuery
(
sql
,
paras
,
t
)
{
var
tmpParas
=
null
;
//||paras=='undefined'?{type: this.db.QueryTypes.SELECT }:{ replacements: paras, type: this.db.QueryTypes.SELECT };
if
(
t
&&
t
!=
'undefined'
)
{
...
...
ic-deliver/app/base/service/impl/bizchance/bizoptSve.js
View file @
4d46a261
...
...
@@ -6,6 +6,10 @@ class BizOptService extends ServiceBase {
constructor
()
{
super
(
"bizchance"
,
ServiceBase
.
getDaoName
(
BizOptService
));
}
async
statBizChanceCountBySp
(
params
){
let
s
=
await
this
.
dao
.
statGroupBy
(
params
,
null
)
return
s
}
/**
* 公司id,平台公司ID为1
* @param {*} companyId
...
...
ic-deliver/app/base/test.js
View file @
4d46a261
let
s
=
[
'd'
,
'dx'
]
let
str
=
`
${
s
.
join
(
","
)}
`
console
.
log
(
str
)
\ No newline at end of file
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