表saj_iot_payment新增数据中把PAY_TIME字段添加到表saj_iot_order_iotaccount中,条件是saj_iot_order_iotaccount的order_id和saj_iot_payment的order_no对应
DELIMITER $$
USE `sajsite`$$
DROP TRIGGER /*!50032 IF EXISTS */ `updatepaydate`$$
CREATE
/*!50017 DEFINER = 'saj'@'%' */
TRIGGER `updatepaydate` AFTER INSERT ON `saj_iot_payment`
FOR EACH ROW BEGIN
update
`saj_iot_order_iotaccount`
set
pay_time =new.PAY_TIME
where
order_id = new.ORDER_NO;
END;
$$
DELIMITER ;