add customer ticket statistics

This commit is contained in:
2015-11-06 17:10:25 +01:00
parent b3dd9f67e8
commit 2654a501db
8 changed files with 284 additions and 23 deletions

View File

@@ -2,6 +2,7 @@
use yii\helpers\Html;
use yii\grid\GridView;
use yii\helpers\Url;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\CustomerSearch */
@@ -24,30 +25,31 @@ $this->params['breadcrumbs'][] = $this->title;
'columns' => [
[
'attribute' => 'customerCardNumber' ,
// 'value' => 'customerCardNumber'
],
// 'id_user',
// 'id_partner_card',
// 'id_proposer',
'name',
'email:email',
// 'password',
'phone',
// 'sex',
// 'date_stundent_card_expire',
// 'birthdate',
// 'image',
// 'description',
// 'tax_number',
// 'country',
// 'zip',
// 'city',
// 'address',
'created_at:datetime',
// 'updated_at',
['class' => 'yii\grid\ActionColumn',
'template' =>'{view}{update}'
'template' =>'{view} {update} {ticket/index-customer}',
'buttons' => [
'ticket/index-customer' => function ($url) { return Html::a( '<span class="glyphicon glyphicon-list-alt"> </span>', $url, [ 'title' => 'Bérletek' ] ); }
],
'urlCreator' =>function ($action, $model, $key, $index){
$params = is_array($key) ? $key : ['id' => (string) $key];
if ( $action == 'ticket/index-customer' ){
$today = \Yii::$app->formatter->asDate( strtotime('today UTC') );
$tomorrow = \Yii::$app->formatter->asDate( strtotime( 'tomorrow UTC' ));
$params['TicketSearch[start]'] = $today;
$params['TicketSearch[end]'] = $tomorrow;
}
$params[0] = $action;
return Url::toRoute($params);
}
],
],