本文整理汇总了PHP中get_where_sql函数的典型用法代码示例。如果您正苦于以下问题:PHP get_where_sql函数的具体用法?PHP get_where_sql怎么用?PHP get_where_sql使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_where_sql函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_quotation_where
function get_quotation_where($filter)
{
include_once ROOT_PATH . ADMIN_PATH . '/includes/lib_main.php';
$_filter = new StdClass();
$_filter->cat_id = $filter['cat_id'];
$_filter->brand_id = $filter['brand_id'];
$_filter->keyword = $filter['keyword'];
$where = get_where_sql($_filter);
return $where;
}
示例2: get_quotation_where
function get_quotation_where($filter)
{
include_once ROOT_PATH . ADMIN_PATH_M . '/includes/lib_main.php';
$_filter = new StdClass();
$_filter->cat_id = $filter['cat_id'];
$_filter->brand_id = $filter['brand_id'];
$where = get_where_sql($_filter);
$_filter->keyword = $filter['keyword'];
$where .= isset($_filter->keyword) && trim($_filter->keyword) != '' ? " AND (g.goods_name LIKE '%" . mysql_like_quote($_filter->keyword) . "%' OR g.goods_sn LIKE '%" . mysql_like_quote($_filter->keyword) . "%' OR g.goods_id LIKE '%" . mysql_like_quote($_filter->keyword) . "%') " : '';
return $where;
}
示例3: get_goods_list
/**
* 取得商品列表:用于把商品添加到组合、关联类、赠品类
* @param object $filters 过滤条件
*/
function get_goods_list($filter)
{
$filter->keyword = json_str_iconv($filter->keyword);
$where = get_where_sql($filter);
// 取得过滤条件
/* 取得数据 */
$sql = 'SELECT goods_id, goods_name, shop_price ' . 'FROM ' . $GLOBALS['ecs']->table('goods') . ' AS g ' . $where . 'LIMIT 50';
$row = $GLOBALS['db']->getAll($sql);
return $row;
}
示例4: get_goods_list
/**
* 取得商品列表:用于把商品添加到组合、关联类、赠品类
* @param object $filters 过滤条件
*/
function get_goods_list($filter)
{
$filter->keyword = json_str_iconv($filter->keyword);
$where = get_where_sql($filter);
// 取得过滤条件
$suppid = isset($_GET['suppId']) && intval($_GET['suppId']) > 0 ? intval($_GET['suppId']) : $_SESSION['supplier_id'];
$where .= ' AND sgc.supplier_id=' . $suppid . ' group by g.goods_id ';
/* 取得数据 */
// $sql = 'SELECT goods_id, goods_name, shop_price '.
// 'FROM ' . $GLOBALS['ecs']->table('goods') . ' AS g ' . $where .
// 'LIMIT 50';
$sql = 'select g.goods_id,g.goods_name,g.shop_price ' . 'from ' . $GLOBALS['ecs']->table('supplier_goods_cat') . 'as sgc ' . 'left join ' . $GLOBALS['ecs']->table('goods') . 'as g on sgc.goods_id = g.goods_id' . $where . 'LIMIT 50';
$row = $GLOBALS['db']->getAll($sql);
return $row;
}
示例5: get_export_where_sql
/**
* 生成商品导出过滤条件
*
* @param array $filter 过滤条件数组
*
* @return string
*/
function get_export_where_sql($filter)
{
$where = '';
if (!empty($filter['goods_ids'])) {
$goods_ids = explode(',', $filter['goods_ids']);
if (is_array($goods_ids) && !empty($goods_ids)) {
$goods_ids = array_unique($goods_ids);
$goods_ids = "'" . implode("','", $goods_ids) . "'";
} else {
$goods_ids = "'0'";
}
$where = " WHERE g.is_delete = 0 AND g.goods_id IN (" . $goods_ids . ") ";
} else {
$_filter = new StdClass();
$_filter->cat_id = $filter['cat_id'];
$_filter->brand_id = $filter['brand_id'];
$_filter->keyword = $filter['keyword'];
$where = get_where_sql($_filter);
}
return $where;
}
示例6: get_goods_list
/**
* 取得商品列表:用于把商品添加到组合、关联类、赠品类
*
* @param object $filters
* 过滤条件
*/
function get_goods_list($filter)
{
$filter->keyword = json_str_iconv($filter->keyword);
$where = get_where_sql($filter);
// 取得过滤条件
/* 取得数据 */
$sql = 'SELECT goods_id, goods_name, shop_price ' . 'FROM ' . M()->pre . 'goods ' . ' AS g ' . $where . 'LIMIT 50';
$row = M()->query($sql);
return $row;
}