hasTable('system_setting'); if (!$exists) { $table = $this->table('system_setting', ['comment' => '系统设计']); $table->addColumn('department_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '部门/渠道id']) ->addColumn('feature', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '功能名稱']) ->addColumn('num', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'default' => null, 'comment' => '數量']) ->addColumn('content', 'text', ['limit' => MysqlAdapter::TEXT_REGULAR, 'comment' => '內容']) ->addColumn('date_start', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '开始时间']) ->addColumn('date_end', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '结束时间']) ->addColumn('status', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 1, 'comment' => '1啟用 0停用']) ->addColumn('created_at', 'timestamp', ['comment' => '创建时间']) ->addColumn('updated_at', 'timestamp', ['comment' => '更新时间']) ->create(); } } }