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
3627fa82
Commit
3627fa82
authored
May 28, 2020
by
孙亚楠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
acb6a3d9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
11 deletions
+21
-11
xggsve-merchant/app/base/db/impl/channel/saaschannelDao.js
+10
-0
xggsve-merchant/app/base/service/impl/channel/saaschannelSve.js
+11
-11
No files found.
xggsve-merchant/app/base/db/impl/channel/saaschannelDao.js
View file @
3627fa82
...
@@ -35,5 +35,15 @@ class SaasChannelDao extends Dao {
...
@@ -35,5 +35,15 @@ class SaasChannelDao extends Dao {
saasId
:
saasId
saasId
:
saasId
});
});
}
}
async
findDics
(
params
){
let
sql
=
[];
sql
.
push
(
"select * from saas_channel where 1=1"
);
if
(
params
.
name
){
params
.
nameLike
=
`%
${
params
.
name
}
%`
;
sql
.
push
(
"and name like :nameLike"
);
}
return
await
this
.
customQuery
(
sql
.
join
(
" "
),
params
);
}
}
}
module
.
exports
=
SaasChannelDao
;
module
.
exports
=
SaasChannelDao
;
xggsve-merchant/app/base/service/impl/channel/saaschannelSve.js
View file @
3627fa82
...
@@ -8,14 +8,16 @@ class SaasChannelService extends ServiceBase {
...
@@ -8,14 +8,16 @@ class SaasChannelService extends ServiceBase {
// -----------------------以此间隔,上面为API,下面为service---------------------------------
// -----------------------以此间隔,上面为API,下面为service---------------------------------
async
dics
(
params
)
{
async
dics
(
params
)
{
let
saas_id
=
Number
(
this
.
trim
(
params
.
saas_id
)
||
0
);
try
{
if
(
!
saas_id
)
{
let
list
=
await
this
.
dao
.
findDics
(
params
);
return
system
.
getResultSuccess
([]);
return
system
.
getResult
(
list
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResult
(
null
,
`系统错误`
)
}
}
let
list
=
await
this
.
dao
.
bySaasId
(
Number
(
params
.
saas_id
),
"id, name, short_name"
);
return
system
.
getResultSuccess
(
list
);
}
}
async
info
(
params
)
{
async
info
(
params
)
{
if
(
!
params
.
id
)
{
if
(
!
params
.
id
)
{
return
system
.
getResult
(
null
,
"id不存在"
);
return
system
.
getResult
(
null
,
"id不存在"
);
...
@@ -160,17 +162,15 @@ class SaasChannelService extends ServiceBase {
...
@@ -160,17 +162,15 @@ class SaasChannelService extends ServiceBase {
async
pageByCondition
(
params
)
{
async
pageByCondition
(
params
)
{
var
currentPage
=
Number
(
params
.
currentPage
||
0
);
var
currentPage
=
Number
(
params
.
currentPage
||
0
);
var
pageSize
=
Number
(
params
.
pageSize
||
10
);
var
pageSize
=
Number
(
params
.
pageSize
||
10
);
var
where
=
{};
var
where
=
{
if
(
params
.
saas_id
){
saas_id
:
params
.
saas_id
,
where
.
saas_id
=
params
.
saas_id
;
};
}
if
(
params
.
name
)
{
if
(
params
.
name
)
{
where
.
name
=
{
where
.
name
=
{
[
this
.
db
.
Op
.
like
]:
"%"
+
params
.
name
+
"%"
[
this
.
db
.
Op
.
like
]:
"%"
+
params
.
name
+
"%"
};
};
}
}
// this.addWhereTime(where, 'created_at', params.createdBegin, params.createdEnd, true);
// this.addWhereTime(where, 'created_at', params.createdBegin, params.createdEnd, true);
var
orderby
=
[
var
orderby
=
[
[
"id"
,
'desc'
]
[
"id"
,
'desc'
]
...
...
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