Fixed issue #1325
This commit is contained in:
parent
46e3badf4d
commit
07be3c6a86
|
|
@ -93,7 +93,7 @@
|
|||
|
||||
<datetime :name="starts_from">
|
||||
<div class="control-group" :class="[errors.has('starts_from') ? 'has-error' : '']">
|
||||
<label for="starts_from" class="required">{{ __('admin::app.promotion.general-info.starts-from') }}</label>
|
||||
<label for="starts_from">{{ __('admin::app.promotion.general-info.starts-from') }}</label>
|
||||
|
||||
<input type="text" class="control" v-model="starts_from" name="starts_from" data-vv-as=""{{ __('admin::app.promotion.general-info.starts-from') }}"">
|
||||
|
||||
|
|
@ -103,7 +103,7 @@
|
|||
|
||||
<datetime :name="starts_from">
|
||||
<div class="control-group" :class="[errors.has('ends_till') ? 'has-error' : '']">
|
||||
<label for="ends_till" class="required">{{ __('admin::app.promotion.general-info.ends-till') }}</label>
|
||||
<label for="ends_till">{{ __('admin::app.promotion.general-info.ends-till') }}</label>
|
||||
|
||||
<input type="text" class="control" v-model="ends_till" name="ends_till" data-vv-as=""{{ __('admin::app.promotion.general-info.ends-till') }}"">
|
||||
|
||||
|
|
@ -260,7 +260,6 @@
|
|||
},
|
||||
|
||||
mounted () {
|
||||
console.log(this.attribute_input);
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@
|
|||
|
||||
<date :name="starts_from">
|
||||
<div class="control-group" :class="[errors.has('starts_from') ? 'has-error' : '']">
|
||||
<label for="starts_from" class="required">{{ __('admin::app.promotion.general-info.starts-from') }}</label>
|
||||
<label for="starts_from">{{ __('admin::app.promotion.general-info.starts-from') }}</label>
|
||||
|
||||
<input type="text" class="control" v-model="starts_from" name="starts_from" data-vv-as=""{{ __('admin::app.promotion.general-info.starts-from') }}"">
|
||||
|
||||
|
|
@ -107,7 +107,7 @@
|
|||
|
||||
<date :name="starts_from">
|
||||
<div class="control-group" :class="[errors.has('ends_till') ? 'has-error' : '']">
|
||||
<label for="ends_till" class="required">{{ __('admin::app.promotion.general-info.ends-till') }}</label>
|
||||
<label for="ends_till">{{ __('admin::app.promotion.general-info.ends-till') }}</label>
|
||||
|
||||
<input type="text" class="control" v-model="ends_till" name="ends_till" data-vv-as=""{{ __('admin::app.promotion.general-info.ends-till') }}"">
|
||||
|
||||
|
|
|
|||
|
|
@ -85,16 +85,42 @@ use Webkul\Core\Repositories\LocaleRepository as Locale;
|
|||
*/
|
||||
public function store()
|
||||
{
|
||||
$this->validate(request(), [
|
||||
'channels' => 'required',
|
||||
'locales' => 'required',
|
||||
'url_key' => 'required|unique:cms_pages,url_key',
|
||||
'html_content' => 'required|string',
|
||||
'page_title' => 'required|string',
|
||||
'meta_title' => 'required|string',
|
||||
'meta_description' => 'string',
|
||||
'meta_keywords' => 'required|string'
|
||||
]);
|
||||
$data = request()->all();
|
||||
|
||||
$channels = request()->input('channels');
|
||||
|
||||
$locales = request()->input('locales');
|
||||
|
||||
$urlKey = request()->input('url_key');
|
||||
|
||||
$ignorePageIDs = array();
|
||||
|
||||
foreach ($channels as $channel) {
|
||||
foreach ($locales as $locale) {
|
||||
$page = $this->cms->findOneWhere([
|
||||
'channel_id' => $channel,
|
||||
'locale_id' => $locale,
|
||||
'url_key' => $urlKey
|
||||
]);
|
||||
|
||||
if ($page) {
|
||||
array_push($ignorePageIDs, $page->id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (count($ignorePageIDs)) {
|
||||
$this->validate(request(), [
|
||||
'channels' => 'required',
|
||||
'locales' => 'required',
|
||||
'url_key' => 'required|unique:cms_pages,url_key,'.$ignorePageIDs,
|
||||
'html_content' => 'required|string',
|
||||
'page_title' => 'required|string',
|
||||
'meta_title' => 'required|string',
|
||||
'meta_description' => 'string',
|
||||
'meta_keywords' => 'required|string'
|
||||
]);
|
||||
}
|
||||
|
||||
$data = request()->all();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue