mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-24 22:11:01 -06:00
#654 [customfields] Improvments
This commit is contained in:
parent
321e793242
commit
aad685d795
@ -381,11 +381,6 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function customfields()
|
|
||||||
{
|
|
||||||
return $this->hasMany('Visiosoft\CustomfieldsModule\CustomFieldAdv\CustomFieldAdvModel', 'parent_adv_id', 'id');
|
|
||||||
}
|
|
||||||
|
|
||||||
// public function getCustomFieldEditId($id) {
|
// public function getCustomFieldEditId($id) {
|
||||||
// $custom_field = AdvsCustomFieldsEntryModel::query()->where('advs_custom_fields.id', $id)->first();
|
// $custom_field = AdvsCustomFieldsEntryModel::query()->where('advs_custom_fields.id', $id)->first();
|
||||||
// return DB::table('streams_assignments')->where('field_id', $custom_field->field_id)->first();
|
// return DB::table('streams_assignments')->where('field_id', $custom_field->field_id)->first();
|
||||||
|
|||||||
@ -58,8 +58,6 @@ interface AdvInterface extends EntryInterface
|
|||||||
|
|
||||||
public function saveCustomField($category_id, $field_id, $name);
|
public function saveCustomField($category_id, $field_id, $name);
|
||||||
|
|
||||||
public function customfields();
|
|
||||||
|
|
||||||
public function priceFormat($adv);
|
public function priceFormat($adv);
|
||||||
|
|
||||||
public function AddAdsDefaultCoverImage($ad);
|
public function AddAdsDefaultCoverImage($ad);
|
||||||
|
|||||||
@ -128,18 +128,6 @@ class AdvsController extends AdminController
|
|||||||
$newAdvOption->save();
|
$newAdvOption->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Replicate ad custom fields
|
|
||||||
$advCustomFields = $this->model->is_enabled('customfields');
|
|
||||||
if ($advCustomFields) {
|
|
||||||
$advCustomFields = app('Visiosoft\CustomfieldsModule\CustomFieldAdv\Contract\CustomFieldAdvRepositoryInterface')
|
|
||||||
->newQuery()->where('parent_adv_id', $advID)->get();
|
|
||||||
foreach ($advCustomFields as $advCustomField) {
|
|
||||||
$newaAdvCustomField = $advCustomField->replicate();
|
|
||||||
$newaAdvCustomField->parent_adv_id = $newAdv->id;
|
|
||||||
$newaAdvCustomField->save();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->messages->success(trans('visiosoft.module.advs::message.replicated_success'));
|
$this->messages->success(trans('visiosoft.module.advs::message.replicated_success'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user