diff --git a/client/ticket/src/list/ticket-list.html b/client/ticket/src/list/ticket-list.html
index 9952267f0..51750d20a 100644
--- a/client/ticket/src/list/ticket-list.html
+++ b/client/ticket/src/list/ticket-list.html
@@ -1,4 +1,4 @@
-
+
diff --git a/services/loopback/common/methods/ticket/filter.js b/services/loopback/common/methods/ticket/filter.js
new file mode 100644
index 000000000..aaf46ec97
--- /dev/null
+++ b/services/loopback/common/methods/ticket/filter.js
@@ -0,0 +1,42 @@
+module.exports = Self => {
+ Self.installMethod('filter', filterParams);
+
+ function filterParams(params) {
+ let filters = {
+ where: {},
+ skip: (params.page - 1) * params.size,
+ limit: params.size,
+ order: params.order || 'created DESC'
+ };
+
+ delete params.page;
+ delete params.size;
+ delete params.order;
+
+ if (params.search) {
+ filters.where.and = [
+ {
+ or: [
+ {id: params.search},
+ {name: {regexp: params.search}}
+ ]
+ }
+ ];
+ delete params.search;
+ }
+
+ Object.keys(params).forEach(
+ key => {
+ if (filters.where.and) {
+ let filter = {};
+ filter[key] = (key === 'nickname') ? {regexp: params[key]} : params[key];
+ filters.where.and.push(filter);
+ } else {
+ filters.where[key] = (key === 'nickname') ? {regexp: params[key]} : params[key];
+ }
+ }
+ );
+
+ return filters;
+ }
+};
diff --git a/services/loopback/common/models/ticket.js b/services/loopback/common/models/ticket.js
index f390c559f..108ebc872 100644
--- a/services/loopback/common/models/ticket.js
+++ b/services/loopback/common/models/ticket.js
@@ -2,4 +2,5 @@
module.exports = function(Self) {
require('../methods/ticket/change-time.js')(Self);
require('../methods/ticket/change-worker.js')(Self);
+ require('../methods/ticket/filter.js')(Self);
};