| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 | 
							- <?php
 
- use common\models\Space;
 
- use yii\helpers\Html;
 
- use yii\grid\GridView;
 
- use yii\helpers\Url;
 
- /* @var $this yii\web\View */
 
- /* @var $searchModel backend\models\search\SpaceSearch */
 
- /* @var $dataProvider yii\data\ActiveDataProvider */
 
- $this->title = Yii::t('common', 'Spaces');
 
- $this->params['breadcrumbs'][] = $this->title;
 
- ?>
 
- <?php $this->beginBlock('content-header') ?>
 
- <?= $this->title . ' ' . Html::a(Yii::t('common', 'Create Space'), ['create'], ['class' => 'btn btn-success']) ?>
 
- <?php $this->endBlock() ?>
 
- <?php echo $this->render('_search', ['model' => $searchModel]); ?>
 
- <div class="box box-success">
 
-     <div class="box-body">
 
-         <?= GridView::widget([
 
-             'dataProvider' => $dataProvider,
 
-             //'filterModel' => $searchModel,
 
-             'columns' => [
 
-                 'id',
 
-                 'name',
 
-                 'desc',
 
-                 [
 
-                     'attribute' => 'province',
 
-                     'format' => 'raw',
 
-                     'value' => function ($model) {
 
-                         return \common\models\Region::getNameById($model->province);
 
-                     },
 
-                 ],
 
-                  [
 
-                     'attribute' => 'city',
 
-                     'format' => 'raw',
 
-                     'value' => function ($model) {
 
-                         return \common\models\Region::getNameById($model->city);
 
-                     },
 
-                 ],
 
-                  [
 
-                     'attribute' => 'area',
 
-                     'format' => 'raw',
 
-                     'value' => function ($model) {
 
-                         return \common\models\Region::getNameById($model->area);
 
-                     },
 
-                 ],
 
-                 // 'address',
 
-                 'contacts',
 
-                 'tel',
 
-                 'created_at:datetime',
 
-                 'updated_at:datetime',
 
-                 [
 
-                     'attribute' => 'status',
 
-                     'value' => function ($model) {
 
-                         return  Space::getStatusList($model->status);
 
-                     },
 
-                 ],
 
-                 ['class' => 'common\helpers\DiyActionColumn',
 
-                     'template' => '{goods} {view} {update} {delete}',
 
-                     'buttons' => [
 
-                         'goods' => function ($url, $model, $key) {
 
-                             return Html::a('商品设置', Url::to(['/goods-index/create', 'entity' => Space::className(),'entity_id'=>$model->id,'origin'=>Yii::$app->request->url]), [
 
-                                 'class' => 'btn btn-success btn-xs',
 
-                                 'title'=>Yii::t('common', 'Create Goods Index'),
 
-                                 'target'=>'_blank'
 
-                             ]);
 
-                         },
 
-                         'view' => function ($url, $model, $key) {
 
-                             return Html::a('查看', Url::to(['/space/view', 'id' => $model->id]), [
 
-                                 'class' => 'btn btn-success btn-xs',
 
-                                 'title'=>$model->name.'空间详情',
 
-                                 'target'=>'_blank'
 
-                             ]);
 
-                         },
 
-                     ]
 
-                 ],
 
-             ],
 
-         ]); ?>
 
-     </div>
 
- </div>
 
 
  |