mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -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)) {
|
||||
$cFs = array_keys($cFs);
|
||||
|
||||
$cFIDs = array_map(function ($cF) {
|
||||
return ltrim($cF, 'cf');
|
||||
}, $cFs);
|
||||
|
||||
return app(CustomFieldRepositoryInterface::class)
|
||||
->newQuery()
|
||||
->whereIn('id', $cFs)
|
||||
->whereIn('id', $cFIDs)
|
||||
->get();
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
public function cFJSON()
|
||||
{
|
||||
return (array) json_decode($this->cf_json);
|
||||
}
|
||||
|
||||
// public function getCustomFieldEditId($id) {
|
||||
// $custom_field = AdvsCustomFieldsEntryModel::query()->where('advs_custom_fields.id', $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 cFJSON();
|
||||
|
||||
public function priceFormat($adv);
|
||||
|
||||
public function AddAdsDefaultCoverImage($ad);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user