Why is it so difficult to understand a complex function? in this post, we finally edited getWebList (array (web_show & gt; 1, web_page & gt; & nbsp; array (like, $ web_page. %); ------------ it is so difficult to understand a complex function.
This post was last edited by tp_2015_6 at 09:09:38 on
GetWebList (array ('web _ show '=> 1, 'Web _ page' => array ('like', $ web_page.' % ')));
------------- Beautiful split line -----------------
/**
* Read record list
*
* @ Param
* @ Return array returned results in array format
*/
Public function getWebList ($ condition = array ('web _ page' => 'index'), $ page = ''){
$ Result = $ this-> table ('web')-> where ($ condition)-> order ('web _ sort ')-> page ($ page) -> select ();
// Print_r ($ result );
Return $ result;
}
-------------- Gorgeous split line ----------------
The parameters corresponding to the above color cannot be understood, especially web_page '=> array ('like', $ web_page. '%') %, which is dizzy. what does the author want to express?
------ Solution ----------------------
Array ('like', $ web_page. '%') does not appear in the code you post, so your problem is somewhat untitled.
However, in the form of arrays, this should be the parameter format encapsulated by ORDBMS and eventually translated into the linke 'xxxx % 'clause of the SQL command.