Browse Source

增加迁移字段

duqinya 6 years ago
parent
commit
74caec2162

+ 1 - 1
app/Repositories/CmsContentTemplateSetRepository.php

@@ -25,7 +25,7 @@ class CmsContentTemplateSetRepository
      */
     public function preview($request)
     {
-        $temalates = $this->cmsContentTemplate->select('title', 'id')->where(['city_id' => $request['city_id'], 'apply_type' => $request['type'], 'is_open' => 1])->first();
+        $temalates = $this->cmsContentTemplate->select('title', 'id')->where(['city_id' => $request['city_id'], 'apply_type' => $request['type'], 'is_open' => 1])->orderBy('id','desc')->first();
         if (!$temalates) {
             throw new HttpException(500, '没有找到对应模板');
         }

+ 32 - 0
database/migrations/2019_05_22_015511_add_delete_to_cms_content_template_table.php

@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddDeleteToCmsContentTemplateTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('cms_content_template', function (Blueprint $table) {
+            $table->softDeletes();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('cms_content_template', function (Blueprint $table) {
+            //
+        });
+    }
+}