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
c2f27471
Commit
c2f27471
authored
Feb 22, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
1c29c073
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
11 deletions
+31
-11
center-order/app/base/service/impl/dbcorder/orderinfoSve.js
+31
-11
No files found.
center-order/app/base/service/impl/dbcorder/orderinfoSve.js
View file @
c2f27471
...
...
@@ -209,27 +209,47 @@ class OrderInfoService extends ServiceBase {
var
pageIndex
=
Number
(
actionBody
.
pageIndex
||
1
);
var
from
=
pageIndex
==
1
?
0
:
Number
((
pageIndex
-
1
)
*
pageSize
);
var
sql
=
"select `orderNo`,`channelServiceNo`,`channelOrderNo`,`channelUserId`,`ownerUserId`,`payTime`,`quantity`,`serviceQuantity`,`orderStatusName`,`orderStatus`,`totalSum`,`payTotalSum`,`refundSum`,`invoiceApplyStatus`,`opNotes`,`channelItemCode`,`channelItemName`,`serviceItemCode`,`picUrl`"
+
" from v_order where uapp_id="
+
pobj
.
appInfo
.
uapp_id
+
" and channelUserId="
+
pobj
.
userInfo
.
channel_userid
;
var
sqlCount
=
"select count(1) as dataCount from v_order where uapp_id="
+
pobj
.
appInfo
.
uapp_id
+
" and channelUserId="
+
pobj
.
userInfo
.
channel_userid
;
var
paramWhere
=
{};
var
sql
=
"select `orderNo`,`channelServiceNo`,`channelOrderNo`,`channelUserId`,`ownerUserId`,`payTime`,`quantity`,`serviceQuantity`,`orderStatusName`,`orderStatus`,`totalSum`,`payTotalSum`,`refundSum`,"
+
" `invoiceApplyStatus`,`opNotes`,`channelItemCode`,`channelItemName`,`serviceItemCode`,`picUrl`,created_at from v_order where uapp_id=:uapp_id"
;
var
sqlCount
=
"select count(1) as dataCount from v_order where uapp_id=:uapp_id"
;
paramWhere
.
uapp_id
=
pobj
.
appInfo
.
uapp_id
;
if
(
pobj
.
userInfo
.
channel_userid
)
{
sql
+=
" and channelUserId=:channelUserId"
;
sqlCount
+=
" and channelUserId=:channelUserId"
;
paramWhere
.
channelUserId
=
pobj
.
userInfo
.
channel_userid
;
}
if
(
actionBody
.
channelItemName
)
{
sql
+=
" and channelItemName like '%"
+
actionBody
.
channelItemName
+
"%'"
;
sqlCount
+=
" and channelItemName like '%"
+
actionBody
.
channelItemName
+
"%'"
;
sql
+=
" and channelItemName like :channelItemName"
;
sqlCount
+=
" and channelItemName like :channelItemName"
;
paramWhere
.
channelItemName
=
"%"
+
params
.
channelItemName
.
trim
()
+
"%"
;
}
if
(
actionBody
.
channelServiceNo
)
{
sql
+=
" and channelServiceNo like '%"
+
actionBody
.
channelServiceNo
+
"%'"
;
sqlCount
+=
" and channelServiceNo like '%"
+
actionBody
.
channelServiceNo
+
"%'"
;
sql
+=
" and channelServiceNo like :channelServiceNo"
;
sqlCount
+=
" and channelServiceNo like :channelServiceNo"
;
paramWhere
.
channelServiceNo
=
"%"
+
actionBody
.
channelServiceNo
.
trim
()
+
"%"
;
}
if
(
actionBody
.
orderStatus
)
{
sql
+=
" and orderStatus ='"
+
actionBody
.
orderStatus
+
"'"
;
sqlCount
+=
" and orderStatus ='"
+
actionBody
.
orderStatus
+
"'"
;
sql
+=
" and orderStatus=:orderStatus"
;
sqlCount
+=
" and orderStatus=:orderStatus"
;
paramWhere
.
orderStatus
=
actionBody
.
orderStatus
;
}
if
(
params
.
startTime
&&
params
.
entTime
)
{
var
startTime
=
actionBody
.
startTime
.
trim
()
+
" 00:00:00"
;
var
entTime
=
actionBody
.
entTime
+
" 23:59:59"
;
sql
+=
" and created_at >=:startTime and created_at<=:entTime"
;
sqlCount
+=
" and created_at >=:startTime and created_at<=:entTime"
;
paramWhere
.
startTime
=
startTime
;
paramWhere
.
entTime
=
entTime
;
}
sql
+=
" LIMIT "
+
pageSize
+
" OFFSET "
+
from
;
var
list
=
await
this
.
customQuery
(
sql
);
var
list
=
await
this
.
customQuery
(
sql
,
paramWhere
);
var
result
=
system
.
getResultSuccess
(
list
);
var
tmpResultCount
=
await
this
.
customQuery
(
sqlCount
);
var
tmpResultCount
=
await
this
.
customQuery
(
sqlCount
,
paramWhere
);
result
.
dataCount
=
tmpResultCount
&&
tmpResultCount
.
length
>
0
?
tmpResultCount
[
0
].
dataCount
:
0
;
...
...
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