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
0cdb75c6
Commit
0cdb75c6
authored
Feb 25, 2020
by
庄冰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
policy
parent
d89054b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
5 deletions
+26
-5
center-order/app/base/service/impl/dbpolicy/policysubscribeSve.js
+26
-5
No files found.
center-order/app/base/service/impl/dbpolicy/policysubscribeSve.js
View file @
0cdb75c6
...
...
@@ -78,17 +78,34 @@ class PolicysubscribeService extends ServiceBase {
}
paramObj
[
"openid"
]
=
obj
.
openid
;
var
resList
=
await
this
.
dao
.
model
.
findAll
({
attributes
:[
"id"
,
"policyProvince"
,
"policyTypes"
,
"created_at"
],
attributes
:[
"id"
,
"policyProvince"
,
"policyTypes"
,
"created_at"
,
"releaseDate"
],
where
:
paramObj
,
raw
:
true
,
order
:[[
"id"
,
"DESC"
]]
});
for
(
var
i
=
0
;
i
<
resList
.
length
;
i
++
){
var
ps
=
resList
[
i
];
var
whereObj
=
{
uapp_id
:
app
.
uapp_id
};
if
(
ps
.
policyProvince
&&
ps
.
policyProvince
!=
"全国"
){
whereObj
[
"policyProvince"
]
=
ps
.
policyProvince
;
}
if
(
ps
.
policyTypes
){
var
types
=
ps
.
policyTypes
.
split
(
","
);
whereObj
[
"policyType"
]
=
{
[
this
.
db
.
Op
.
in
]:
types
};
}
if
(
ps
.
releaseDate
){
whereObj
[
"created_at"
]
=
{
[
this
.
db
.
Op
.
gte
]:
ps
.
releaseDate
};
}
var
pis
=
await
this
.
policyinfoDao
.
model
.
findAll
({
where
:
whereObj
,
raw
:
true
,
attributes
:[
"id"
]
});
ps
.
dataCount
=
pis
?
pis
.
length
:
0
;
}
return
system
.
getResultSuccess
(
resList
);
}
//政策订阅检索列表
async
policySubscribeQuery
(
pobj
){
var
app
=
pobj
.
appInfo
;
var
obj
=
pobj
.
actionBody
;
var
paramObj
=
{
uapp_id
:
app
.
uapp_id
};
if
(
!
obj
.
openid
){
return
system
.
getResult
(
null
,
"openid不能为空"
);
}
...
...
@@ -103,20 +120,24 @@ class PolicysubscribeService extends ServiceBase {
return
system
.
getResult
(
null
,
"订阅信息不存在"
);
}
//{ where: { id: { [this.db.Op.in]: ids } } }
var
whereObj
=
{};
var
whereObj
=
{
uapp_id
:
app
.
uapp_id
};
var
attributes
=
[
"id"
,
"policyType"
,
"policyTypeName"
,
"policyDate"
,
"policyCity"
,
"policyProvince"
,
"policyLinkUrl"
,
"policySource"
,
"policyName"
,
"policyNo"
];
if
(
ps
.
policyProvince
){
if
(
ps
.
policyProvince
&&
ps
.
policyProvince
!=
"全国"
){
whereObj
[
"policyProvince"
]
=
ps
.
policyProvince
;
}
if
(
ps
.
policyTypes
){
var
types
=
ps
.
policyTypes
.
split
(
","
);
whereObj
[
"policyType"
]
=
{
[
this
.
db
.
Op
.
in
]:
types
};
}
var
pis
=
await
this
.
policyinfoDao
.
model
.
findAll
({
if
(
ps
.
releaseDate
){
whereObj
[
"created_at"
]
=
{
[
this
.
db
.
Op
.
gte
]:
ps
.
releaseDate
};
}
var
pis
=
await
this
.
policyinfoDao
.
model
.
findAll
({
//获取该订阅下的政策数据
where
:
whereObj
,
raw
:
true
,
attributes
:
attributes
,
order
:[[
"id"
,
"DESC"
]]
});
await
this
.
dao
.
update
({
id
:
obj
.
policySubscribeId
,
releaseDate
:
new
Date
()});
//修改订阅发布日期
return
system
.
getResultSuccess
(
pis
);
}
...
...
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