Explorar el Código

Correctif

refactoring
Guillaume Bourgeois hace 1 año
padre
commit
184f800aa9
Se han modificado 2 ficheros con 6 adiciones y 2 borrados
  1. +5
    -1
      common/logic/PointSale/UserPointSale/Repository/UserPointSaleRepository.php
  2. +1
    -1
      producer/controllers/OrderController.php

+ 5
- 1
common/logic/PointSale/UserPointSale/Repository/UserPointSaleRepository.php Ver fichero

@@ -33,8 +33,12 @@ class UserPointSaleRepository extends AbstractRepository
]);
}

public function findOneUserPointSale(User $user, PointSale $pointSale)
public function findOneUserPointSale(User $user = null, PointSale $pointSale = null)
{
if(!$user || !$pointSale) {
return null;
}

return UserPointSale::find()
->where([
'id_user' => $user->id,

+ 1
- 1
producer/controllers/OrderController.php Ver fichero

@@ -359,7 +359,7 @@ class OrderController extends ProducerBaseController
}

$userPointSale = $userPointSaleManager->findOneUserPointSale(GlobalParam::getCurrentUser(), $pointSale);
if ($pointSale->restricted_access && !$userPointSale) {
if ($pointSale && $pointSale->restricted_access && !$userPointSale) {
$errorPointSale = true;
}
}

Cargando…
Cancelar
Guardar