shawn 9 lat temu
rodzic
commit
7f78bd437d

+ 3 - 3
database/migrations/2014_10_12_000000_create_users_table.php

xqd xqd
@@ -13,14 +13,14 @@ class CreateUsersTable extends Migration
      */
     public function up()
     {
-        Schema::create('users', function (Blueprint $table) {
+        /*Schema::create('users', function (Blueprint $table) {
             $table->increments('id');
             $table->string('name');
             $table->string('email')->unique();
             $table->string('password');
             $table->rememberToken();
             $table->timestamps();
-        });
+        });*/
     }
 
     /**
@@ -30,6 +30,6 @@ class CreateUsersTable extends Migration
      */
     public function down()
     {
-        Schema::drop('users');
+        //Schema::drop('users');
     }
 }

+ 3 - 3
database/migrations/2014_10_12_100000_create_password_resets_table.php

xqd xqd
@@ -13,11 +13,11 @@ class CreatePasswordResetsTable extends Migration
      */
     public function up()
     {
-        Schema::create('password_resets', function (Blueprint $table) {
+        /*Schema::create('password_resets', function (Blueprint $table) {
             $table->string('email')->index();
             $table->string('token')->index();
             $table->timestamp('created_at')->nullable();
-        });
+        });*/
     }
 
     /**
@@ -27,6 +27,6 @@ class CreatePasswordResetsTable extends Migration
      */
     public function down()
     {
-        Schema::drop('password_resets');
+        //Schema::drop('password_resets');
     }
 }

+ 32 - 0
database/migrations/2016_10_31_032006_create_group_table.php

xqd
@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateGroupTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('groups', function(Blueprint $table){
+            $table->increments('id')->comment('分组id');
+            $table->string('group_name', 120)->comment('分组名称');
+            $table->tinyInteger('player_count')->unsigned()->comment('选手个数');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::drop('groups');
+    }
+}

+ 36 - 0
database/migrations/2016_10_31_032221_create_player_table.php

xqd
@@ -0,0 +1,36 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreatePlayerTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        //
+        Schema::create('players', function(Blueprint $table){
+            $table->increments('id')->comment('选手id');
+            $table->integer('group_id')->unsigned()->comment('分组id');
+            $table->string('name', 120)->comment('选手名称');
+            $table->string('no', 120)->comment('选手编号');
+            $table->string('image')->comment('选手头像或图片');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        //
+        Schema::drop('players');
+    }
+}

+ 38 - 0
database/migrations/2016_10_31_032321_create_vote_table.php

xqd
@@ -0,0 +1,38 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateVoteTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        //
+        Schema::create('votes', function(Blueprint $table){
+            $table->increments('id')->comment('投票记录id');
+            $table->integer('player_id')->unsigned()->comment('得票人');
+            $table->string('openid')->comment('投票微信用户的个人openid, 用于防止刷票');
+            $table->integer('vote')->unsigned()->default('1')->comment('投票数, 为1');
+            $table->string('we_nickname', 120)->comment('微信用户昵称');
+            $table->string('we_image')->comment('微信用户的头像地址');
+            $table->timestamp('created_at')->nullable()->comment('投票时间');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        //
+        Schema::drop('votes');
+    }
+}

+ 1 - 8
resources/views/welcome.blade.php

xqd
@@ -75,16 +75,9 @@
 
             <div class="content">
                 <div class="title m-b-md">
-                    Laravel
+                    Wechat-init
                 </div>
 
-                <div class="links">
-                    <a href="https://laravel.com/docs">Documentation</a>
-                    <a href="https://laracasts.com">Laracasts</a>
-                    <a href="https://laravel-news.com">News</a>
-                    <a href="https://forge.laravel.com">Forge</a>
-                    <a href="https://github.com/laravel/laravel">GitHub</a>
-                </div>
             </div>
         </div>
     </body>