Ask the tp experts to see why the css on the template cannot be changed through the status value in the database. Is there any good way? Indicates that the font and icon are displayed in red during review, and the font and icon are displayed in black after deletion. The attached code is as follows:
If ($ info = M ("handmebuyinfo") {$ row = $ info-> where ("username = '$ username'")-> select (); // dump ($ row [1] [status]); $ this-> assign ('info', 'purchase '); if ($ row [0] [status] = 'under review ') {$ this-> assign (color,' # DC143C ');} if ($ row [0] [status] = 'delete') {$ this-> assign (color, 'black ');}}
{$vo.status}
Reply to discussion (solution)
From the displayed three rows, we can infer that $ row is an array of 3 rows and n columns.
Therefore, color should also be an array of three elements.
From the displayed three rows, we can infer that $ row is an array of 3 rows and n columns.
Therefore, color should also be an array of three elements.
Yes. $ row [0] [status] only outputs the status value of the first record. do you want to output color cyclically?
The logic of your code is that if the first piece of data is under review, all states are set to red; otherwise, all are set to black.
{$ Vo. status}
{$ Vo. status}
This method is good .. Thank you.