mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-24 23:13:59 +00:00
update honey trap with search
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class ReferenceLike implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return Builder|mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->where('reference', 'LIKE', '%'.$value.'%');
|
||||
}
|
||||
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
<template>
|
||||
<div class="row parentContainer" @keyup.enter="search">
|
||||
<div class="col">
|
||||
<div class="row m-b-15">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col p-r-0">
|
||||
<div class="form-group no-margin form-group-default b-rad-none">
|
||||
<!-- <label class="text-primary">Marking</label> -->
|
||||
<label class="font-heading all-caps fs-8 muted">Marking</label>
|
||||
<input type="text" class="form-control" v-model="marking" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto p-l-0 p-r-0">
|
||||
<div class="btn btn-primary b-rad-none" @click="search">
|
||||
<i class="fa fa-search lh-40"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto p-l-0">
|
||||
<div class="btn btn-secondary b-rad-none" @click="reset">
|
||||
<i class="fa fa-remove lh-40"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<list-component :key="currentKey" section="seasonalSegment" :endpoint="route('api.company.list')" :options="options">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<seasonal-segment-component :data="data"></seasonal-segment-component>
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import componentHandler from '../../../general/mixins/componentHandler';
|
||||
export default {
|
||||
data(){
|
||||
return {
|
||||
marking: '',
|
||||
currentKey: 1,
|
||||
options: {'per_page': 5, 'where_has_seasonal_segment': true},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
console.log('sd');
|
||||
this.options['reference_like'] = this.marking;
|
||||
console.log(this.options);
|
||||
this.currentKey+=1;
|
||||
},
|
||||
reset() {
|
||||
this.marking = '';
|
||||
delete(this.options['reference_like']);
|
||||
this.currentKey+=1;
|
||||
},
|
||||
},
|
||||
mixins: [componentHandler]
|
||||
}
|
||||
</script>
|
||||
@@ -318,11 +318,7 @@
|
||||
</div>
|
||||
<div class="row m-b-20">
|
||||
<div class="col">
|
||||
<list-component section="seasonalSegment" :endpoint="route('api.company.list')" :options="{'where_has_seasonal_segment': true}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<seasonal-segment-component :data="data"></seasonal-segment-component>
|
||||
</template>
|
||||
</list-component>
|
||||
<seasonal-segment-section-component></seasonal-segment-section-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user