1.复制tags字段内容到keyboard,当keyboard为空的时候:
update [!db.pre!]ecms_news_data_1 a, [!db.pre!]ecms_news b set b.keyboard=a.infotags where a.id=b.id and b.keyboard='';
2.添加tags字段内容到keyboard:
update [!db.pre!]ecms_news_data_1 a, [!db.pre!]ecms_news b set b.keyboard=concat(b.keyboard,',',a.infotags) where a.id=b.id and b.keyboard<>'' and a.infotags<>'';
3.如果副表中keyid(相关链接)字段为空,说明keyboard设置不合理,干脆清空,为自动分词扫清障碍
update [!db.pre!]ecms_news_data_1 a, [!db.pre!]ecms_news b set b.keyboard='' where a.id=b.id and a.keyid=''
4.newstext在副表,提取第一张图片为标题图片。当标题图片为空的时候。
update [!db.pre!]ecms_news_data_1 a, [!db.pre!]ecms_news b set b.titlepic=concat(replace(SUBSTRING_INDEX(SUBSTRING_INDEX(a.newstext, '.jpg', 1),'src='https://www.admin5.com/article/20201102/,-1),'"',''),'.jpg') where a.newstext like '%.jpg%' and b.titlepic='' and a.id=b.id;
update [!db.pre!]ecms_news_data_1 a, [!db.pre!]ecms_news b set b.titlepic=concat(replace(SUBSTRING_INDEX(SUBSTRING_INDEX(a.newstext, '.gif', 1),'src='https://www.admin5.com/article/20201102/,-1),'"',''),'.gif') where a.newstext like '%.gif%' and b.titlepic='' and a.id=b.id;
文章转自:黎青松SEO博客
来源地址:http://www.alitaohuo.com/CMSjiaocheng/diguojiaocheng/1685.html
actlink:0
chargetype:0
infopurview:0
pinyin:diguocmschangyongdesqlyuju
readpoint:0
pitchtime:0
dividepercent:0
templateurl:资讯内容.html
filename:news/jzjy/2351
isaccept:0
articleinput:admin
digg:0
down:0
att:0
orderid:10
commentscount:0
kfid:0
biaodanon:0