afisha repair

This commit is contained in:
Kerim 2023-01-04 01:27:40 +05:00
parent a1b44653ef
commit fc6a2eeea1
3 changed files with 8 additions and 17 deletions

View File

@ -32,7 +32,7 @@ class postsController extends Controller
'category' => input('category'),
'date' => input('date'),
'typePost' => input('typePost'),
'postGroup' => input('group'),
'postGroup' => empty(input('group')) ? null : input('group'),
'published' => true,
'featured' => input('featured') == true ? 1 : 0,
'select' => ['id','title','slug','published_at', 'more_photo', DB::raw("IF(featured_image<>'',concat('$path',featured_image),featured_image) as main_image")]

View File

@ -177,11 +177,11 @@ class Post extends Model
$fields->type_post->hidden = true;
}
if($this->category_groups->where('type', 'media')->count()){
$fields->video_file->hidden = false;
}else{
$fields->video_file->hidden = true;
}
// if($this->category_groups->where('type', 'media')->count()){
// $fields->video_file->hidden = false;
// }else{
// $fields->video_file->hidden = true;
// }
if($this->category_groups->where('type', 'afisha')->count()){
$fields->afisha_phone->hidden = false;
@ -492,13 +492,14 @@ class Post extends Model
*/
if ($postGroup !== null) {
// dd($categories);
// dd($postGroup);
$query->whereHas('category_groups', function($q) use ($postGroup) {
$q->where('slug', $postGroup);
});
}
if ($category !== null) {
$category = Category::find($category);
$categories = $category->getAllChildrenAndSelf()->lists('id');
if(!$categories){

View File

@ -142,22 +142,12 @@ secondaryTabs:
afisha_phone:
label: Afisha
span: left
hidden: 1
type: text
dependsOn: category_groups
tab: 'Category Group'
afisha_address:
label: 'Afisha Address'
span: left
hidden: 1
type: text
dependsOn: category_groups
tab: 'Category Group'
video_file:
label: 'Video File'
span: left
mode: file
hidden: 1
type: mediafinder
dependsOn: category_groups
tab: 'Category Group'