瀏覽代碼

Corrections bugs crédit pain

prodstable
keun 7 年之前
父節點
當前提交
09b39570d5
共有 3 個檔案被更改,包括 4 行新增3 行删除
  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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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',

Loading…
取消
儲存