最上面的没加new.lendtime,如下
set NEW.shouldrtime = (24*60*60*(select setltime from user where user.uid = NEW.userid)
加了 (unix_timestamp(new.lendtime))就变NULL了,shouldrtime换了timestamp类型也没用。。
求助。。
...全文
1552打赏收藏
触发器里的一个问题
想做个到期时间计算的触发器来着。。 两个表 触发器通过看user的类型判断借书时长,然后加上当前时间算到期时间 结果shouldrtime显示NULL 最上面的没加new.lendtime,如下 set NEW.shouldrtime = (24*60*60*(select setltime from user where user.uid = NEW.userid) 加了 (unix_timestamp(new.lendtime))就变NULL了,shouldrtime换了timestamp类