|
|
@@ -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(); |