mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-09 14:56:13 -06:00
Merge pull request #123 from openclassify/vedat
create custom field parent model
This commit is contained in:
commit
2e6ea0dda5
@ -467,6 +467,7 @@ class AdvsController extends PublicController
|
|||||||
}
|
}
|
||||||
if ($advModel->is_enabled('customfields')) {
|
if ($advModel->is_enabled('customfields')) {
|
||||||
|
|
||||||
|
$customField_model = new CustomFieldModel();
|
||||||
if ($adv->slug == "") {
|
if ($adv->slug == "") {
|
||||||
//new ads
|
//new ads
|
||||||
$jsonVal = [];
|
$jsonVal = [];
|
||||||
@ -476,7 +477,7 @@ class AdvsController extends PublicController
|
|||||||
for ($i = 1; $i < 7; $i++) {
|
for ($i = 1; $i < 7; $i++) {
|
||||||
$cat = 'cat' . $i;
|
$cat = 'cat' . $i;
|
||||||
if ($request->$cat != 0) {
|
if ($request->$cat != 0) {
|
||||||
$findcustomfields = CustomfieldsCustomFieldsEntryModel::query()->where('parent_category', $request->$cat)->get();
|
$findcustomfields = $customField_model->getCustomfieldsJoinCategoryWithCategoryID($cat);
|
||||||
foreach ($findcustomfields as $findcustomfield) {
|
foreach ($findcustomfields as $findcustomfield) {
|
||||||
$cs_name = 'cf__' . $findcustomfield->slug;
|
$cs_name = 'cf__' . $findcustomfield->slug;
|
||||||
$cf_id = "cf" . $findcustomfield->id;
|
$cf_id = "cf" . $findcustomfield->id;
|
||||||
@ -497,7 +498,7 @@ class AdvsController extends PublicController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$findcustomfields = CustomfieldsCustomFieldsEntryModel::query()->whereNull('parent_category')->get();
|
$findcustomfields = $customField_model->getCustomfieldsJoinCategoryWithCategoryID();
|
||||||
foreach ($findcustomfields as $findcustomfield) {
|
foreach ($findcustomfields as $findcustomfield) {
|
||||||
$cs_name = 'cf__' . $findcustomfield->slug;
|
$cs_name = 'cf__' . $findcustomfield->slug;
|
||||||
$cf_id = "cf" . $findcustomfield->id;
|
$cf_id = "cf" . $findcustomfield->id;
|
||||||
@ -525,7 +526,7 @@ class AdvsController extends PublicController
|
|||||||
for ($i = 1; $i < 7; $i++) {
|
for ($i = 1; $i < 7; $i++) {
|
||||||
$cat = 'cat' . $i;
|
$cat = 'cat' . $i;
|
||||||
if ($request->$cat != 0) {
|
if ($request->$cat != 0) {
|
||||||
$findcustomfields = CustomfieldsCustomFieldsEntryModel::query()->where('parent_category', $request->$cat)->get();
|
$findcustomfields = $customField_model->getCustomfieldsJoinCategoryWithCategoryID($cat);
|
||||||
foreach ($findcustomfields as $findcustomfield) {
|
foreach ($findcustomfields as $findcustomfield) {
|
||||||
|
|
||||||
$cs_name = 'cf__' . $findcustomfield->slug;
|
$cs_name = 'cf__' . $findcustomfield->slug;
|
||||||
@ -549,7 +550,7 @@ class AdvsController extends PublicController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$findcustomfields = CustomfieldsCustomFieldsEntryModel::query()->whereNull('parent_category')->get();
|
$findcustomfields = $customField_model->getCustomfieldsJoinCategoryWithCategoryID();
|
||||||
foreach ($findcustomfields as $findcustomfield) {
|
foreach ($findcustomfields as $findcustomfield) {
|
||||||
|
|
||||||
$cs_name = 'cf__' . $findcustomfield->slug;
|
$cs_name = 'cf__' . $findcustomfield->slug;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user