ソースを参照

add weight to circle messages

xielin 5 年 前
コミット
4a1a532d1d
共有2 個のファイルを変更した38 個の追加0 個の削除を含む
  1. 1 0
      app/Http/Controllers/ConfigController.php
  2. 37 0
      database/migrations/2019_10_15_103836_add_column_weight_to_interest_circle_messages.php

+ 1 - 0
app/Http/Controllers/ConfigController.php

@@ -102,6 +102,7 @@ class ConfigController extends Controller
                 '3' =>'活动',
                 '4' =>'话题',
                 '5' =>'社团活动',
+                '6' =>'圈子',
             ],
             'floor_type'=>[
                 0=>'banner',

+ 37 - 0
database/migrations/2019_10_15_103836_add_column_weight_to_interest_circle_messages.php

@@ -0,0 +1,37 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddColumnWeightToInterestCircleMessages extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('interest_circle_messages', function (Blueprint $table) {
+            //
+            $table->decimal('weight', 8, 2)
+                ->index('idx_weight')
+                ->after('is_recommend')
+                ->default(0)
+                ->comment('权重');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('interest_circle_messages', function (Blueprint $table) {
+            //
+        });
+    }
+}