transfer_to_new_table

This commit is contained in:
SoHardKI
2019-06-27 15:41:58 +03:00
parent 0955e40eac
commit 0a9600cb00
11 changed files with 45 additions and 28 deletions

View File

@@ -47,7 +47,7 @@ class Company extends \common\models\Company
{
$post = \Yii::$app->request->post('Company');
FieldsValue::deleteAll(['company_id' => $this->id]);
FieldsValueNew::deleteAll(['item_id' => $this->id, 'item_type' => FieldsValueNew::TYPE_COMPANY]);
foreach ( $post['fields'] as $item) {
$fildsValue = new FieldsValueNew();

View File

@@ -15,8 +15,8 @@ $this->params['breadcrumbs'][] = $this->title;
<div class="company-view">
<p>
<?= Html::a('Список', ['index'], ['class' => 'btn btn-primary']) ?>
<?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
<?= Html::a('Delete', ['delete', 'id' => $model->id], [
<?= Html::a('Редактировать', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
<?= Html::a('Удалить', ['delete', 'id' => $model->id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',