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

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


评论 19
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值