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
5cec73bf
Commit
5cec73bf
authored
May 26, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
51915f05
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
bpo-web/app/base/db/impl/econtractDao.js
+20
-0
bpo-web/app/base/service/impl/econtractSve.js
+8
-0
No files found.
bpo-web/app/base/db/impl/econtractDao.js
View file @
5cec73bf
...
...
@@ -76,6 +76,26 @@ class EcontractDao extends Dao {
}
return
rs
;
}
async
countSignTimes
(
params
)
{
// idno, begin, end
let
sql
=
[];
sql
.
push
(
"SELECT COUNT(1) AS num FROM `c_econtract` t1"
);
sql
.
push
(
"INNER JOIN `p_user_eaccount` t2 ON t1.`usereaccount_id` = t2.`id`"
);
sql
.
push
(
"WHERE t2.`personsSign` = :idno"
);
if
(
params
.
begin
)
{
sql
.
push
(
"AND t1.`created_at` >= :begin"
);
}
if
(
params
.
end
)
{
sql
.
push
(
"AND t1.`created_at` <= :begin"
);
}
let
list
=
await
this
.
customQuery
(
sql
.
join
(
" "
),
params
);
if
(
!
list
||
list
.
length
==
0
)
{
return
0
;
}
return
list
[
0
].
num
||
0
;
}
}
module
.
exports
=
EcontractDao
;
bpo-web/app/base/service/impl/econtractSve.js
View file @
5cec73bf
...
...
@@ -1369,6 +1369,14 @@ class EcontractService extends ServiceBase {
});
}
let
begin
=
moment
().
subtract
(
30
,
"days"
).
format
(
"YYYY-MM-DD HH:mm:ss"
);
let
times
=
await
this
.
dao
.
countSignTimes
({
idno
:
eaccount
.
personsSign
,
begin
:
begin
})
||
0
;
if
(
times
>
5
)
{
let
timesMsg
=
`该用户[
${
eaccount
.
personsSign
}
]签约次数过多,30天内已经签约
${
times
}
次`
;
console
.
log
(
timesMsg
);
return
this
.
returnjson
(
-
1
,
timesMsg
);
}
// e签宝流程
if
(
isNeedCreate
)
{
var
uidStr
=
await
this
.
getUidStr
(
8
,
36
);
...
...
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