帝国CMS批量提取新闻正文内容第一张图片作为标题默认缩略图
2025-01-18
以下是帝国 CMS 批量提取新闻正文内容第一张图片作为标题默认缩略图的 SQL 语句
后台-系统-备份与恢复数据-执行sql语句
UPDATE phome_ecms_news JOIN phome_ecms_news_data_1 ON phome_ecms_news.id = phome_ecms_news_data_1.id SET phome_ecms_news.titlepic = (select reverse(substring(reverse(substring_index(substring(newstext,locate('src=',newstext)+6),'',1)),2,255)) from phome_ecms_news_data_1 where id=phome_ecms_news.id) WHERE phome_ecms_news.titlepic='';
记得修改数据表名
UPDATE phome_ecms_news SET ispic=1 WHERE titlepic<>'';
声明:本文来自用户分享和网络收集,仅供学习与参考,测试请备份。