table('train_course_view', ['comment' => '课件浏览记录']) ->addColumn('root_id', 'integer', ['comment' => '店面id', 'null' => true,'default'=>0]) ->addColumn('employee_id', 'integer', ['comment' => '员工id','null' => true,'default'=>0]) ->addColumn('uid', 'integer', ['comment' => '', 'null' => true,'default'=>0]) ->addColumn('org_id', 'integer', ['comment' => '浏览时org_id','null' => true,'default'=>0]) ->addColumn('con_id', 'integer', ['comment' => '浏览内容id', 'null' => true,'default'=>0]) ->addColumn('type', 'string', ['limit'=> 255, 'comment'=> '浏览类型', 'default'=> '','null' => true]) ->addColumn('time', 'integer', ['comment' => '浏览时长', 'null' => true,'default'=>0]) ->addColumn('addtime', 'timestamp', ['default'=> 'CURRENT_TIMESTAMP','null' => true]) ->create(); $w[] = ['auth_name','=','课件管理']; $w[] = ['is_menu','=',1]; $info = Permission::where($w)->find(); $u['relation'] = $info->relation.',train/courese_view_list,train/courese_view'; Permission::where($w)->update($u); } }