Browse Source

feat: modify policy logic

jiangzixin 1 year ago
parent
commit
ffadf3f965

+ 3 - 1
server/api/modules/v1/controllers/PolicyController.php

@@ -34,7 +34,9 @@ class PolicyController extends Controller {
     {
         
         $params = request()->get();
-        $query = Policy::find()->select('id,title,author,created_at');
+        $query = Policy::find()->select('id,title,author,created_at,summary');
+        //过滤查询的政策
+        $query->andWhere(new \yii\db\Expression('FIND_IN_SET("'. Policy::TYPE_SEARCH .'", type)'));
         
         if(!empty($params)){
             $arr = [];

+ 3 - 2
server/api/modules/v1/controllers/SurveyController.php

@@ -250,8 +250,9 @@ class SurveyController extends Controller {
         $cengci = array_values($cengci);
 
 
-        $query = Policy::find()->select('id,title,author,content,created_at');
-        
+        $query = Policy::find()->select('id,title,author,content,created_at,summary');
+        //过滤匹配类型的政策
+        $query->andWhere(new \yii\db\Expression('FIND_IN_SET("'. Policy::TYPE_SURVEY .'", type)'));
         if(!empty($cengci)){
             foreach ($cengci as $value) {
 		         $query->orWhere(new \yii\db\Expression('FIND_IN_SET("'.$value['title'].'", cengci)'));

+ 26 - 22
server/backend/controllers/PolicyController.php

@@ -78,10 +78,12 @@ class PolicyController extends Controller
 				if($key == '_csrfBackend' || $key == 'Policy' || $key == 'cengci'){
 					continue;
 				}
-				if($value) $arr[] = $key.'_' . $value;
+//				if($value) $arr[] = $key.'_' . $value;
+                $arr[$key] = $value;
 			}
 
-			$data['Policy']['filter'] = join(',',$arr);
+//			$data['Policy']['filter'] = join(',',$arr);
+            $data['Policy']['filter'] = json_encode($arr,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
 			$data['Policy']['cengci'] = join(',',$data['cengci']);
 
 			$model->load($data);
@@ -119,36 +121,38 @@ class PolicyController extends Controller
 					continue;
 				}
 				
-				if($value) $arr[] = $key.'_' . $value;
+//				if($value) $arr[] = $key.'_' . $value;
+                $arr[$key] = $value;
 			}
 		
-			$data['Policy']['filter'] = join(',',$arr);
+//			$data['Policy']['filter'] = join(',',$arr);
+            $data['Policy']['filter'] = json_encode($arr,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
 			$data['Policy']['cengci'] = join(',',$data['cengci']);
-
-//
+//			$data['Policy']['type'] = join(',',$data['type']);
 			$model->load($data);
+            $model->type = implode(',', $model->type);
 			$model->save();
-//            var_dump($model->cengci);die();
 			return $this->redirect(['index']);
 		}
 		
-		$filterArr = [];
-		$filter = explode(',',$model->filter);
-		if(!empty($filter)){
-		    foreach ($filter as $key=>$value) {
-                if (empty($value)) {
-                    continue;
-                }
-    		    $arr = explode('_',$value);
-                if (!empty($arr) && isset($arr[0]) && isset($arr[1])) {
-    		        $filterArr[$arr[0]] = $arr[1];
-                }
-    		}
-		}
+//		$filterArr = [];
+//		$filter = explode(',',$model->filter);
+//		if(!empty($filter)){
+//		    foreach ($filter as $key=>$value) {
+//                if (empty($value)) {
+//                    continue;
+//                }
+//    		    $arr = explode('_',$value);
+//                if (!empty($arr) && isset($arr[0]) && isset($arr[1])) {
+//    		        $filterArr[$arr[0]] = $arr[1];
+//                }
+//    		}
+//		}
 	
 	    $model->cengci = explode(',',$model->cengci);
-	    
-		$model->filter = $filterArr;
+	    $model->type = explode(',',$model->type);
+//		$model->filter = $filterArr;
+        $model->filter = json_decode($model->filter,true);
 		return $this->render('update', [
 			'model' => $model,
 			'configModels' => $configModels,

+ 214 - 0
server/backend/controllers/SurveyNewController.php

@@ -0,0 +1,214 @@
+<?php
+
+namespace backend\controllers;
+
+use common\models\SurveyNew;
+use Yii;
+use yii\data\ActiveDataProvider;
+use yii\filters\VerbFilter;
+use yii\web\Controller;
+use yii\web\NotFoundHttpException;
+use common\modules\config\models\Config;
+
+/**
+ * SurveyController implements the CRUD actions for SurveyNew model.
+ */
+class SurveyNewController extends Controller
+{
+    public function behaviors()
+    {
+        return [
+            'verbs' => [
+                'class' => VerbFilter::className(),
+                'actions' => [
+                    'delete' => ['post'],
+                ],
+            ],
+        ];
+    }
+    /**
+     * Lists all SurveyNew models.
+     *
+     * @return mixed
+     */
+    public function actionIndex()
+    {
+        $dataProvider = new ActiveDataProvider([
+            'query' => SurveyNew::find(),
+        ]);
+
+        return $this->render('index', [
+            'dataProvider' => $dataProvider,
+        ]);
+    }
+
+    /**
+     * Displays a single SurveyNew model.
+     *
+     * @param int $id
+     *
+     * @return mixed
+     */
+    public function actionView($id)
+    {
+        return $this->render('view', [
+            'model' => $this->findModel($id),
+        ]);
+    }
+    
+    
+
+    /**
+     * Creates a new SurveyNew model.
+     * If creation is successful, the browser will be redirected to the 'view' SurveyNew.
+     *
+     * @return mixed
+     */
+    public function actionCreate()
+    {
+        $model = new SurveyNew();
+        $editor = request('editor') ? : config('page_editor_type');
+        $model->markdown = $editor == 'markdown' ? 1 : 0;
+        $type = Yii::$app->request->get('type','industry');
+        $type = empty($type) ? 'industry' : $type;
+        $model->type = $type;
+        
+        $typeDesc = '';
+        switch ($type) {
+            case 'industry':
+                $typeDesc = '现代产业';
+                break;
+            case 'education':
+                $typeDesc = '高等教育';
+                break;
+            case 'medical':
+                $typeDesc = '医疗卫生';
+                break;
+            case 'circuit':
+                $typeDesc = '集成电路';
+                break;
+        }
+      
+		$configModels = Config::find()->select(['name','value','extra','description','type'])->where(['group' => $type])->all();
+
+        $cengciModels =  Config::find()->select(['name','value','extra','description','type'])->where(['group' => 'policy', 'name' => 'cengci'])->all();
+		
+		if (Yii::$app->request->isPost) {
+			$data = Yii::$app->request->post();
+			
+			$arr = [];
+			foreach ($data as $key=>$value) {
+				if($key == '_csrfBackend' || $key == 'SurveyNew'){
+					continue;
+				}
+				$arr[$key] = $value;
+			}
+
+			$data['SurveyNew']['filter'] = json_encode($arr,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
+            $data['SurveyNew']['type'] = $type;
+            
+			$model->load($data);
+			$model->save();
+			return $this->redirect(['index']);
+		}
+    
+		return $this->render('create', [
+			'model' => $model,
+			'type'=>$typeDesc,
+			'configModels' => $configModels,
+			'cengciModels' => $cengciModels,
+		]);
+
+    }
+
+    /**
+     * Updates an existing SurveyNew model.
+     * If update is successful, the browser will be redirected to the 'view' SurveyNew.
+     *
+     * @param int $id
+     *
+     * @return mixed
+     */
+    public function actionUpdate($id)
+    {
+        $model = $this->findModel($id);
+
+        $typeDesc = '';
+        switch ($model['type']) {
+            case 'industry':
+                $typeDesc = '现代产业';
+                break;
+            case 'education':
+                $typeDesc = '高等教育';
+                break;
+            case 'medical':
+                $typeDesc = '医疗卫生';
+                break;
+            case 'circuit':
+                $typeDesc = '集成电路';
+                break;
+        }
+        
+		$configModels = Config::find()->select(['name','value','extra','description','type'])->where(['group' => $model['type']])->all();
+		
+		if (Yii::$app->request->isPost) {
+			$data = Yii::$app->request->post();
+			
+			$arr = [];
+			foreach ($data as $key=>$value) {
+				if($key == '_csrfBackend' || $key == 'SurveyNew'){
+					continue;
+				}
+				$arr[$key] = $value;
+			}
+
+			$data['SurveyNew']['filter'] = json_encode($arr,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
+          
+			$model->load($data);
+			$model->save();
+			return $this->redirect(['index']);
+		}
+		
+		$model->filter = json_decode($model->filter,true);
+		return $this->render('update', [
+			'model' => $model,
+			'type'=>$typeDesc,
+			'configModels' => $configModels,
+		]);
+    }
+
+    /**
+     * Deletes an existing SurveyNew model.
+     * If deletion is successful, the browser will be redirected to the 'index' SurveyNew.
+     *
+     * @param int $id
+     *
+     * @return mixed
+     */
+    public function actionDelete($id)
+    {
+        $this->findModel($id)->delete();
+
+        return $this->redirect(['index']);
+    }
+
+    /**
+     * Finds the SurveyNew model based on its primary key value.
+     * If the model is not found, a 404 HTTP exception will be thrown.
+     *
+     * @param int $id
+     *
+     * @return SurveyNew the loaded model
+     *
+     * @throws NotFoundHttpException if the model cannot be found
+     */
+    protected function findModel($id)
+    {
+        if (($model = SurveyNew::findOne($id)) !== null) {
+            
+            return $model;
+        } else {
+            throw new NotFoundHttpException('The requested page does not exist.');
+        }
+    }
+}

+ 6 - 3
server/backend/views/policy/_form.php

@@ -4,8 +4,9 @@ use yii\helpers\Html;
 use yii\widgets\ActiveForm;
 
 /* @var $this yii\web\View */
-/* @var $model common\models\Page */
+/* @var $model common\models\Policy */
 /* @var $form yii\widgets\ActiveForm */
+/* @var $configModels [] */
 ?>
 
 <div class="box box-success">
@@ -14,6 +15,7 @@ use yii\widgets\ActiveForm;
 
         <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>
         <?= $form->field($model, 'author')->textInput(['maxlength' => true]) ?>
+        <?= $form->field($model, 'type')->checkboxList(\common\models\Policy::getTypeList()) ?>
 		<?php
 
         foreach ($configModels as $index => $configModel) {
@@ -39,9 +41,9 @@ use yii\widgets\ActiveForm;
     				$arr[$k] = trim($val);
     			}
  
-                echo $form->field($model, 'id')->radioList($arr,[
+                echo $form->field($model, 'id')->checkboxList($arr,[
     				'name'=>$configModel['name'],
-    				'value'=>isset($model->filter[$configModel['name']]) ? $model->filter[$configModel['name']] : ''
+    				'value'=>$model->filter[$configModel['name']]
     			])->label($configModel['description']);
             }
       
@@ -50,6 +52,7 @@ use yii\widgets\ActiveForm;
     
         ?>
 
+        <?= $form->field($model, 'summary')->widget(\common\widgets\EditorWidget::className(), $model->isNewRecord ? ['type' => request('editor') ?: config('page_editor_type')] : ['isMarkdown' => $model->markdown]) ?>
         <?= $form->field($model, 'content')->widget(\common\widgets\EditorWidget::className(), $model->isNewRecord ? ['type' => request('editor') ?: config('page_editor_type')] : ['isMarkdown' => $model->markdown]) ?>
 
         <div class="form-group form-submit">

+ 124 - 0
server/backend/views/survey-new/_form.php

@@ -0,0 +1,124 @@
+<?php
+
+use yii\helpers\Html;
+use yii\widgets\ActiveForm;
+
+/* @var $this yii\web\View */
+/* @var $model common\models\SurveyNew */
+/* @var $form yii\widgets\ActiveForm */
+/* @var $configModels [] */
+/* @var $cengciModels [] */
+?>
+
+<div class="box box-success">
+    <div class="box-body">
+        <?php $form = ActiveForm::begin(['enableClientValidation'=>false]); ?>
+
+        <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>
+        <?= $form->field($model, 'type',['options'=>['class'=>'hide']])->textInput(['maxlength' => true]) ?>
+
+
+
+		<?php
+	    //人才层次
+        foreach ($cengciModels as $index => $configModel) {
+
+			$value = explode("\r\n",$configModel['extra']);
+
+			$arr = [];
+			foreach($value as &$val){
+				$val = trim($val);
+				$arr[$val] = $val;
+			}
+
+            echo $form->field($model, 'id')->checkboxList($arr,[
+				'name'=>$configModel['name'],
+				'value'=>$model->filter[$configModel['name']]
+			])->label($configModel['description']);
+        }
+        foreach ($configModels as $index => $configModel) {
+
+			$value = explode("\r\n",$configModel['extra']);
+
+			$arr = [];
+			foreach($value as &$val){
+				$val = trim($val);
+				$arr[$val] = $val;
+			}
+
+            echo $form->field($model, 'id')->checkboxList($arr,[
+				'name'=>$configModel['name'],
+				'value'=>$model->filter[$configModel['name']]
+			])->label($configModel['description']);
+        }
+
+        ?>
+
+        <?= $form->field($model, 'content')->widget(\common\widgets\EditorWidget::className(), $model->isNewRecord ? ['type' => request('editor') ?: config('page_editor_type')] : ['isMarkdown' => $model->markdown]) ?>
+
+        <div class="form-group form-submit">
+            <?= Html::submitButton($model->isNewRecord ? '创建' : '更新', ['class' => 'btn btn-flat bg-maroon btn-block']) ?>
+        </div>
+
+
+        <?php ActiveForm::end(); ?>
+    </div>
+</div>
+<?php $this->beginBlock('js') ?>
+<script>
+    $(document).on('change', '#choose-editor', function () {
+        var url = '<?= \yii\helpers\Url::to(['create']) ?>';
+        var type = $(this).val();
+        url = url.addQueryParams({editor: type});
+        location.href = url;
+    })
+</script>
+<?php $this->endBlock() ?>
+
+
+<?php
+$js = <<<JS
+    //nav导航切换
+    $('#formNavs li').click(function (e) {
+        $('#formNavs li').removeClass('active');
+        $(this).addClass('active');
+    });
+
+    function skuToggle() {
+      if ($('input[name="Goods[is_sku]"]:checked').val() == 1) {
+            $('#goods-stock').prop('readonly', true).val(0);
+            $('#goodsSku').slideDown();
+        } else {
+            $('#goods-stock').prop('readonly', false);
+             $('#goodsSku').slideUp();
+        }
+    }
+    function shareDiyToggle() {
+      if ($('input[name="Goods[is_share_diy]"]:checked').val() == 1) {
+            $('#goodsShareDiy').slideDown();
+        } else {
+             $('#goodsShareDiy').slideUp();
+        }
+    }
+    
+    $('#goods-is_sku').change(function(e) {
+        skuToggle();
+    });
+    
+    $('#goods-is_share_diy').change(function(e) {
+        shareDiyToggle();
+    });
+       
+    //初始化调用
+    skuToggle();
+    shareDiyToggle();
+    
+    //滚动监听
+    $('body').scrollspy({ target: '#formNavs' });
+    $('#formNavs').on('activate.bs.scrollspy', function (e) {
+        location.hash = $(e.target).find('a').attr('href');
+    })
+JS;
+$this->registerJs($js);
+?>
+

+ 21 - 0
server/backend/views/survey-new/create.php

@@ -0,0 +1,21 @@
+<?php
+
+/* @var $this yii\web\View */
+/* @var $model common\models\Page */
+/* @var $configModels [] */
+/* @var $cengciModels [] */
+
+$this->title = '新增 - ' . $type;
+$this->params['breadcrumbs'][] = ['label' => '人才计算器', 'url' => ['index']];
+$this->params['breadcrumbs'][] = $this->title;
+?>
+<div class="page-create">
+
+    <?= $this->render('_form', [
+        'model' => $model,
+        'type' => $type,
+		'configModels' => $configModels,
+		'cengciModels' => $cengciModels,
+    ]) ?>
+
+</div>

+ 39 - 0
server/backend/views/survey-new/index.php

@@ -0,0 +1,39 @@
+<?php
+
+use yii\grid\GridView;
+use yii\helpers\Html;
+
+/* @var $this yii\web\View */
+/* @var $dataProvider yii\data\ActiveDataProvider */
+
+$this->title = '人才计算器';
+$this->params['breadcrumbs'][] = $this->title;
+?>
+<?php $this->beginBlock('content-header'); ?>
+<?= $this->title . ' ' . Html::a(Yii::t('common', '现代产业'), ['create?type=industry'], ['class' => 'btn btn-success']) ?>
+<?= Html::a(Yii::t('common', '高等教育'), ['create?type=education'], ['class' => 'btn btn-success','style'=>'margin-left:10px']) ?>
+<?= Html::a(Yii::t('common', '医疗卫生'), ['create?type=medical'], ['class' => 'btn btn-success','style'=>'margin-left:10px']) ?>
+<?= Html::a(Yii::t('common', '集成电路'), ['create?type=circuit'], ['class' => 'btn btn-success','style'=>'margin-left:10px']) ?>
+<?php $this->endBlock(); ?>
+<div class="box box-success">
+    <div class="box-body">
+    <?= GridView::widget([
+        'dataProvider' => $dataProvider,
+        'columns' => [
+
+            'id',
+//            [
+//                'attribute' => 'use_layout',
+//                'value' => function ($model) {
+//                    $arr = ['不使用', '使用'];
+//                    return $arr[$model->use_layout];
+//                },
+//            ],
+            'title',
+            'slug',
+
+            ['class' => 'common\helpers\DiyActionColumn'],
+        ],
+    ]); ?>
+    </div>
+</div>

+ 18 - 0
server/backend/views/survey-new/update.php

@@ -0,0 +1,18 @@
+<?php
+
+/* @var $this yii\web\View */
+/* @var $model common\models\Page */
+
+$this->title = $type.' - '.$model->title;
+$this->params['breadcrumbs'][] = ['label' => '人才计算器', 'url' => ['index']];
+$this->params['breadcrumbs'][] = ['label' => $model->title, 'url' => ['view', 'id' => $model->id]];
+$this->params['breadcrumbs'][] = 'Update';
+?>
+<div class="page-update">
+
+    <?= $this->render('_form', [
+        'model' => $model,
+		'configModels' => $configModels,
+    ]) ?>
+
+</div>

+ 25 - 0
server/backend/views/survey-new/view.php

@@ -0,0 +1,25 @@
+<?php
+
+use yii\widgets\DetailView;
+
+/* @var $this yii\web\View */
+/* @var $model common\models\Page */
+
+$this->title = $model->title;
+$this->params['breadcrumbs'][] = ['label' => '页面管理', 'url' => ['index']];
+$this->params['breadcrumbs'][] = $this->title;
+?>
+<div class="page-view">
+
+    <?= DetailView::widget([
+        'model' => $model,
+        'attributes' => [
+            'id',
+            'use_layout',
+            'content:ntext',
+            'title',
+            'slug'
+        ],
+    ]) ?>
+
+</div>

+ 20 - 2
server/common/models/Policy.php

@@ -14,10 +14,26 @@ use yii\helpers\StringHelper;
  * @property int $use_layout
  * @property string $content
  * @property string $title
+ * @property string $summary
+ * @property string $cengci
  * @property integer $markdown
+ * @property string $type
  */
 class Policy extends \yii\db\ActiveRecord
 {
+
+    const TYPE_SURVEY = 'survey';//政策匹配
+    const TYPE_SEARCH = 'search';//政策查询
+
+    public static function getTypeList()
+    {
+        return [
+            self::TYPE_SURVEY => '匹配(仅显示在匹配列表中)',
+            self::TYPE_SEARCH => '查询(仅供政策搜索查询)',
+        ];
+    }
+
+
     /**
      * {@inheritdoc}
      */
@@ -32,7 +48,7 @@ class Policy extends \yii\db\ActiveRecord
     public function rules()
     {
         return [
-            [['content', 'title'], 'required'],
+            [['content', 'title', 'summary', 'type'], 'required'],
             [['content'], 'string'],
 			[['filter','cengci'], 'string'],
             ['markdown', 'default', 'value' => $this->getIsMarkdown()],
@@ -74,9 +90,11 @@ class Policy extends \yii\db\ActiveRecord
         return [
             'id' => 'ID',
             'use_layout' => '是否使用布局',
-            'content' => '内容',
+            'summary' => '摘要',
+            'content' => '详情',
             'title' => '标题',
             'author'=>'作者',
+            'type'=>'类型',//类型:0 匹配,1 查询
             'created_at'=>'发布时间'
         ];
     }

+ 111 - 0
server/common/models/SurveyNew.php

@@ -0,0 +1,111 @@
+<?php
+
+namespace common\models;
+use common\behaviors\CommentBehavior;
+use common\behaviors\MetaBehavior;
+use yii\behaviors\TimestampBehavior;
+use yii\helpers\HtmlPurifier;
+use yii\helpers\StringHelper;
+
+/**
+ * This is the model class for table "{{%survey_new}}".
+ *
+ * @property int $id
+ * @property int $use_layout
+ * @property string $content
+ * @property string $title
+ * @property integer $markdown
+ */
+class SurveyNew extends \yii\db\ActiveRecord
+{
+    /**
+     * {@inheritdoc}
+     */
+    public static function tableName()
+    {
+        return '{{%survey_new}}';
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function rules()
+    {
+        return [
+            [['content', 'title'], 'required'],
+            [['content'], 'string'],
+			[['filter'], 'string'],
+            ['markdown', 'default', 'value' => $this->getIsMarkdown()],
+            [['use_layout'], 'in', 'range' => [0, 1]],
+            [['title'], 'string', 'max' => 50],
+            ['content', 'filterHtml']
+        ];
+    }
+
+    public function filterHtml($attribute)
+    {
+        $this->$attribute = HtmlPurifier::process($this->$attribute, function ($config) {
+            $config->set('HTML.Allowed', 'p[style],a[href|title],img[src|title|alt|class],h3,ul,ol,li,span,b,strong,hr,code,table,tbody,tr,td');
+            // 清除空标签
+            $config->set('AutoFormat.RemoveEmpty', true);
+        });
+    }
+
+    /**
+     * 没有指定markdown情况下默认编辑器是否为markdown
+     * @return int
+     */
+    public function getIsMarkdown()
+    {
+        return \Yii::$app->config->get('article_editor_type') == 'markdown' ? 1 : 0;
+    }
+
+    public function getProcessedContent()
+    {
+        return $this->markdown ? \yii\helpers\Markdown::process($this->content) : $this->content;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function attributeLabels()
+    {
+        return [
+            'id' => 'ID',
+            'use_layout' => '是否使用布局',
+            'content' => '内容',
+            'title' => '标题'
+        ];
+    }
+
+    public function attributeHints()
+    {
+        return [
+            'name' => '(影响url)'
+        ];
+    }
+
+    public function behaviors()
+    {
+        return [
+            TimestampBehavior::className(),
+            [
+                'class' => MetaBehavior::className(),
+            ],
+            [
+                'class' => CommentBehavior::className()
+            ]
+        ];
+    }
+
+    public function getMetaData()
+    {
+        $model = $this->getMetaModel();
+
+        $title = $model->title ?  : $this->title;
+
+        $description = $model->description ?  : StringHelper::truncate(strip_tags($this->content), 150);
+
+        return [$title, $description, $model->keywords];
+    }
+}

+ 16 - 0
server/database/202310271307.sql

@@ -0,0 +1,16 @@
+CREATE TABLE `dd_survey_new` (
+                                 `id` int(11) NOT NULL AUTO_INCREMENT,
+                                 `use_layout` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0:不使用1:使用',
+                                 `content` text COLLATE utf8_unicode_ci NOT NULL COMMENT '内容',
+                                 `title` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT '标题',
+                                 `type` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
+                                 `filter` text COLLATE utf8_unicode_ci NOT NULL,
+                                 `markdown` smallint(6) DEFAULT '0' COMMENT '是否markdown格式',
+                                 `created_at` int(11) DEFAULT NULL,
+                                 `updated_at` int(11) DEFAULT NULL,
+                                 `cengci` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '人才层次',
+                                 PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=COMPACT
+
+ALTER TABLE `dd_policy` ADD `summary` VARCHAR(1000) NOT NULL DEFAULT '' COMMENT '简介' AFTER `updated_at`;
+ALTER TABLE `dd_policy` ADD `type` TINYINT(2) NOT NULL DEFAULT 'survey,search' COMMENT '类型:0 匹配,1 查询' AFTER `summary`;