How does TinkPHP + EasyUI and json condition query the database? Thank you!
href:'/index.php/Article/sblog/id/'+idd,
// $ Json is a NULL output template. When the value is 1, the list data is output to the front end. the format is Jsonpublic function sblog ($ json = NULL, $ id = NULL) {if (! Is_int (int) $ json) {$ json = NULL;} // dump ($ id); the ID is 16if ($ json = 1) {$ sblog = M ('sbly _ table'); // $ id = intval ($ id); // $ info = $ sblog-> order ('Id desc ') -> where ('lj _ sbid = '. $ id)-> select (); $ info = $ sblog-> order ('Id desc')-> select (); $ new_info = array (); foreach ($ info as $ t) {if ($ t ['lj _ ly_zt '] = 1) {$ t ['lj _ ly_zt'] = 'enable ';} else {$ t ['lj _ ly_zt '] = 'shutdown';} $ new_info [] = $ t;} echo json_encode ($ new_info); unset ($ sblog, $ info, $ new_info);} else {$ this-> display ();} unset ($ Public );}
When $ json = 1, the following three items are output:
[{"Id": "38", "user_id": "1", "title": "001", "lj_sbid": "16" },{ "id ": "36", "user_id": "1", "title": "002", "lj_sbid": "18 "},
{"Id": "34", "user_id": "1", "title": "003", "lj_sbid": "17"}]