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
c852001d
Commit
c852001d
authored
Jul 04, 2020
by
孙亚楠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
7420790e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
0 deletions
+51
-0
esign-sve-order/app/base/api/impl/op/action.js
+3
-0
esign-sve-order/app/base/db/impl/eorder/eorderDao.js
+18
-0
esign-sve-order/app/base/service/impl/eorder/eorderSve.js
+30
-0
No files found.
esign-sve-order/app/base/api/impl/op/action.js
View file @
c852001d
...
...
@@ -77,6 +77,9 @@ class ActionAPI extends APIBase {
case
"getMerchantLiveProduct"
:
// 查询商户下可用订单的产品
opResult
=
await
this
.
eorderSve
.
getMerchantLiveProduct
(
action_body
);
break
;
case
"getMerchantLiveAllProducts"
:
// 查询商户下所有的订单产品
opResult
=
await
this
.
eorderSve
.
getMerchantLiveAllProducts
(
action_body
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
...
...
esign-sve-order/app/base/db/impl/eorder/eorderDao.js
View file @
c852001d
...
...
@@ -105,5 +105,23 @@ class EorderDao extends Dao{
return
await
this
.
customQuery
(
sql
.
join
(
" "
),
{
merchantId
:
merchantId
});
}
/**
* fn:查询商户下所有订单的产产品
* @param merchant_id
* @returns {Promise<void>}
*/
async
getMerchantLiveAllProducts
(
merchant_id
){
let
sql
=
[];
sql
.
push
(
"SELECT"
);
sql
.
push
(
" t1.product_property, t1.product_id, t1.product_name"
);
sql
.
push
(
"FROM e_order_product t1"
);
sql
.
push
(
"INNER JOIN e_order t2 ON t1.order_id = t2.id"
);
sql
.
push
(
"WHERE t2.merchant_id = :merchant_id"
);
sql
.
push
(
"AND t2.live_status = '20' AND t2.engine_account_id <> ''"
);
sql
.
push
(
"ORDER BY t1.`created_at` ASC"
);
return
await
this
.
customQuery
(
sql
.
join
(
" "
),
{
merchant_id
:
merchant_id
});
}
}
module
.
exports
=
EorderDao
;
esign-sve-order/app/base/service/impl/eorder/eorderSve.js
View file @
c852001d
...
...
@@ -436,5 +436,34 @@ class EorderService extends ServiceBase {
let
res
=
await
this
.
dao
.
getMerchantLiveProduct
(
params
.
merchant_id
);
return
system
.
getResultSuccess
(
res
);
}
/**
* fn:查询商户下可用订单的产品(所有)
* @param params
* @returns {Promise<{msg: *, data, status: number}>}
*/
async
getMerchantLiveAllProducts
(
params
)
{
if
(
!
params
.
merchant_id
)
{
return
system
.
getResultSuccess
([]);
}
try
{
let
res
=
await
this
.
dao
.
getMerchantLiveAllProducts
(
params
.
merchant_id
);
let
map
=
{};
for
(
let
item
of
res
)
{
map
[
item
.
product_id
]
=
item
||
{};
}
let
arr
=
[];
for
(
let
ele
in
map
){
arr
.
push
(
map
[
ele
]);
}
return
system
.
getResultSuccess
(
arr
);
}
catch
(
e
)
{
console
.
log
(
e
);
system
.
getResult
(
null
,
`系统错误`
);
}
}
}
module
.
exports
=
EorderService
;
\ 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