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
166207a7
Commit
166207a7
authored
May 08, 2020
by
王昆
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'bpo-channel' of gitlab.gongsibao.com:jiangyong/zhichan into bpo-channel
parents
9f172da1
3b49459b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
1 deletions
+62
-1
bpo-channel/app/base/api/impl/op/action.js
+4
-1
bpo-channel/app/base/service/impl/channel/channelmerchantSve.js
+58
-0
No files found.
bpo-channel/app/base/api/impl/op/action.js
View file @
166207a7
...
...
@@ -71,13 +71,16 @@ class ActionAPI extends APIBase {
case
"merchantSave"
:
opResult
=
await
this
.
channelmerchantSve
.
save
(
action_body
);
break
;
case
"merchantSaves"
:
opResult
=
await
this
.
channelmerchantSve
.
merchantSaves
(
action_body
);
break
;
case
"merchantPage"
:
opResult
=
await
this
.
channelmerchantSve
.
page
(
action_body
);
break
;
case
"getPushMerchantIds"
:
opResult
=
await
this
.
channelmerchantSve
.
getPushMerchantIds
(
action_body
);
break
;
//渠道绑定
case
"bindPlatform"
:
opResult
=
await
this
.
platformchannelService
.
bindPlatform
(
action_body
);
...
...
bpo-channel/app/base/service/impl/channel/channelmerchantSve.js
View file @
166207a7
...
...
@@ -53,6 +53,37 @@ class ChannelmerchantService extends ServiceBase {
}
async
merchantSaves
(
params
)
{
let
mcht
;
if
(
params
.
id
)
{
mcht
=
await
this
.
dao
.
findById
(
params
.
id
);
}
else
{
mcht
=
{};
}
let
origin
=
await
this
.
originDao
.
findById
(
params
.
origin_id
);
if
(
!
origin
)
{
return
system
.
getResult
(
null
,
"商户来源不存在"
);
}
mcht
.
origin_merchant_name
=
this
.
trim
(
params
.
origin_merchant_name
);
mcht
.
merchant_name
=
this
.
trim
(
params
.
merchant_name
);
mcht
.
contact_man
=
this
.
trim
(
params
.
contact_man
);
mcht
.
contact_mobile
=
this
.
trim
(
params
.
contact_mobile
);
mcht
.
contact_email
=
this
.
trim
(
params
.
contact_email
);
mcht
.
contact_addr
=
this
.
trim
(
params
.
contact_addr
);
if
(
mcht
.
id
)
{
await
mcht
.
save
();
}
else
{
mcht
.
channel_id
=
Number
(
params
.
channel_id
);
mcht
.
origin_id
=
10000
;
mcht
.
origin_merchant_id
=
params
.
origin_merchant_id
;
mcht
=
await
this
.
dao
.
create
(
mcht
);
}
return
system
.
getResultSuccess
(
mcht
);
}
async
page
(
params
)
{
let
currentPage
=
Number
(
params
.
currentPage
||
1
);
let
pageSize
=
Number
(
params
.
pageSize
||
10
);
...
...
@@ -71,6 +102,12 @@ class ChannelmerchantService extends ServiceBase {
[
this
.
db
.
Op
.
like
]:
"%"
+
params
.
merchant_name
+
"%"
};
}
if
(
params
.
types
==
1
){
where
.
origin_merchant_id
=
""
;
where
.
origin_merchant_name
=
""
;
}
let
orderby
=
[
[
"id"
,
'desc'
]
];
...
...
@@ -80,11 +117,32 @@ class ChannelmerchantService extends ServiceBase {
for
(
var
row
of
page
.
rows
)
{
this
.
handleDate
(
row
,
[
"created_at"
],
null
,
-
8
);
}
if
(
!
params
.
types
&&
params
.
types
==
0
){
await
this
.
setpage
(
page
)
}
await
this
.
setChannelInfo
(
page
.
rows
);
}
return
system
.
getResultSuccess
(
page
);
}
async
setpage
(
page
){
var
rows
=
page
.
rows
;
if
(
!
rows
||
rows
.
length
==
0
)
{
return
;
}
var
row
=
[];
for
(
var
i
=
0
;
i
<
rows
.
length
;
i
++
){
if
(
rows
[
i
].
origin_merchant_id
!=
""
){
row
.
push
(
rows
[
i
]);
}
}
page
.
rows
=
row
;
page
.
count
=
row
.
length
;
}
async
setChannelInfo
(
rows
)
{
if
(
!
rows
||
rows
.
length
==
0
)
{
return
;
...
...
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