Commit b4c8cb310d86ce3e7a30a759afbd78ca8cfd508e

Authored by Administrator
1 parent 84296a63

add variantSku

controllers/SeoController.php
... ... @@ -76,7 +76,7 @@ class SeoController extends Controller
76 76 $model = new Seo();
77 77  
78 78 if ($model->load(Yii::$app->request->post()) && $model->save()) {
79   - return $this->redirect(['view', 'id' => $model->seo_id]);
  79 + return $this->redirect(['view', 'id' => $model->id]);
80 80 } else {
81 81 return $this->render('create', [
82 82 'model' => $model,
... ... @@ -95,7 +95,7 @@ class SeoController extends Controller
95 95 $model = $this->findModel($id);
96 96  
97 97 if ($model->load(Yii::$app->request->post()) && $model->save()) {
98   - return $this->redirect(['view', 'id' => $model->seo_id]);
  98 + return $this->redirect(['view', 'id' => $model->id]);
99 99 } else {
100 100 return $this->render('update', [
101 101 'model' => $model,
... ...
models/Seo.php
... ... @@ -7,7 +7,7 @@ use Yii;
7 7 /**
8 8 * This is the model class for table "seo".
9 9 *
10   - * @property integer $seo_id
  10 + * @property integer $id
11 11 * @property string $url
12 12 * @property string $title
13 13 * @property string $meta
... ... @@ -43,7 +43,7 @@ class Seo extends \yii\db\ActiveRecord
43 43 public function attributeLabels()
44 44 {
45 45 return [
46   - 'seo_id' => Yii::t('app', 'seo_id'),
  46 + 'id' => Yii::t('app', 'seo_id'),
47 47 'url' => Yii::t('app', 'url'),
48 48 'title' => Yii::t('app', 'title'),
49 49 'meta' => Yii::t('app', 'meta_title'),
... ...
models/SeoSearch.php
... ... @@ -18,7 +18,7 @@ class SeoSearch extends Seo
18 18 public function rules()
19 19 {
20 20 return [
21   - [['seo_id'], 'integer'],
  21 + [['id'], 'integer'],
22 22 [['url', 'title', 'meta', 'description', 'h1', 'seo_text'], 'safe'],
23 23 ];
24 24 }
... ... @@ -59,7 +59,7 @@ class SeoSearch extends Seo
59 59  
60 60 // grid filtering conditions
61 61 $query->andFilterWhere([
62   - 'seo_id' => $this->seo_id,
  62 + 'id' => $this->id,
63 63 ]);
64 64  
65 65 $query->andFilterWhere(['like', 'url', $this->url])
... ...
views/seo/_search.php
... ... @@ -4,7 +4,7 @@ use yii\helpers\Html;
4 4 use yii\widgets\ActiveForm;
5 5  
6 6 /* @var $this yii\web\View */
7   -/* @var $model common\models\SeoSearch */
  7 +/* @var $model artweb\artbox\seo\models\SeoSearch */
8 8 /* @var $form yii\widgets\ActiveForm */
9 9 ?>
10 10  
... ... @@ -15,7 +15,7 @@ use yii\widgets\ActiveForm;
15 15 'method' => 'get',
16 16 ]); ?>
17 17  
18   - <?= $form->field($model, 'seo_id') ?>
  18 + <?= $form->field($model, 'id') ?>
19 19  
20 20 <?= $form->field($model, 'url') ?>
21 21  
... ...
views/seo/index.php
... ... @@ -24,7 +24,7 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title;
24 24 'columns' => [
25 25 ['class' => 'yii\grid\SerialColumn'],
26 26  
27   - 'seo_id',
  27 + 'id',
28 28 'url:url',
29 29 'meta',
30 30 'h1',
... ...
views/seo/update.php
... ... @@ -3,13 +3,13 @@
3 3 use yii\helpers\Html;
4 4  
5 5 /* @var $this yii\web\View */
6   -/* @var $model common\models\Seo */
  6 +/* @var $model artweb\artbox\seo\models\Seo */
7 7  
8 8 $this->title = Yii::t('app', 'Update {modelClass}: ', [
9 9 'modelClass' => 'Seo',
10 10 ]) . $model->title;
11 11 $this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Seos'), 'url' => ['index']];
12   -$this->params['breadcrumbs'][] = ['label' => $model->title, 'url' => ['view', 'id' => $model->seo_id]];
  12 +$this->params['breadcrumbs'][] = ['label' => $model->title, 'url' => ['view', 'id' => $model->d]];
13 13 $this->params['breadcrumbs'][] = Yii::t('app', 'Update');
14 14 ?>
15 15 <div class="seo-update">
... ...
views/seo/view.php
... ... @@ -4,7 +4,7 @@ use yii\helpers\Html;
4 4 use yii\widgets\DetailView;
5 5  
6 6 /* @var $this yii\web\View */
7   -/* @var $model common\models\Seo */
  7 +/* @var $model artweb\artbox\seo\models\Seo */
8 8  
9 9 $this->title = $model->title;
10 10 $this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Seos'), 'url' => ['index']];
... ... @@ -15,8 +15,8 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title;
15 15 <h1><?= Html::encode($this->title) ?></h1>
16 16  
17 17 <p>
18   - <?= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->seo_id], ['class' => 'btn btn-primary']) ?>
19   - <?= Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->seo_id], [
  18 + <?= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
  19 + <?= Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], [
20 20 'class' => 'btn btn-danger',
21 21 'data' => [
22 22 'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'),
... ... @@ -28,7 +28,7 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title;
28 28 <?= DetailView::widget([
29 29 'model' => $model,
30 30 'attributes' => [
31   - 'seo_id',
  31 + 'id',
32 32 'url:url',
33 33 'title',
34 34 'meta',
... ...