Просмотр исходного кода

[Administration] Problème crédit #1250

master
Guillaume Bourgeois 1 год назад
Родитель
Сommit
e3bd78a380
3 измененных файлов: 7 добавлений и 6 удалений
  1. +5
    -4
      backend/controllers/UserController.php
  2. +1
    -1
      common/logic/Payment/Model/CreditHistorySearch.php
  3. +1
    -1
      common/logic/User/UserProducer/Service/UserProducerBuilder.php

+ 5
- 4
backend/controllers/UserController.php Просмотреть файл

@@ -390,8 +390,9 @@ class UserController extends BackendController
*/
public function actionCredit(int $id)
{
$user = User::find()->with('userProducer')->where(['id' => $id])->one();
$userProducer = UserProducer::findOne(['id_user' => $id, 'id_producer' => GlobalParam::getCurrentProducerId()]);
$userManager = $this->getUserManager();
$user = $userManager->findOneUserById($id);
$userProducer = UserProducer::findOne(['id_user' => $id, 'id_producer' => $this->getProducerCurrent()->id]);

if (($userProducer) || $this->isUserCurrentAdmin()) {

@@ -401,14 +402,14 @@ class UserController extends BackendController
$creditForm->save();

$creditForm = new CreditForm;
$user = $userManager->findOneUserById($id);
}

$history = Payment::find()
->with(['order', 'userAction'])
->where([
'id_user' => $user->id,
'id_producer' => GlobalParam::getCurrentProducerId(),
'mean_payment' => MeanPayment::CREDIT
'id_producer' => $this->getProducerCurrent()->id,
])
->orderBy('date DESC')
->all();

+ 1
- 1
common/logic/Payment/Model/CreditHistorySearch.php Просмотреть файл

@@ -66,7 +66,7 @@ class CreditHistorySearch extends Payment
->innerJoinWith($optionsSearch['join_with'], true)
->where([
'payment.id_producer' => GlobalParam::getCurrentProducerId(),
'payment.mean_payment' => MeanPayment::CREDIT
//'payment.mean_payment' => MeanPayment::CREDIT
])
->orderBy('id DESC')
;

+ 1
- 1
common/logic/User/UserProducer/Service/UserProducerBuilder.php Просмотреть файл

@@ -64,7 +64,7 @@ class UserProducerBuilder extends AbstractBuilder

public function updateCredit(Payment $payment): void
{
if($this->paymentSolver->isMeanPaymentCredit($payment) && $payment->user) {
if($payment->user) {
$userProducer = $this->userProducerRepository->findOneUserProducer($payment->user);

if ($userProducer) {

Загрузка…
Отмена
Сохранить