From ac665da9b29f5cfe9c095f7a7db08302889c6629 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 23 Mar 2023 14:47:46 +0500 Subject: [PATCH] from server --- .../controllers/api/postsController.php | 4 ++- .../modern2/partials/newHome/main-popular.htm | 2 +- .../modern2/partials/newHome/main-tender.htm | 17 +++---------- themes/modern2/partials/newHome/main.htm | 13 +++++++--- .../modern2/partials/newHome/popular-item.htm | 25 +++++++++++-------- .../partials/newHome/right-sidebar.htm | 2 +- 6 files changed, 33 insertions(+), 30 deletions(-) diff --git a/plugins/ahmadfatoni/apigenerator/controllers/api/postsController.php b/plugins/ahmadfatoni/apigenerator/controllers/api/postsController.php index 9cdcd9589..78cfce137 100644 --- a/plugins/ahmadfatoni/apigenerator/controllers/api/postsController.php +++ b/plugins/ahmadfatoni/apigenerator/controllers/api/postsController.php @@ -54,8 +54,10 @@ class postsController extends Controller //posts item public function show($locale,$id){ + $path = Config::get('app.cdn').Config::get('cms.storage.media.path'); + //$post = $this->Post::find($id,['id','content_html','author','slug', 'afisha_phone', 'afisha_address', 'afisha_phone_new']); + $post = $this->Post::where('id', $id)->select('id', 'content_html', 'author', 'title','slug','published_at', 'more_photo','afisha_phone', 'afisha_address', 'afisha_phone_new', DB::raw("IF(featured_image<>'',concat('$path',featured_image),featured_image) as main_image"))->with(['categories:id,name'])->first(); - $post = $this->Post::find($id,['id','content_html','author','slug', 'afisha_phone', 'afisha_address', 'afisha_phone_new',]); if(!is_null($post)) { diff --git a/themes/modern2/partials/newHome/main-popular.htm b/themes/modern2/partials/newHome/main-popular.htm index 1b873f7e8..32b088726 100644 --- a/themes/modern2/partials/newHome/main-popular.htm +++ b/themes/modern2/partials/newHome/main-popular.htm @@ -30,7 +30,7 @@ random = 0