生成系列数(1、2、3 ... N)应用实例

来源:互联网 发布:js获取input file路径 编辑:程序博客网 时间:2024/05/16 14:02

取系列数@{sn:favorite},放到书包doc中

<bag id=doc><we name=we_id>@{sn:favorite}</we></bag>
如果系列数@{doc:we_id}为空,则查询favorite_base表的主键we_id字段的最大值初始化@{sn:favorite=@{pk:favorite_id}}系列数
<if x="@{doc:we_id}"><we><esql module=base id=pk commit=true>Select max(WE_ID) as favorite_id from favorite_base</esql><bag id=doc><we name=we_id>@{sn:favorite=@{pk:favorite_id}}</we></bag></we></if>
把系统数及相关内容分别插入favorite_basefavorite_user表中

<ESql module=base act=edit commit=true>Insert Into favorite_base(we_id,title,words,content,words_content)Values(@{doc:we_id:int},@{pPage:title:string},@{pPage:words:string},@{pPage:content:memo},@{pPage:words_content:memo})</ESql><bag id=pPage><we name=content1>@{intLeft:@{pPage:content1}(580)}</we></bag><ESql module=base act=edit>Insert Into favorite_user(f_id,author,tree_id,ondate,memo)Values('@{doc:we_id}','@{session:user_id}','@{pPage:n}','@{sys:date}',@{pPage:content1:memo})</ESql>
完整代码
<html><chtml><if x="@{session:user_id}" else=1><script>alert("请先登录!");top.location.href="@{sys:path}";</script><we><bag id=doc><we name=we_id>@{sn:favorite}</we></bag><if x="@{doc:we_id}"><we><esql module=base id=pk commit=true>Select max(WE_ID) as favorite_id from favorite_base</esql><bag id=doc><we name=we_id>@{sn:favorite=@{pk:favorite_id}}</we></bag></we></if><!-- 分词 --><call>doc2words</call><ESql module=base act=edit commit=true>Insert Into favorite_base(we_id,title,words,content,words_content)Values(@{doc:we_id:int},@{pPage:title:string},@{pPage:words:string},@{pPage:content:memo},@{pPage:words_content:memo})</ESql><bag id=pPage><we name=content1>@{intLeft:@{pPage:content1}(580)}</we></bag><ESql module=base act=edit>Insert Into favorite_user(f_id,author,tree_id,ondate,memo)Values('@{doc:we_id}','@{session:user_id}','@{pPage:n}','@{sys:date}',@{pPage:content1:memo})</ESql><to>@{sys:path}@{sys:curPath}blogs.html?n=@{pPage:n}&myid=@{session:user_id}</to></we></if></chtml></html><chtml file="htm/doc2words.htm" onlycall id=doc2words />
文件(blog_add_save.chtml)在轻开B2C电子商务网站的site/blog目录下,结合相关文件实际体验一下吧微笑

轻松互联网开发平台(Easy Do IT)资源下载

平台及最新开发手册免费下载:http://download.csdn.net/detail/tx18/8464425

开发实例:轻开B2C电子商务网站,免费下载:http://download.csdn.net/detail/tx18/8318585

轻开平台会不定期升级为大家提供更多强大而Easy的功能,请留意下载最新的版本


6 4
原创粉丝点击