Merge branch 'honey-trap' of gitlab.com:CIEFWorldwideSdnBhd/exchange-2.0 into development

This commit is contained in:
edmondlang
2023-03-20 23:18:38 +08:00
5 changed files with 84 additions and 7 deletions
@@ -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.'%');
}
}
@@ -65,7 +65,7 @@ class AssignCompanyToSegmentLogic extends AbstractControllerLogic
if ($request->input('ending_on')) {
if ($request->input('ending_on') && $request->input('ending_on') <= Carbon::now()) {
if ($request->input('ending_on') && Carbon::parse($request->input('ending_on')) <= Carbon::now()) {
throw new MalformedRequestException('The Ending Date must be equal to or later than today\'s date.');
}
@@ -57,7 +57,7 @@ class RemoveCompanyFromSegmentLogic extends AbstractControllerLogic
$segment = $this->fetchesSegment->execute(['id' => $request->route('segment_id')]);
$company->seasonalSegments()->where('id', $request->route('segment_id'))->delete();
$company->seasonalSegments()->where('segment_id', $request->route('segment_id'))->delete();
$this->removesCompanyFromSegment->execute($company, $segment);
@@ -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>
+1 -5
View File
@@ -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>