码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2015-05-09 01:23:17      阅读:139      评论:0      收藏:0      [点我收藏+]

标签:生成系列数   web开发   互联网   电子商务   实例   

取系列数@{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的功能,请留意下载最新的版本


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

标签:生成系列数   web开发   互联网   电子商务   实例   

原文地址:http://blog.csdn.net/tx18/article/details/45588537

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!