Parcourir la source

Corrections bugs crédit pain

master
keun il y a 7 ans
Parent
révision
09b39570d5
3 fichiers modifiés avec 4 ajouts et 3 suppressions
  1. +1
    -1
      backend/controllers/UserController.php
  2. +1
    -1
      backend/views/user/credit.php
  3. +2
    -1
      backend/views/user/index.php

+ 1
- 1
backend/controllers/UserController.php Voir le fichier

@@ -74,7 +74,7 @@ class UserController extends BackendController
]);
$etablissement = Etablissement::find()
->where(['id' => Yii::$app->user->identity->id])
->where(['id' => Yii::$app->user->identity->id_etablissement])
->one() ;
return $this->render('index', [

+ 1
- 1
backend/views/user/credit.php Voir le fichier

@@ -16,7 +16,7 @@ $this->params['breadcrumbs'][] = 'Créditer';
<?php
$etablissement = Etablissement::find()
->where(['id' => Yii::$app->user->identity->id])
->where(['id' => Yii::$app->user->identity->id_etablissement])
->one() ;
if(!$etablissement->credit_pain)
{

+ 2
- 1
backend/views/user/index.php Voir le fichier

@@ -113,8 +113,9 @@ $this->params['breadcrumbs'][] = $this->title;
'format' => 'raw',
'value' => function($model) use($etablissement) {
if(!isset($model['credit'])) $model['credit'] = 0 ;
$user = User::findOne($model['user_id']) ;
$html = '<div class="input-group">
<input type="text" class="form-control input-credit" readonly="readonly" value="'.number_format($model['credit'],2).' €" placeholder="">
<input type="text" class="form-control input-credit" readonly="readonly" value="'.number_format($user->getCredit($etablissement->id),2).' €" placeholder="">
<span class="input-group-btn">
'.Html::a(
'<span class="glyphicon glyphicon-euro"></span> Crédit',

Chargement…
Annuler
Enregistrer