一个复杂函数的理解为啥就这么难

WBOY
Release: 2016-06-23 13:33:07
Original
1076 people have browsed it

getWebList(array( 'web_show'=>1, 'web_page'=> array('like',$web_page.'%')));

-------------美丽分割线-----------------

/**
 * 读取记录列表
 *
 * @param
 * @return array 数组格式的返回结果
 */
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;
                
}
--------------华丽的分割线----------------
上面颜色对应处的参数实在是理解不了,尤其是web_page'=> array('like',$web_page.'%'))中的%,看着让人头晕,作者想表达啥?


回复讨论(解决方案)

array('like',$web_page.'%') 并未在你贴出的代码中出现,所以你的问题有点无厘头
不过就数组的形式上看,这应该是 ORDBMS 封装的参数格式,最终被翻译成 SQL 指令的 linke 'XXXX%'  子句

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template