<commit_before><?php
/**
 * Created by PhpStorm.
 * User: TuanPham
 * Date: 11/24/2016
 * Time: 6:20 PM
 */
use common\models\Product;
use kartik\grid\GridView;
use yii\helpers\Html;

?>
<?= GridView::widget([
    'dataProvider' => $dataProvider,
    'filterModel' => $searchModel,
    'columns' => [
        'id',
        [
            'class' => '\kartik\grid\DataColumn',
            'label' => 'Ảnh SP',
            'format' => 'raw',
            'value' => function ($model, $key, $index, $widget) {
                $link = Product::getFirstImageLinkTP(Product::findOne($model->product_id)->image);
                return $link ? Html::img($link, ['alt' => 'Thumbnail', 'width' => '50', 'height' => '50']) : '';
            },
        ],
        [
            'class' => '\kartik\grid\DataColumn',
            'attribute' => 'product_id',
            'format' => 'html',
            'value' => function ($model, $key, $index, $widget) {
                return Html::a(Product::findOne($model->product_id)->name, ['view', 'id' => $model->product_id], ['class' => 'label label-primary']);
            },
        ],
        [
            'class' => '\kartik\grid\DataColumn',
            'attribute' => 'price',
            'format' => 'html',
            'value' => function ($model, $key, $index, $widget) {
                return Product::formatNumber($model->price).' VND';
            },
        ],
        [
            'class' => '\kartik\grid\DataColumn',
            'attribute' => 'sale',<commit_msg>fix link view detail product when click form order view detail<commit_after><?php
/**
 * Created by PhpStorm.
 * User: TuanPham
 * Date: 11/24/2016
 * Time: 6:20 PM
 */
use common\models\Product;
use kartik\grid\GridView;
use yii\helpers\Html;

?>
<?= GridView::widget([
    'dataProvider' => $dataProvider,
    'filterModel' => $searchModel,
    'columns' => [
        'id',
        [
            'class' => '\kartik\grid\DataColumn',
            'label' => 'Ảnh SP',
            'format' => 'raw',
            'value' => function ($model, $key, $index, $widget) {
                $link = Product::getFirstImageLinkTP(Product::findOne($model->product_id)->image);
                return $link ? Html::img($link, ['alt' => 'Thumbnail', 'width' => '50', 'height' => '50']) : '';
            },
        ],
        [
            'class' => '\kartik\grid\DataColumn',
            'attribute' => 'product_id',
            'format' => 'html',
            'value' => function ($model, $key, $index, $widget) {
                return Html::a(Product::findOne($model->product_id)->name, ['product/view', 'id' => $model->product_id], ['class' => 'label label-primary']);
            },
        ],
        [
            'class' => '\kartik\grid\DataColumn',
            'attribute' => 'price',
            'format' => 'html',
            'value' => function ($model, $key, $index, $widget) {
                return Product::formatNumber($model->price).' VND';
            },
        ],
        [
            'class' => '\kartik\grid\DataColumn',
            'attribute' => 'sale',
{'fraction_non_alphanumeric': 0.1976630963972736, 'fraction_numerical': 0.009737098344693282, 'mean_word_length': 1.9577735124760076, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6252518', 'n_tokens_mistral': 979, 'n_tokens_neox': 948, 'n_words': 183}