Преглед изворни кода

[Administration] Problème crédit #1250

master
Guillaume Bourgeois пре 1 година
родитељ
комит
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) {

Loading…
Откажи
Сачувај