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
e58bab2c
Commit
e58bab2c
authored
Jun 24, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
aa70fce0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
0 deletions
+48
-0
ic-deliver/app/base/api/impl/bizDeliver/bizChance.js
+22
-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 @
e58bab2c
...
@@ -7,6 +7,28 @@ class BizChanceAPI extends APIBase {
...
@@ -7,6 +7,28 @@ class BizChanceAPI extends APIBase {
this
.
bizChanceS
=
system
.
getObject
(
"service.bizchance.bizoptSve"
)
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
* 待处理商机beforeSubmission
* 处理中商机 beforeConfirmation
* 处理中商机 beforeConfirmation
*累计处理商机 包括成单和关闭
*累计处理商机 包括成单和关闭
...
...
ic-deliver/app/base/db/dao.base.js
View file @
e58bab2c
...
@@ -218,6 +218,24 @@ class Dao {
...
@@ -218,6 +218,24 @@ class Dao {
async
customExecAddOrPutSql
(
sql
,
paras
=
null
)
{
async
customExecAddOrPutSql
(
sql
,
paras
=
null
)
{
return
this
.
db
.
query
(
sql
,
paras
);
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
)
{
async
customQuery
(
sql
,
paras
,
t
)
{
var
tmpParas
=
null
;
//||paras=='undefined'?{type: this.db.QueryTypes.SELECT }:{ replacements: paras, type: this.db.QueryTypes.SELECT };
var
tmpParas
=
null
;
//||paras=='undefined'?{type: this.db.QueryTypes.SELECT }:{ replacements: paras, type: this.db.QueryTypes.SELECT };
if
(
t
&&
t
!=
'undefined'
)
{
if
(
t
&&
t
!=
'undefined'
)
{
...
...
ic-deliver/app/base/service/impl/bizchance/bizoptSve.js
View file @
e58bab2c
...
@@ -6,6 +6,10 @@ class BizOptService extends ServiceBase {
...
@@ -6,6 +6,10 @@ class BizOptService extends ServiceBase {
constructor
()
{
constructor
()
{
super
(
"bizchance"
,
ServiceBase
.
getDaoName
(
BizOptService
));
super
(
"bizchance"
,
ServiceBase
.
getDaoName
(
BizOptService
));
}
}
async
statBizChanceCountBySp
(
params
){
let
s
=
await
this
.
dao
.
statGroupBy
(
params
,
null
)
return
s
}
/**
/**
* 公司id,平台公司ID为1
* 公司id,平台公司ID为1
* @param {*} companyId
* @param {*} companyId
...
...
ic-deliver/app/base/test.js
View file @
e58bab2c
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