本文整理汇总了PHP中get_good_products函数的典型用法代码示例。如果您正苦于以下问题:PHP get_good_products函数的具体用法?PHP get_good_products怎么用?PHP get_good_products使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_good_products函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_good_products_select
/**
* 取商品的下拉框Select列表
*
* @param int $goods_id 商品id
*
* @return array
*/
function get_good_products_select($goods_id)
{
$return_array = array();
$products = get_good_products($goods_id);
if (empty($products)) {
return $return_array;
}
foreach ($products as $value) {
$return_array[$value['product_id']] = $value['goods_attr_str'];
}
return $return_array;
}
开发者ID:YangZeSummer,项目名称:NanJingSecond-Hand,代码行数:19,代码来源:lib_common.php
示例2: elseif
} elseif ($_REQUEST['act'] == 'search_goods') {
check_authz_json('auction');
include_once ROOT_PATH . 'includes/cls_json.php';
$json = new JSON();
$filter = $json->decode($_GET['JSON']);
$arr['goods'] = get_goods_list($filter);
if (!empty($arr['goods'][0]['goods_id'])) {
$arr['products'] = get_good_products($arr['goods'][0]['goods_id']);
}
make_json_result($arr);
} elseif ($_REQUEST['act'] == 'search_products') {
include_once ROOT_PATH . 'includes/cls_json.php';
$json = new JSON();
$filters = $json->decode($_GET['JSON']);
if (!empty($filters->goods_id)) {
$arr['products'] = get_good_products($filters->goods_id);
}
make_json_result($arr);
}
/*
* 取得拍卖活动列表
* @return array
*/
function auction_list()
{
$result = get_filter();
if ($result === false) {
/* 过滤条件 */
$filter['keyword'] = empty($_REQUEST['keyword']) ? '' : trim($_REQUEST['keyword']);
if (isset($_REQUEST['is_ajax']) && $_REQUEST['is_ajax'] == 1) {
$filter['keyword'] = json_str_iconv($filter['keyword']);
开发者ID:xiaoxiaowu007,项目名称:jicai,代码行数:31,代码来源:auction.php
示例3: ecs_header
ecs_header("Location: {$page}\n");
exit;
}
$result = get_snatch_result($id);
if ($_SESSION['user_id'] != $result['user_id']) {
show_message($_LANG['not_for_you']);
}
//检查是否已经购买过
if ($result['order_count'] > 0) {
show_message($_LANG['order_placed']);
}
/* 处理规格属性 */
$goods_attr = '';
$goods_attr_id = '';
if ($snatch['product_id'] > 0) {
$product_info = get_good_products($snatch['goods_id'], 'AND product_id = ' . $snatch['product_id']);
$goods_attr_id = str_replace('|', ',', $product_info[0]['goods_attr']);
$attr_list = array();
$sql = "SELECT a.attr_name, g.attr_value " . "FROM " . $ecs->table('goods_attr') . " AS g, " . $ecs->table('attribute') . " AS a " . "WHERE g.attr_id = a.attr_id " . "AND g.goods_attr_id " . db_create_in($goods_attr_id);
$res = $db->query($sql);
while ($row = $db->fetchRow($res)) {
$attr_list[] = $row['attr_name'] . ': ' . $row['attr_value'];
}
$goods_attr = join('', $attr_list);
} else {
$snatch['product_id'] = 0;
}
/* 清空购物车中所有商品 */
include_once ROOT_PATH . 'includes/lib_order.php';
clear_cart(CART_SNATCH_GOODS);
/* 加入购物车 */
开发者ID:dw250100785,项目名称:ECShop-1,代码行数:31,代码来源:snatch.php
示例4: COUNT
/* 检查活动重名 */
$sql = "SELECT COUNT(*) " . " FROM " . $hhs->table('goods_activity') . " WHERE act_type='" . GAT_PACKAGE . "' AND act_name='{$val}' AND act_id <> '{$id}'";
if ($db->getOne($sql)) {
make_json_error(sprintf($_LANG['package_exist'], $val));
}
$exc->edit("act_name='{$val}'", $id);
make_json_result(stripslashes($val));
} elseif ($_REQUEST['act'] == 'search_goods') {
include_once ROOT_PATH . 'includes/cls_json.php';
$json = new JSON();
$filters = $json->decode($_GET['JSON']);
$arr = get_goods_list($filters);
$opt = array();
foreach ($arr as $key => $val) {
$opt[$key] = array('value' => $val['goods_id'], 'text' => $val['goods_name'], 'data' => $val['shop_price']);
$opt[$key]['products'] = get_good_products($val['goods_id']);
}
make_json_result($opt);
} elseif ($_REQUEST['act'] == 'add_package_goods') {
include_once ROOT_PATH . 'includes/cls_json.php';
$json = new JSON();
check_authz_json('package_manage');
$fittings = $json->decode($_GET['add_ids']);
$arguments = $json->decode($_GET['JSON']);
$package_id = $arguments[0];
$number = $arguments[1];
foreach ($fittings as $val) {
$val_array = explode('_', $val);
if (!isset($val_array[1]) || $val_array[1] <= 0) {
$val_array[1] = 0;
}
开发者ID:shiruolin,项目名称:hzzshop,代码行数:31,代码来源:package.php
示例5: show_message
/* 查询:是否登录 */
$user_id = $_SESSION['user_id'];
if ($user_id <= 0) {
show_message($_LANG['au_buy_after_login']);
}
/* 查询:最后出价的是该用户吗 */
if ($auction['last_bid']['bid_user'] != $user_id) {
show_message($_LANG['au_final_bid_not_you'], '', '', 'error');
}
/* 查询:取得商品信息 */
$goods = goods_info($auction['goods_id']);
/* 查询:处理规格属性 */
$goods_attr = '';
$goods_attr_id = '';
if ($auction['product_id'] > 0) {
$product_info = get_good_products($auction['goods_id'], 'AND product_id = ' . $auction['product_id']);
$goods_attr_id = str_replace('|', ',', $product_info[0]['goods_attr']);
$attr_list = array();
$sql = "SELECT a.attr_name, g.attr_value " . "FROM " . $ecs->table('goods_attr') . " AS g, " . $ecs->table('attribute') . " AS a " . "WHERE g.attr_id = a.attr_id " . "AND g.goods_attr_id " . db_create_in($goods_attr_id);
$res = $db->query($sql);
while ($row = $db->fetchRow($res)) {
$attr_list[] = $row['attr_name'] . ': ' . $row['attr_value'];
}
$goods_attr = join(chr(13) . chr(10), $attr_list);
} else {
$auction['product_id'] = 0;
}
/* 清空购物车中所有拍卖商品 */
include_once ROOT_PATH . 'includes/lib_order.php';
clear_cart(CART_AUCTION_GOODS);
/* 加入购物车 */
开发者ID:xiaoxiaowu007,项目名称:jicai,代码行数:31,代码来源:auction.php
示例6: buy
/**
* 购买商品
*/
public function buy()
{
if (empty($this->id)) {
$this->redirect(url('Snatch/info', array('id' => $this->id)));
exit;
}
if (empty($_SESSION['user_id'])) {
show_message(L('not_login'));
}
$snatch = model('Snatch')->get_snatch($this->id);
if (empty($snatch)) {
$this->redirect(url('index', array('id' => $this->id)));
exit;
}
/* 未结束,不能购买 */
if (empty($snatch['is_end'])) {
$this->redirect(url('index', array('id' => $this->id)));
exit;
}
$result = model('ActivityBase')->get_snatch_result($this->id);
if ($_SESSION['user_id'] != $result['user_id']) {
show_message(L('not_for_you'));
}
//检查是否已经购买过
if ($result['order_count'] > 0) {
show_message(L('order_placed'));
}
/* 处理规格属性 */
$goods_attr = '';
$goods_attr_id = '';
if ($snatch['product_id'] > 0) {
$product_info = get_good_products($snatch['goods_id'], 'AND product_id = ' . $snatch['product_id']);
$goods_attr_id = str_replace('|', ',', $product_info[0]['goods_attr']);
$attr_list = array();
$sql = "SELECT a.attr_name, g.attr_value " . "FROM " . $this->model->pre . "goods_attr AS g, " . $this->model->pre . "attribute AS a " . "WHERE g.attr_id = a.attr_id " . "AND g.goods_attr_id " . db_create_in($goods_attr_id);
$res = $this->model->query($sql);
foreach ($res as $row) {
$attr_list[] = $row['attr_name'] . ': ' . $row['attr_value'];
}
$goods_attr = join('', $attr_list);
} else {
$snatch['product_id'] = 0;
}
/* 清空购物车中所有商品 */
model('Order')->clear_cart(CART_SNATCH_GOODS);
/* 加入购物车 */
$cart = array('user_id' => $_SESSION['user_id'], 'session_id' => SESS_ID, 'goods_id' => $snatch['goods_id'], 'product_id' => $snatch['product_id'], 'goods_sn' => addslashes($snatch['goods_sn']), 'goods_name' => addslashes($snatch['goods_name']), 'market_price' => $snatch['market_price'], 'goods_price' => $result['buy_price'], 'goods_number' => 1, 'goods_attr' => $goods_attr, 'goods_attr_id' => $goods_attr_id, 'is_real' => $snatch['is_real'], 'extension_code' => addslashes($snatch['extension_code']), 'parent_id' => 0, 'rec_type' => CART_SNATCH_GOODS, 'is_gift' => 0);
$this->model->table('cart')->data($cart)->insert();
/* 记录购物流程类型:夺宝奇兵 */
$_SESSION['flow_type'] = CART_SNATCH_GOODS;
$_SESSION['extension_code'] = 'snatch';
$_SESSION['extension_id'] = $this->id;
/* 进入收货人页面 */
$this->redirect(url('flow/consignee'));
exit;
}
开发者ID:m7720647,项目名称:demo,代码行数:59,代码来源:SnatchController.class.php
注:本文中的get_good_products函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论