来源:自学PHP网 时间:2015-04-17 11:59 作者: 阅读:次
[导读] function _get_conditions() { /* 搜索条件 */ $conditions = 1 = 1; if (trim($_GET[#39;keyword#39;])) { $str = LIKE #39;% . trim($_GET[#......
function _get_conditions()
{
/* 搜索条件 */
$conditions = "1 = 1";
if (trim($_GET['keyword']))
{
$str = "LIKE '%" . trim($_GET['keyword']) . "%'";
$conditions .= " AND (goods_name {$str} OR brand {$str} OR cate_name {$str})";
echo $conditions;
exit;
}
if ($_GET['character'])
{
switch ($_GET['character'])
{
case 'show':
$conditions .= " AND if_show = 1";
break;
case 'hide':
$conditions .= " AND if_show = 0";
break;
case 'closed':
$conditions .= " AND closed = 1";
break;
case 'recommended':
$conditions .= " AND g.recommended = 1";
break;
}
}
return $conditions;
}
在my_goods.app.php文件里面,申请开启网店。
大家一看就知道。
来张图。
|
自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习
京ICP备14009008号-1@版权所有www.zixuephp.com
网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com