Your ROOT_URL in app.ini is http://167.99.32.63:3000/ but you are visiting http://167.99.32.63/ibrahim/BAGETWEBPANEL/blame/commit/5502e10312f1346e86a7121a4cdd08e66c54c696/app/CentralLogics/banner.php You should set ROOT_URL correctly, otherwise the web may not work correctly.

46 lines
1.4 KiB

2 years ago
<?php
namespace App\CentralLogics;
use App\Models\Banner;
use App\Models\Food;
use App\Models\Restaurant;
use App\CentralLogics\Helpers;
class BannerLogic
{
public static function get_banners($zone_id)
{
$banners = Banner::active()->whereIn('zone_id', $zone_id)->get();
$data = [];
foreach($banners as $banner)
{
if($banner->type=='restaurant_wise')
{
$restaurant = Restaurant::find($banner->data);
$data[]=[
'id'=>$banner->id,
'title'=>$banner->title,
'type'=>$banner->type,
'image'=>$banner->image,
'restaurant'=> $restaurant?Helpers::restaurant_data_formatting($restaurant, false):null,
'food'=>null
];
}
if($banner->type=='item_wise')
{
$food = Food::find($banner->data);
$data[]=[
'id'=>$banner->id,
'title'=>$banner->title,
'type'=>$banner->type,
'image'=>$banner->image,
'restaurant'=> null,
'food'=> $food?Helpers::product_data_formatting($food, false, false, app()->getLocale()):null,
];
}
}
return $data;
}
}