瀏覽代碼

Correctif

refactoring
Guillaume Bourgeois 1 年之前
父節點
當前提交
184f800aa9
共有 2 個文件被更改,包括 6 次插入2 次删除
  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 查看文件

@@ -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 查看文件

@@ -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;
}
}

Loading…
取消
儲存