瀏覽代碼

[Administration] Utilisateur > édition : correctifs erreur accès UserPointSale

feature/souke
Guillaume Bourgeois 1 年之前
父節點
當前提交
6b64f1e340
共有 2 個文件被更改,包括 7 次插入5 次删除
  1. +6
    -4
      backend/controllers/UserController.php
  2. +1
    -1
      common/logic/User/UserProducer/Repository/UserProducerRepository.php

+ 6
- 4
backend/controllers/UserController.php 查看文件

@@ -307,15 +307,17 @@ class UserController extends BackendController
public function processLinkPointSale(User $modelUser)
{
$posts = Yii::$app->request->post();
$userPointSaleManager = $this->getUserPointSaleManager();
$pointSaleManager = $this->getPointSaleManager();

UserPointSale::deleteAll([
'id_user' => $modelUser->id
]);
if (is_array($modelUser->points_sale) && count($modelUser->points_sale) > 0) {
foreach ($modelUser->points_sale as $pointSaleId) {
$userPointSale = UserPointSale::searchOne([
'id_user' => $modelUser->id,
'id_point_sale' => $pointSaleId
]);
$pointSale = $pointSaleManager->findOnePointSaleById($pointSaleId);
$userPointSale = $userPointSaleManager->findOneUserPointSale($modelUser, $pointSale);

if (!$userPointSale) {
$userPointSale = new UserPointSale;
$userPointSale->id_user = $modelUser->id;

+ 1
- 1
common/logic/User/UserProducer/Repository/UserProducerRepository.php 查看文件

@@ -35,7 +35,7 @@ class UserProducerRepository extends AbstractRepository

public function findUserProducersByUser(User $user, bool $active = true, bool $bookmark = true)
{
return $this->createDefaultQuery()
return $this->createQuery()
->filterByUser($user)
->filterByActive($active)
->filterByBookmark($bookmark)

Loading…
取消
儲存