为了得到optid,需要修改视图v_culture_hd
DELIMITER $$
USE `jnwhfwpt`$$
DROP VIEW IF EXISTS `v_culture_hd`$$
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `jnwhfwpt`.`v_culture_hd` AS
SELECT CONCAT('gzl@',`jnwhfwpt`.`m_cultureact_gzl`.`msgCode`) AS `msgCode`,
`jnwhfwpt`.`m_cultureact_gzl`.`sender` AS `sender`,
`jnwhfwpt`.`m_cultureact_gzl`.`sendeDate` AS `sendeDate`,
`jnwhfwpt`.`m_cultureact_gzl`.`msgTitle` AS `msgTitle`,
`jnwhfwpt`.`m_cultureact_gzl`.`msgType` AS `msgType`,
`jnwhfwpt`.`m_cultureact_gzl`.`msgContent` AS `msgContent`,
`jnwhfwpt`.`m_cultureact_gzl`.`shCode` AS `shCode`,
`jnwhfwpt`.`m_cultureact_gzl`.`shDate` AS `shDate`,
`jnwhfwpt`.`m_cultureact_gzl`.`shState` AS `shState`,
`jnwhfwpt`.`m_cultureact_gzl`.`shContent` AS `shContent`,
`jnwhfwpt`.`m_cultureact_gzl`.`unitcode` AS `unitcode`,
`jnwhfwpt`.`m_cultureact_gzl`.`showstate` AS `showstate`,
`jnwhfwpt`.`m_cultureact_gzl`.`content_note` AS `content_note`,
`jnwhfwpt`.`m_cultureact_gzl`.`img` AS `img`,
`jnwhfwpt`.`m_cultureact_gzl`.`imgtype` AS `imgtype`,
`jnwhfwpt`.`m_cultureact_gzl`.`imgfilename` AS `imgfilename`,
'观展览' AS `lmname` ,
'WHHDGLGZL' AS `optid`
FROM `jnwhfwpt`.`m_cultureact_gzl`
UNION ALL
SELECT CONCAT('kyc@',`jnwhfwpt`.`m_cultureact_kyc`.`msgCode`) AS `msgCode`,
`jnwhfwpt`.`m_cultureact_kyc`.`sender` AS `sender`,
`jnwhfwpt`.`m_cultureact_kyc`.`sendeDate` AS `sendeDate`,
`jnwhfwpt`.`m_cultureact_kyc`.`msgTitle` AS `msgTitle`,
`jnwhfwpt`.`m_cultureact_kyc`.`msgType` AS `msgType`,
`jnwhfwpt`.`m_cultureact_kyc`.`msgContent` AS `msgContent`,
`jnwhfwpt`.`m_cultureact_kyc`.`shCode` AS `shCode`,
`jnwhfwpt`.`m_cultureact_kyc`.`shDate` AS `shDate`,
`jnwhfwpt`.`m_cultureact_kyc`.`shState` AS `shState`,
`jnwhfwpt`.`m_cultureact_kyc`.`shContent` AS `shContent`,
`jnwhfwpt`.`m_cultureact_kyc`.`unitcode` AS `unitcode`,
`jnwhfwpt`.`m_cultureact_kyc`.`showstate` AS `showstate`,
`jnwhfwpt`.`m_cultureact_kyc`.`content_note` AS `content_note`,
`jnwhfwpt`.`m_cultureact_kyc`.`img` AS `img`,
`jnwhfwpt`.`m_cultureact_kyc`.`imgtype` AS `imgtype`,
`jnwhfwpt`.`m_cultureact_kyc`.`imgfilename` AS `imgfilename`,
'看演出' AS `lmname` ,
'WHHDGLKYC' AS `optid`
FROM `jnwhfwpt`.`m_cultureact_kyc`
$$
DELIMITER ;
页面要显示三种状态:订票(灰色的,不可点击),订票(可以点击进行订票),已订(点击查看订票详情)