Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
android-remarketing
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘松
android-remarketing
Commits
4b4d92f4
Commit
4b4d92f4
authored
Apr 26, 2018
by
刘松
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix date
parent
c2442c60
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
index.js
api/index.js
+7
-3
No files found.
api/index.js
View file @
4b4d92f4
...
@@ -260,7 +260,7 @@ async function updateBill(data, callback) {
...
@@ -260,7 +260,7 @@ async function updateBill(data, callback) {
if
(
!
/^
[
0-9a-z
]{24}
$/
.
test
(
accountID
)
)
return
callback
(
'参数错误'
);
if
(
!
/^
[
0-9a-z
]{24}
$/
.
test
(
accountID
)
)
return
callback
(
'参数错误'
);
db
db
.
collection
(
'bills'
)
.
collection
(
'bills'
)
.
insert
(
wrapTime
({
pre
,
number
,
accountID
:
OID
(
accountID
),
type
,
taskID
:
OID
(
taskID
)
}),
(
err
,
rep
)
=>
{
.
insert
(
wrapTime
({
pre
,
number
,
accountID
:
OID
(
accountID
),
type
,
taskID
:
OID
(
taskID
)
}
,
true
),
(
err
,
rep
)
=>
{
if
(
err
)
return
callback
(
err
);
if
(
err
)
return
callback
(
err
);
callback
&&
callback
(
null
,
rep
);
callback
&&
callback
(
null
,
rep
);
});
});
...
@@ -346,8 +346,12 @@ function OID(str) {
...
@@ -346,8 +346,12 @@ function OID(str) {
return
typeof
str
===
'string'
?
mongodb
.
ObjectID
(
str
)
:
str
;
return
typeof
str
===
'string'
?
mongodb
.
ObjectID
(
str
)
:
str
;
}
}
function
wrapTime
(
obj
)
{
function
wrapTime
(
obj
,
date
)
{
return
_
.
merge
(
obj
,
{
createdAt
:
new
Date
()
})
let
d
=
{
createdAt
:
new
Date
()
};
if
(
date
)
{
d
.
date
=
moment
().
format
(
'YYYYMMDD'
);
}
return
_
.
merge
(
obj
,
d
)
}
}
async
function
getFromID
(
accountID
)
{
async
function
getFromID
(
accountID
)
{
...
...
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