This repository was archived by the owner on Oct 30, 2023. It is now read-only.
File tree 2 files changed +16
-2
lines changed
service/src/services/dflowzdata
2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -313,7 +313,8 @@ export default {
313
313
$limit: this .limit ,
314
314
' _currentStatus' : true ,
315
315
' _state' : this .$route .params .stateid ,
316
- ' id[$search]' : ' ^' + query .text
316
+ // 'id[$search]': '^' + query.text
317
+ ' $search' : query .text
317
318
}, heads)
318
319
.then (res => {
319
320
this .isFlowzLoaded = true
@@ -375,6 +376,7 @@ export default {
375
376
// })
376
377
},
377
378
sortData (object ) {
379
+ // console.log('object')
378
380
},
379
381
emailService (item ) {
380
382
this .isEmailDone = true
Original file line number Diff line number Diff line change @@ -60,11 +60,23 @@ let beforeFind = function (hook) {
60
60
const query = hook . service . service . createQuery ( hook . params . query ) ;
61
61
hook . params . rethinkdb = query . group ( value )
62
62
}
63
+ if ( query . $search !== undefined ) {
64
+ hook . service . service . options . name = hook . params . headers . ftablename ;
65
+ hook . service . service . table = hook . service . rDB . table ( hook . params . headers . ftablename ) ;
66
+ let value = hook . params . query . $search
67
+ delete hook . params . query . $search
68
+ const query = hook . service . service . createQuery ( hook . params . query ) ;
69
+ // hook.params.rethinkdb = query.group(value)
70
+ hook . params . rethinkdb = query . filter ( function ( doc ) {
71
+ return doc . coerceTo ( 'string' ) . match ( '(?i)' + value ) ;
72
+ } )
73
+ // console.log('hook.params.rethinkdb', hook.params.rethinkdb)
74
+ }
63
75
}
64
76
65
77
function beforeCreate ( hook ) {
66
78
try {
67
- console . log ( 'before create ================================' , hook . params )
79
+ // console.log('before create ================================', hook.params)
68
80
hook . params . done = true
69
81
if ( hook . params . headers . ftablename !== undefined && hook . data . _state !== undefined ) {
70
82
let regex = / _ / g
You can’t perform that action at this time.
0 commit comments