Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

场景大概是这样的,数据库有字段A,B,然后C = A - B ,而D是根据C的值来判断显示,C和D都不是数据库字段,问题在于我的模板使用了Ajax,本来可以直接在模板判断C的值,但是这样暴露了C这个重要条件,有没有办法在php内实现呢?tp能对数据集进行二次筛选吗?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
360 views
Welcome To Ask or Share your Answers For Others

1 Answer

你的意思是不要显露C,想直接显示D ?
尽量直接在数据库查询的时候就把D计算出来,如果不行,则在php返回结果之前用foreach处理一下数据。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...