Browse Source

Merge tag 'hotfix_1250' into develop

hotfix_1250
feature/souke
Guillaume Bourgeois 1 year ago
parent
commit
5df1672f63
3 changed files with 7 additions and 6 deletions
  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 View File

*/ */
public function actionCredit(int $id) 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()) { if (($userProducer) || $this->isUserCurrentAdmin()) {


$creditForm->save(); $creditForm->save();


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


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

+ 1
- 1
common/logic/Payment/Model/CreditHistorySearch.php View File

->innerJoinWith($optionsSearch['join_with'], true) ->innerJoinWith($optionsSearch['join_with'], true)
->where([ ->where([
'payment.id_producer' => GlobalParam::getCurrentProducerId(), 'payment.id_producer' => GlobalParam::getCurrentProducerId(),
'payment.mean_payment' => MeanPayment::CREDIT
//'payment.mean_payment' => MeanPayment::CREDIT
]) ])
->orderBy('id DESC') ->orderBy('id DESC')
; ;

+ 1
- 1
common/logic/User/UserProducer/Service/UserProducerBuilder.php View File



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


if ($userProducer) { if ($userProducer) {

Loading…
Cancel
Save