mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-28 00:24:41 -06:00
#1893 [dress-theme] GG Anasayfa Giydirme
This commit is contained in:
parent
fba2ffed8f
commit
dcb368b4fe
@ -5,6 +5,7 @@ use Anomaly\Streams\Platform\Addon\AddonCollection;
|
|||||||
use Anomaly\Streams\Platform\Entry\EntryCriteria;
|
use Anomaly\Streams\Platform\Entry\EntryCriteria;
|
||||||
use Anomaly\Streams\Platform\Image\Image;
|
use Anomaly\Streams\Platform\Image\Image;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Visiosoft\AdvsModule\Adv\Contract\AdvRepositoryInterface;
|
||||||
use Visiosoft\RecentlyviewedadsModule\Recently\RecentlyModel;
|
use Visiosoft\RecentlyviewedadsModule\Recently\RecentlyModel;
|
||||||
use Visiosoft\SubscriptionsModule\User\UserModel;
|
use Visiosoft\SubscriptionsModule\User\UserModel;
|
||||||
|
|
||||||
@ -12,11 +13,17 @@ class AdvCriteria extends EntryCriteria
|
|||||||
{
|
{
|
||||||
|
|
||||||
private $image;
|
private $image;
|
||||||
|
private $advRepository;
|
||||||
|
|
||||||
public function __construct(SettingRepositoryInterface $repository, Image $image)
|
public function __construct(
|
||||||
|
SettingRepositoryInterface $repository,
|
||||||
|
Image $image,
|
||||||
|
AdvRepositoryInterface $advRepository
|
||||||
|
)
|
||||||
{
|
{
|
||||||
$this->settings = $repository;
|
$this->settings = $repository;
|
||||||
$this->image = $image;
|
$this->image = $image;
|
||||||
|
$this->advRepository = $advRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAdvsModel()
|
public function getAdvsModel()
|
||||||
@ -79,20 +86,7 @@ class AdvCriteria extends EntryCriteria
|
|||||||
|
|
||||||
public function findAdsByCategoryId($catId, $level = 1)
|
public function findAdsByCategoryId($catId, $level = 1)
|
||||||
{
|
{
|
||||||
$advModel = new AdvModel();
|
return $this->advRepository->getByCat($catId, $level);
|
||||||
$advs = AdvModel::query()
|
|
||||||
->whereDate('finish_at', '>=', date("Y-m-d H:i:s"))
|
|
||||||
->where('status', '=', 'approved')
|
|
||||||
->where('slug', '!=', '')
|
|
||||||
->where('cat' . $level, $catId)
|
|
||||||
->get();
|
|
||||||
|
|
||||||
$ads = $advModel->getLocationNames($advs);
|
|
||||||
foreach ($ads as $index => $ad) {
|
|
||||||
$ads[$index]->detail_url = $advModel->getAdvDetailLinkByModel($ad, 'list');
|
|
||||||
$ads[$index] = $advModel->AddAdsDefaultCoverImage($ad);
|
|
||||||
}
|
|
||||||
return $ads;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCurrentLocale()
|
public function getCurrentLocale()
|
||||||
|
|||||||
@ -405,6 +405,26 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
|
|||||||
return $ads;
|
return $ads;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getByCat($catID, $level = 1)
|
||||||
|
{
|
||||||
|
$advs = $this->model
|
||||||
|
->whereDate('finish_at', '>=', date("Y-m-d H:i:s"))
|
||||||
|
->where('status', 'approved')
|
||||||
|
->where('slug', '!=', '')
|
||||||
|
->where('cat' . $level, $catID)
|
||||||
|
->limit(20)
|
||||||
|
->get();
|
||||||
|
|
||||||
|
$ads = $this->model->getLocationNames($advs);
|
||||||
|
|
||||||
|
foreach ($ads as $index => $ad) {
|
||||||
|
$ads[$index]->detail_url = $this->model->getAdvDetailLinkByModel($ad, 'list');
|
||||||
|
$ads[$index] = $this->model->AddAdsDefaultCoverImage($ad);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $ads;
|
||||||
|
}
|
||||||
|
|
||||||
public function getCategoriesWithAdID($id)
|
public function getCategoriesWithAdID($id)
|
||||||
{
|
{
|
||||||
$adv = $this->model->find($id);
|
$adv = $this->model->find($id);
|
||||||
|
|||||||
@ -32,6 +32,8 @@ interface AdvRepositoryInterface extends EntryRepositoryInterface
|
|||||||
|
|
||||||
public function latestAds();
|
public function latestAds();
|
||||||
|
|
||||||
|
public function getByCat($catID, $level = 1);
|
||||||
|
|
||||||
public function getCategoriesWithAdID($id);
|
public function getCategoriesWithAdID($id);
|
||||||
|
|
||||||
public function extendAds($allAds, $isAdmin = false);
|
public function extendAds($allAds, $isAdmin = false);
|
||||||
|
|||||||
@ -216,6 +216,10 @@ class AdvsModuleServiceProvider extends AddonServiceProvider
|
|||||||
'as' => 'ajax::getAds',
|
'as' => 'ajax::getAds',
|
||||||
'uses' => 'Visiosoft\AdvsModule\Http\Controller\AjaxController@getMyAds'
|
'uses' => 'Visiosoft\AdvsModule\Http\Controller\AjaxController@getMyAds'
|
||||||
],
|
],
|
||||||
|
'ajax/get-advs-by-category/{categoryID}' => [
|
||||||
|
'as' => 'ajax::getAds',
|
||||||
|
'uses' => 'Visiosoft\AdvsModule\Http\Controller\AjaxController@getAdvsByCat'
|
||||||
|
],
|
||||||
'advs/extendAll/{isAdmin?}' => [
|
'advs/extendAll/{isAdmin?}' => [
|
||||||
'as' => 'advs::extendAll',
|
'as' => 'advs::extendAll',
|
||||||
'uses' => 'Visiosoft\AdvsModule\Http\Controller\AdvsController@extendAll',
|
'uses' => 'Visiosoft\AdvsModule\Http\Controller\AdvsController@extendAll',
|
||||||
|
|||||||
@ -85,4 +85,9 @@ class AjaxController extends PublicController
|
|||||||
|
|
||||||
return response()->json(['success' => true, 'content' => $my_advs, 'title' => $page_title]);
|
return response()->json(['success' => true, 'content' => $my_advs, 'title' => $page_title]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getAdvsByCat($categoryID, AdvRepositoryInterface $advRepository)
|
||||||
|
{
|
||||||
|
return $advRepository->getByCat($categoryID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user