duqinya преди 6 години
родител
ревизия
2c9f694d1a

+ 10 - 0
app/Http/Controllers/AuthController.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace App\Http\Controllers;
+
+
+class  AuthController extends BaseController
+{
+
+
+}

+ 9 - 0
app/Http/Controllers/BaseController.php

@@ -0,0 +1,9 @@
+<?php
+
+namespace App\Http\Controllers;
+
+
+class BaseController extends Controller
+{
+
+}

+ 12 - 0
app/Http/Models/BaseModel.php

@@ -0,0 +1,12 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+
+class BaseModel extends Model
+{
+    protected $guarded = ['id'];
+
+    protected $hidden = ['deleted_at'];
+}

+ 22 - 0
app/Http/Models/CmsContentTemplate.php

@@ -0,0 +1,22 @@
+<?php
+
+namespace App\Models;
+
+class CmsContentTemplate extends BaseModel
+{
+    protected  $table = 'cms_content_template';
+
+
+    /**
+     * 可被批量赋值的字段
+     * @var array
+     */
+    protected $fillable = ['city_id','city_name','title','apply_type','is_open'];
+
+    //一对多关联模板内容表
+    public function cmsContentTemplateSet()
+    {
+        return $this->hasMany('App\Models\CmsContentTemplateSet','tpl_id');
+    }
+
+}

+ 26 - 0
app/Http/Models/CmsContentTemplateSet.php

@@ -0,0 +1,26 @@
+<?php
+
+namespace App\Models;
+use Illuminate\Database\Eloquent\SoftDeletes;
+
+class CmsContentTemplateSet extends BaseModel
+{
+    use SoftDeletes;
+
+    protected $dates = ['deleted_at'];
+    protected  $table = 'cms_content_template_set';
+
+
+    /**
+     * 可被批量赋值的字段
+     * @var array
+     */
+    protected $fillable = ['rule','tpl_id','area_type'];
+
+    //一对多关联模板内容表
+    public function cmsContentTemplate()
+    {
+        return $this->belongsTo('App\Models\CmsContentTemplate','tpl_id');
+    }
+
+}

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

@@ -0,0 +1,37 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateTableSubjectTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('cms_subject', function (Blueprint $table) {
+            $table->bigIncrements('id');
+            $table->integer('city_id');
+            $table->string('city_name',20)->comment('城市名称'); //城市名称
+            $table->string('title',70)->comment('专题名称');
+            $table->tinyInteger('show_type')->default(0)->comment('商品展示方式:0:左图右字;1:通栏大图;2:左右滑动');
+            $table->tinyInteger('is_open')->default(0)->comment('是否启用:0:开启;1:关闭');
+            $table->timestamps();
+            $table->softDeletes();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+            Schema::dropIfExists('cms_subject');
+    }
+}

+ 33 - 0
database/migrations/2019_04_28_025052_create_cms_subject_product_table.php

@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateCmsSubjectProductTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('cms_subject_product', function (Blueprint $table) {
+            $table->bigIncrements('id');
+            $table->integer('sort')->comment('商品排序');
+            $table->timestamps();
+            $table->softDeletes();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('cms_subject_product');
+    }
+}

+ 36 - 0
database/migrations/2019_04_28_025655_create_cms_content_template_table.php

@@ -0,0 +1,36 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateCmsContentTemplateTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('cms_content_template', function (Blueprint $table) {
+            $table->bigIncrements('id');
+            $table->integer('city_id')->comment('城市ID');
+            $table->string('city_name',20)->comment('城市名称');
+            $table->string('title',200)->comment('模板名称');
+            $table->tinyInteger('apply_type')->default(1)->comment('对应模板:0:团购首页;1:菜市场首页');
+            $table->tinyInteger('is_open')->default(1)->comment('是否启用:0:启用;1:禁用');
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('cms_content_template');
+    }
+}

+ 33 - 0
database/migrations/2019_04_28_030611_create_cms_content_template_set_table.php

@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateCmsContentTemplateSetTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('cms_content_template_set', function (Blueprint $table) {
+            $table->bigIncrements('id');
+            $table->json('rule')->comment('设置项');
+            $table->tinyInteger('status')->default(0)->comment('状态:0:草稿;1:发布');
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('cms_content_template_set');
+    }
+}

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

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

+ 33 - 0
database/migrations/2019_04_29_060908_add_template_id_to_cms_content_template_set_table.php

@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddTemplateIdToCmsContentTemplateSetTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('cms_content_template_set', function (Blueprint $table) {
+            $table->integer('tpl_id')->comment('模板ID');
+            $table->tinyInteger('area_type')->default(0)->comment('状态:0:banner;1:专题广告;2.商品楼层;3.分类专题(菜市场)');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('cms_content_template_set', function (Blueprint $table) {
+            //
+        });
+    }
+}

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

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