mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-09-02 11:23:58 +00:00
Merge branch 'dillon/76-new-voucherify-voucher' into vapor/development
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class IsDisplay implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return Builder|mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->where('is_display', $value);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,7 +18,9 @@ class UpdatesVoucherCampaign extends AbstractUpdateRecord
|
||||
public function execute(VoucherCampaign $model, VoucherCampaignObject $object) {
|
||||
|
||||
$model->name = $object->getName();
|
||||
$model->description = $object->getDescription();
|
||||
if($object->getDescription()){
|
||||
$model->description = $object->getDescription();
|
||||
}
|
||||
$model->limit_per_month = $object->getLimitPerMonth();
|
||||
|
||||
return $this->handler($model);
|
||||
|
||||
@@ -24,6 +24,7 @@ class VoucherCampaignResource extends JsonResource
|
||||
// 'id' => $this->id,
|
||||
'campaign_id' => $this->campaign_id,
|
||||
'name' => $this->name,
|
||||
'slug' => $this->slug,
|
||||
'description' => $this->description,
|
||||
'limit_per_month' => $this->limit_per_month,
|
||||
'metadata' => $metadata
|
||||
|
||||
+2
-1
@@ -14,7 +14,8 @@
|
||||
<div class="col">
|
||||
<validation-wrapper-component selectable :validator="$v.voucherCode">
|
||||
<label>Voucher Options</label>
|
||||
<selectable-hard-coded-component section="rewardisActiveOptions" :selectable-options="options" v-model="voucherCode"></selectable-hard-coded-component >
|
||||
<!-- <selectable-hard-coded-component section="rewardisActiveOptions" :selectable-options="options" v-model="voucherCode"></selectable-hard-coded-component > -->
|
||||
<selectable-component :endpoint="route('api.voucher.campaigns.list') + '?filters=' + JSON.stringify({'is_display': 1})" :section="section" valueColumn="name" :labelColumn="['name', 'description']" v-model="voucherCode"></selectable-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
<div id="accordion">
|
||||
<div>
|
||||
<div class="row bg-white padding-10 m-b-10 rounded pointer" data-toggle="collapse" :data-target="'#collapse-' + data.campaign_id" aria-expanded="true" :aria-controls="'collapse-' + data.campaign_id">
|
||||
<div class="col-2 fs-12":id="'heading-' + data.campaign_id">{{data.name}}</div>
|
||||
<div class="col-2 fs-12":id="'heading-' + data.campaign_id">{{data.name}} : {{data.description}}</div>
|
||||
<div class="col-1 text-success text-center">{{data.metadata && data.metadata.length > 0 ? data.metadata[0].value : 0 }}</div>
|
||||
<div class="col-1 text-success text-center">{{data.metadata && data.metadata.length > 0 ? extractMonth(data.metadata[0].key) : '' }}</div>
|
||||
<div class="col-1 text-center">{{data.limit_per_month}}</div>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-8 bg-white p-l-25 p-r-25 p-t-15 p-b-15">
|
||||
<loading-component style="height: 200px; top: 0;" key="1" color="success" v-show="$store.getters.isLoading('rewardProfileSection')"></loading-component>
|
||||
<div class="row">
|
||||
<div class="row m-b-20">
|
||||
<div class="col">
|
||||
<voucher-campaigns-section-component></voucher-campaigns-section-component>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user