mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-08 22:36:06 -06:00
#654 [customfields] Improvments
This commit is contained in:
parent
d7bdfcef5d
commit
b771f0bc9b
@ -387,15 +387,24 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
|
|||||||
if ($cFs = (array) json_decode($this->cf_json)) {
|
if ($cFs = (array) json_decode($this->cf_json)) {
|
||||||
$cFs = array_keys($cFs);
|
$cFs = array_keys($cFs);
|
||||||
|
|
||||||
|
$cFIDs = array_map(function ($cF) {
|
||||||
|
return ltrim($cF, 'cf');
|
||||||
|
}, $cFs);
|
||||||
|
|
||||||
return app(CustomFieldRepositoryInterface::class)
|
return app(CustomFieldRepositoryInterface::class)
|
||||||
->newQuery()
|
->newQuery()
|
||||||
->whereIn('id', $cFs)
|
->whereIn('id', $cFIDs)
|
||||||
->get();
|
->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function cFJSON()
|
||||||
|
{
|
||||||
|
return (array) json_decode($this->cf_json);
|
||||||
|
}
|
||||||
|
|
||||||
// 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();
|
||||||
|
|||||||
@ -60,6 +60,8 @@ interface AdvInterface extends EntryInterface
|
|||||||
|
|
||||||
public function customfields();
|
public function customfields();
|
||||||
|
|
||||||
|
public function cFJSON();
|
||||||
|
|
||||||
public function priceFormat($adv);
|
public function priceFormat($adv);
|
||||||
|
|
||||||
public function AddAdsDefaultCoverImage($ad);
|
public function AddAdsDefaultCoverImage($ad);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user