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; }
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; }
/** * 取得商品列表:用于把商品添加到组合、关联类、赠品类 * @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; }
/** * 取得商品列表:用于把商品添加到组合、关联类、赠品类 * @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; }
/** * 生成商品导出过滤条件 * * @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; }
/** * 取得商品列表:用于把商品添加到组合、关联类、赠品类 * * @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; }