mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-24 22:11:01 -06:00
create recommended function
This commit is contained in:
parent
fc8d7d1e24
commit
f97fd8eff5
@ -339,4 +339,17 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
|
|||||||
$ad = $this->find($id);
|
$ad = $this->find($id);
|
||||||
$ad->update(['count_show_ad' => intval($ad->count_show_ad) + 1]);
|
$ad->update(['count_show_ad' => intval($ad->count_show_ad) + 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getRecommended($id)
|
||||||
|
{
|
||||||
|
$adv = $this->find($id);
|
||||||
|
if (!is_null($adv)) {
|
||||||
|
return $this->where('advs_advs.slug', '!=', "")
|
||||||
|
->where('advs_advs.status', 'approved')
|
||||||
|
->where('advs_advs.id','!=', $id)
|
||||||
|
->where('advs_advs.finish_at', '>', date('Y-m-d H:i:s'))
|
||||||
|
->where('advs_advs.cat1', $adv->cat1)->get();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user