thinkphp模糊查询实例
来源:互联网 发布:算法的概念数学 编辑:程序博客网 时间:2024/05/17 06:51
前端:
样式随便放
<style type="text/css">
.searchinput{
border-right-width: 0px;
padding-left: 3px;
width: 168px;
font-family: arial;
float: left;
border-top-width: 0px;
border-bottom-width: 0px;
color: #636365;
margin-left: 4px;
font-size: 8pt;
vertical-align: middle;
border-left-width: 0px;
margin-right: 3px;
}
.tab_search{
border-bottom: #cccccc 1px solid;
border-left: #cccccc 1px solid;
height: 25px;
border-top: #cccccc 1px solid;
border-right: #cccccc 1px solid;
}
.searchaction{
width: 21px;
float: left;
height: 17px;
}
</style>
下面是form表单
<form action="{:U('Admin/Statistics/money_list')}" name="search" method="post">
<table border="0" align="center" cellpadding="0" cellspacing="0" class="tab_search">
<tr>
<td>
<input type="text" title="Search" class="searchinput" id="searchinput" onkeydown="if (event.keyCode==13) {}" onblur="if(this.value=='')value='- 按订单号或用户名查询 -';" onfocus="if(this.value=='- 按订单号或用户名查询 -')value='';" value="- 按订单号或用户名查询 -" size="10" name="search"/>
</td>
<td>
<input type="image" width="21" height="17" class="searchaction" onclick="if(document.forms['search'].searchinput.value=='- 按订单号或用户名查询 -')document.forms['search'].searchinput.value='';" alt="Search" src="__PUBLIC__/assets/Admin/images/magglass.gif" border="0" hspace="2"/>
</td>
</tr>
</table>
</form>
后台:
//得到所有的竞价列表
public function money_list(){
$demo=M("chuanbo");
$money_list=$demo->table('bo_account_log a,bo_user b')->where("a.user_id=b.id")->order('a.id desc' )->select();
$search = I("post.search");
if(IS_POST){
$where['order_no'] = array('like','%'.$search.'%');
$money_list =$demo->table('bo_account_log a,bo_user b')->where("a.user_id=b.id and (a.order_no like '%$search%' or user_name like '%$search%') ")->select();
}else{
$money_list=$demo->table('bo_account_log a,bo_user b')->where("a.user_id=b.id")->order('a.id desc' )->select();
}
$user=M("user");
$this->assign('money_list',$money_list);
$this->display();
}
}
- thinkphp模糊查询实例
- thinkphp怎么做模糊查询搜索,完整实例,笨办法
- thinkphp 模糊查询组合
- thinkphp模糊查询
- thinkphp多条件模糊查询
- thinkphp多字段模糊查询
- ThinkPHP多字段匹配模糊查询
- ThinkPHP多字段匹配模糊查询
- php模糊查询实例代码
- MyBatis动态查询 模糊查询实例sql
- 【ThinkPHP】表达式查询、模糊查询、多匹配查询、between查询、in查询
- thinkphp表达式方式,模糊,区间,多形式查询
- thinkPHP模糊查询语句like组合写法其中一种
- thinkphp怎么like模糊查询数据库的信息curd操作
- 关于前台模糊查询处理实例
- LINQ模糊查询应用实例分析
- ThinkPHP多表联合查询实例代码
- Hibernate Expression 模糊查询实例 带有关联的模糊查询实例
- wireshark怎么抓包、wireshark抓包详细图文教程
- Python-namedtuple,enum
- poj 迷宫问题(路径记录)(DFS,BFS)
- 简化查询
- RDD操作
- thinkphp模糊查询实例
- HTML5 <fullscreen全屏API>
- Bitmap详解
- es5 javascript this的使用
- Windows下获取当前路径和执行路径
- 完全掌握Android Data Binding
- 常用 SQL Server 规范集锦
- Bounding box regression(回归)
- sql优化大全