5.将现有布局参考指定模块布局修改
将dgxindex方法中的列表显示页改成像example模块的布局与功能,example模块及对应的类及html和js文件在根目录的下面的位置 :application\admin\controller\example\Tabletemplate.php
模板文件:
application\admin\example\Tabletemplate.html
js文件:
public\assets\js\backend\example\Tabletemplate..js
crawler_content这个模块的dgxindex方法是fastadmin开发的,基于thinkphp5框架,数据表名是fa_crawler_content,数据结构如下
id (bigint(20) unsigned) 注释:自增主键, platform (varchar(32)) 注释:平台(bilibili/douyin/tieba/weibo/xhs/zhihu), content_id (varchar(128)) 注释:内容唯一标识, content_type (varchar(32)) 注释:内容类型, title (varchar(2000)) 注释:标题, desc (longtext) 注释:描述/正文内容, content_url (varchar(512)) 注释:内容链接, cover_url (varchar(512)) 注释:封面图链接, user_id (varchar(128)) 注释:用户ID, sec_uid (varchar(250)), user_nickname (varchar(255)) 注释:用户昵称, user_avatar (varchar(512)) 注释:用户头像, user_link (varchar(512)) 注释:用户主页链接, ip_location (varchar(255)) 注释:IP地理位置, liked_count (bigint(20)) 注释:点赞数, comment_count (bigint(20)) 注释:评论数, share_count (bigint(20)) 注释:分享数, view_count (bigint(20)) 注释:浏览数, create_time (bigint(20)) 注释:内容发布时间, senddate (varchar(50)), tag_list (longtext) 注释:标签列表, extra_data (longtext) 注释:额外平台特定数据(JSON格式), source_keyword (varchar(255)) 注释:搜索来源关键字, plid (int(11)) 注释:项目ID, add_ts (bigint(20)) 注释:记录添加时间戳, last_modify_ts (bigint(20)) 注释:记录最后修改时间戳, crawler_time (bigint(20)) 注释:爬取时间戳, btype (int(11)), isdown (int(11)), istq (int(11)), remote_video_url (text), local_video_path (varchar(550)), txt (text), txt1 (text), txt2 (text), title1 (varchar(250)), title2 (varchar(250)), title3 (varchar(250)), coments (text)
模块具体文件功能及位置如下
Model模型文件:application/admin/model/crawler/content.php
控制器文件:application/admin/controller/crawler/content.php
外部调用js文件:public/assets/js/backend/crawler/content.js列表对应的html文件:application/admin/view/crawler/content/index.html
添加对应的html文件:application/admin/view/crawler/content/add.html
修改对应的html文件:application/admin/view/crawler/content/edit.html
1.请将js代码都写在外部调用文件里:'public/assets/js/backend/crawler/content.js'。2.这个是后台管理的模板文件,视图html文件不需要生成{include file="common/header" /}和
{include file="common/footer" /} ,js也是在外部调用文件。中文语言包路径:../application/admin/lang/zh-cn/crawler/content.php
css样式文件路径:public/assets/css/backend.min.css
,
4.MysqlDownloader
3.请将数据表 fa_crawler_kuaishou_video替换成数据表kuaishou_video
请将数据表 fa_crawler_kuaishou_video替换成数据表kuaishou_video 导入fa_crawler_content数据表
kuaishou_video数据表的字段:
id 自增ID user_id 用户ID nickname 用户昵称 avatar 用户头像地址 add_ts 记录添加时间戳 last_modify_ts 记录最后修改时间戳 video_id 视频ID video_type 视频类型 title 视频标题 desc 视频描述 create_time 视频发布时间戳 liked_count 视频点赞数 viewd_count 视频浏览数量 video_url 视频详情URL video_cover_url 视频封面图 URL video_play_url 视频播放 URL source_keyword 搜索来源关键字
fa_crawler_kuaishou_video数据表结构
对应的字段:
id 自增ID user_id 用户ID nickname 用户昵称 avatar 用户头像地址 add_ts 记录添加时间戳 last_modify_ts 记录最后修改时间戳 video_id 视频ID video_type 视频类型 title 视频标题 desc 视频描述 create_time 视频发布时间戳 liked_count 视频点赞数 viewd_count 视频浏览数量 video_url 视频详情URL video_cover_url 视频封面图 URL video_play_url 视频播放 URL source_keyword 搜索来源关键字 plid crawler_time isout 是否已导出
fa_crawler_content数据表结构
id 自增主键 platform 平台(bilibili/douyin/tieba/weibo/xhs/zhihu) content_id 内容唯一标识 content_type 内容类型 title 标题 desc 描述/正文内容 content_url 内容链接 cover_url 封面图链接 user_id 用户ID sec_uid user_nickname 用户昵称 user_avatar 用户头像 user_link 用户主页链接 ip_location IP地理位置 liked_count 点赞数 comment_count 评论数 share_count 分享数 view_count 浏览数 create_time 内容发布时间 tag_list 标签列表 extra_data 额外平台特定数据(JSON格式) source_keyword 搜索来源关键字 plid 项目ID add_ts 记录添加时间戳 last_modify_ts 记录最后修改时间戳 crawler_time 爬取时间戳 btype
另外kuaishou_video数据表不带表前缀。但fastadmin会自动加'fa_'前缀,请特殊处理。只改变以上功能,不要动任何其它代码。
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ds_hxlsw_com.fa_kuaishou_video' doesn't exist
这个数据表是kuaishou_video,而不是fa_kuaishou_video,
需要处理表前缀问题,因为 FastAdmin 会自动添加 fa_ 前缀
2. fa_crawler_zhihu_content替换成数据表zhihu_content
请将数据表 fa_crawler_zhihu_content替换成数据表zhihu_content 导入fa_crawler_content数据表
zhihu_content数据表的字段:
id 自增ID content_id 内容ID content_type 内容类型(article | answer | zvideo) content_text 内容文本, 如果是视频类型这里为空 content_url 内容落地链接 question_id 问题ID, type为answer时有值 title 内容标题 desc 内容描述 created_time 创建时间 updated_time 更新时间 voteup_count 赞同人数 comment_count 评论数量 source_keyword 来源关键词 user_id 用户ID user_link 用户主页链接 user_nickname 用户昵称 user_avatar 用户头像地址 user_url_token 用户url_token add_ts 记录添加时间戳 last_modify_ts 记录最后修改时间戳
fa_crawler_zhihu_content数据表结构
对应的字段:
完整文字 id 自增ID content_id 内容ID content_type 内容类型(article | answer | zvideo) content_text 内容文本, 如果是视频类型这里为空 content_url 内容落地链接 question_id 问题ID, type为answer时有值 title 内容标题 desc 内容描述 created_time 创建时间 updated_time 更新时间 voteup_count 赞同人数 comment_count 评论数量 source_keyword 来源关键词 user_id 用户ID user_link 用户主页链接 user_nickname 用户昵称 user_avatar 用户头像地址 user_url_token 用户url_token add_ts 记录添加时间戳 last_modify_ts 记录最后修改时间戳 plid crawler_time isout 是否已导出
fa_crawler_content数据表结构
id 自增主键 platform 平台(bilibili/douyin/tieba/weibo/xhs/zhihu) content_id 内容唯一标识 content_type 内容类型 title 标题 desc 描述/正文内容 content_url 内容链接 cover_url 封面图链接 user_id 用户ID sec_uid user_nickname 用户昵称 user_avatar 用户头像 user_link 用户主页链接 ip_location IP地理位置 liked_count 点赞数 comment_count 评论数 share_count 分享数 view_count 浏览数 create_time 内容发布时间 tag_list 标签列表 extra_data 额外平台特定数据(JSON格式) source_keyword 搜索来源关键字 plid 项目ID add_ts 记录添加时间戳 last_modify_ts 记录最后修改时间戳 crawler_time 爬取时间戳 btype
另外zhihu_content数据表不带表前缀。但fastadmin会自动加'fa_'前缀,请特殊处理。只改变以上功能,不要动任何其它代码。
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ds_hxlsw_com.fa_zhihu_content' doesn't exist
这个数据表是zhihu_content,而不是fa_zhihu_content,
需要处理表前缀问题,因为 FastAdmin 会自动添加 fa_ 前缀
1.将数据表 fa_crawler_weibo_note替换成数据表weibo_note导入fa_crawler_content数据表
这个模块是fastadmin开发的,基于thinkphp5框架,数据表名是fa_crawler_content,数据结构如下
id (bigint(20) unsigned) 注释:自增主键, platform (varchar(32)) 注释:平台(bilibili/douyin/tieba/weibo/xhs/zhihu), content_id (varchar(128)) 注释:内容唯一标识, content_type (varchar(32)) 注释:内容类型, title (varchar(2000)) 注释:标题, desc (longtext) 注释:描述/正文内容, content_url (varchar(512)) 注释:内容链接, cover_url (varchar(512)) 注释:封面图链接, user_id (varchar(128)) 注释:用户ID, sec_uid (varchar(250)), user_nickname (varchar(255)) 注释:用户昵称, user_avatar (varchar(512)) 注释:用户头像, user_link (varchar(512)) 注释:用户主页链接, ip_location (varchar(255)) 注释:IP地理位置, liked_count (bigint(20)) 注释:点赞数, comment_count (bigint(20)) 注释:评论数, share_count (bigint(20)) 注释:分享数, view_count (bigint(20)) 注释:浏览数, create_time (bigint(20)) 注释:内容发布时间, tag_list (longtext) 注释:标签列表, extra_data (longtext) 注释:额外平台特定数据(JSON格式), source_keyword (varchar(255)) 注释:搜索来源关键字, plid (int(11)) 注释:项目ID, add_ts (bigint(20)) 注释:记录添加时间戳, last_modify_ts (bigint(20)) 注释:记录最后修改时间戳, crawler_time (bigint(20)) 注释:爬取时间戳, btype (int(11))
模块具体文件功能及位置如下
Model模型文件:application/admin/model/crawler/content.php
控制器文件:application/admin/controller/crawler/content.php
外部调用js文件:public/assets/js/backend/crawler/content.js
请将js代码都写在外部调用文件里:public/assets/js/backend/crawler/content.js列表对应的html文件:
application/admin/view/crawler/content/index.html
添加对应的html文件:application/admin/view/crawler/content/add.html
修改对应的html文件:application/admin/view/crawler/content/edit.html
请将数据表 fa_crawler_weibo_note替换成数据表weibo_note 导入fa_crawler_content数据表
weibo_note数据表的字段:
id 自增ID user_id 用户ID nickname 用户昵称 avatar 用户头像地址 gender 用户性别 profile_url 用户主页地址 ip_location add_ts 记录添加时间戳 last_modify_ts 记录最后修改时间戳 note_id 帖子ID content 帖子正文内容 create_time 帖子发布时间戳 create_date_time 帖子发布日期时间 liked_count 帖子点赞数 comments_count 帖子评论数量 shared_count 帖子转发数量 note_url 帖子详情URL source_keyword 搜索来源关键字
fa_crawler_weibo_note数据表结构
对应的字段:
id 自增ID user_id 用户ID nickname 用户昵称 avatar 用户头像地址 gender 用户性别 profile_url 用户主页地址 ip_location add_ts 记录添加时间戳 last_modify_ts 记录最后修改时间戳 note_id 帖子ID content 帖子正文内容 create_time 帖子发布时间戳 create_date_time 帖子发布日期时间 liked_count 帖子点赞数 comments_count 帖子评论数量 shared_count 帖子转发数量 note_url 帖子详情URL source_keyword 搜索来源关键字 plid crawler_time isout 是否已导出
fa_crawler_content数据表结构
id 自增主键 platform 平台(bilibili/douyin/tieba/weibo/xhs/zhihu) content_id 内容唯一标识 content_type 内容类型 title 标题 desc 描述/正文内容 content_url 内容链接 cover_url 封面图链接 user_id 用户ID sec_uid user_nickname 用户昵称 user_avatar 用户头像 user_link 用户主页链接 ip_location IP地理位置 liked_count 点赞数 comment_count 评论数 share_count 分享数 view_count 浏览数 create_time 内容发布时间 tag_list 标签列表 extra_data 额外平台特定数据(JSON格式) source_keyword 搜索来源关键字 plid 项目ID add_ts 记录添加时间戳 last_modify_ts 记录最后修改时间戳 crawler_time 爬取时间戳 btype
另外weibo_note数据表不带表前缀。但fastadmin会自动加'fa_'前缀,请特殊处理。



