table('train_class_cate')->setComment('课程培训分类'); $table->addColumn('root_id', 'integer', ['limit' => 10, 'comment' => '店面id', 'null' => true, 'default' => 0]) ->addColumn('name', 'string', ['limit' => 100, 'comment' => '分类名称', 'null' => true, 'default' => '']) ->addColumn('addtime', 'timestamp', ['comment' => '预约时间', 'default' => 'CURRENT_TIMESTAMP', 'null' => true]) ->create(); $this->table('train_class') ->addColumn('cate', 'string', ['limit' => 100, 'comment' => '分类名称', 'null' => true, 'default' => '']) ->update(); $per = ',train/class_cate_edit,train/class_cate_add,train/class_cate,train/class_cate_list'; $w[] = ['auth_name', '=', '课程培训']; $w[] = ['pid', '>', 0]; $w[] = ['is_menu', '=', 1]; $info = Permission::where($w)->find(); $per = $info->relation . $per; $info->relation = $per; $info->save(); } }