再建议你使用SQL语句,在后端做文章,这样的话如果你出现另一种状态话,不用修改程序,只要改一下SQL语句就好啦;语句如下:
elect id,
CASE type WHEN '1' THEN '全部' else case password when '2' then'按次授权' else '按时间授权'end end as typetable
elect id,
CASE type WHEN '1' THEN '全部' else case password when '2' then'按次授权' else '按时间授权'end end as typetable
elect id,
CASE type WHEN '1' THEN '全部' else case password when '2' then'按次授权' else '按时间授权'end end as type
from table
select id,
CASE type WHEN '1' THEN '全部' else case typewhen '2' then'按次授权' else '按时间授权'end end as type
from table