@@ -15,7 +15,7 @@ class CmsSubject extends BaseModel
* 可被批量赋值的字段
* @var array
*/
- protected $fillable = ['city_id','city_name','title','show_type','is_open','used_count'];
+ protected $fillable = ['city_id','city_name','title','show_type','is_open','used_count','used_mall','subject_img'];
//一对多关联专题商品表
public function cmsSubjectProduct()
@@ -0,0 +1,35 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+class AddUsedMallToCmsSubjectTable extends Migration
+{
+ /**
+ * Run the migrations.
+ *
+ * @return void
+ */
+ public function up()
+ {
+ Schema::table('cms_subject', function (Blueprint $table) {
+ $table->tinyInteger('used_mall')->default(1)->comment('对应商城:0.兑换商城;1.电商商城');
+ $table->string('subject_img')->default('')->comment('专题顶图');
+ \Illuminate\Support\Facades\DB::statement("ALTER TABLE cms_subject MODIFY COLUMN show_type TINYINT (4) NOT NULL DEFAULT 0 COMMENT '商品展示方式:0:左图右字;1:通栏大图;2:左右滑动;3.左右两列'");
+ });
+ }
+ * Reverse the migrations.
+ public function down()
+ //
+}