table('train_coures_studytime', ['comment' => '员工学习时长记录表', 'engine'=>'InnoDB']); $table->addColumn('empid', 'integer',array('comment'=>'员工id','default'=> 0)) ->addColumn('classid', 'integer',array('comment'=>'课程id','default'=> 0)) ->addColumn('course_id', 'integer',array('comment'=>'课件id','default'=> 0)) ->addColumn('study_time', 'integer', array('default'=> 0 ,'comment'=>'学习时长')) ->addColumn('all_time', 'integer', array('default'=> 0, 'comment'=>'累计时长')) ->addColumn('addtime', 'timestamp',array('comment'=>'添加时间','default'=> 'CURRENT_TIMESTAMP')) ->addColumn(Column::tinyInteger('type')->setComment('时长类型')->setDefault(1)) ->create(); $table = $this->table('train_credits', ['comment' => '员工学分表', 'engine'=>'InnoDB']); $table->addColumn('employee_id', 'integer',array('comment'=>'员工id','default'=> 0)) ->addColumn('root_id', 'integer',array('comment'=>'公司id','default'=> 0)) ->addColumn(Column::tinyInteger('type')->setComment('学分类型1是学习时长累计获得,2是课程完成获得,3是写感悟心得获得')->setDefault(0)) ->addColumn('credits', 'integer', array('default'=> 0 ,'comment'=>'本次增加学分')) ->addColumn('now_credits', 'integer', array('default'=> 0, 'comment'=>'累计获得学分')) ->addColumn('addtime', 'timestamp',array('comment'=>'添加时间','default'=> 'CURRENT_TIMESTAMP')) ->create(); } }