Пример #1
0
 /**
  * Return the details of the reported restaurant
  * Used for the View popup
  *
  * @param $restaurant_id
  * @return View
  */
 public function viewRestaurantAction($restaurant_id)
 {
     $data = array();
     $restaurant = RestaurantsCms::find($restaurant_id)->toArray();
     if ($restaurant) {
         $boolean_columns = array('can_deliver', 'can_dinein', 'can_dineout', 'is_24hours', 'smoking', 'credit_card', 'status_close');
         foreach ($restaurant as $key => $value) {
             if (in_array($key, $boolean_columns)) {
                 if ($value === CONSTANTS::YES) {
                     $restaurant[$key] = 'Yes';
                 } elseif ($value === CONSTANTS::NO) {
                     $restaurant[$key] = 'No';
                 }
             }
             if ($key == 'status_verify') {
                 if ($value === CONSTANTS::STATUS_ACTIVE) {
                     $restaurant[$key] = 'Active';
                 } else {
                     $restaurant[$key] = 'Inactive';
                 }
             }
         }
         $data['restaurant'] = $restaurant;
     }
     return view('cms.reported.restaurants.view', $data);
 }