当前位置: 首页>>代码示例>>PHP>>正文


PHP group_buy_info函数代码示例

本文整理汇总了PHP中group_buy_info函数的典型用法代码示例。如果您正苦于以下问题:PHP group_buy_info函数的具体用法?PHP group_buy_info怎么用?PHP group_buy_info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了group_buy_info函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: operable_list


//.........这里部分代码省略.........
                    }
                }
            }
        } else {
            /* 状态:已确认、已付款和付款中 */
            if (SS_UNSHIPPED == $ss || SS_PREPARING == $ss) {
                /* 状态:已确认、已付款和付款中、未发货(配货中) => 不是货到付款 */
                if ($priv_list['ss']) {
                    if (SS_UNSHIPPED == $ss) {
                        $list['lack_goods'] = true;
                        $list['fast_deliver'] = true;
                        $list['prepare'] = true;
                        // 配货
                    }
                    $list['split'] = true;
                    // 分单
                }
                if ($priv_list['ps']) {
                    $list['unpay'] = true;
                    // 设为未付款
                    if ($priv_list['os']) {
                        $list['cancel'] = true;
                        // 取消
                    }
                }
            } elseif (SS_SHIPPED_ING == $ss || SS_SHIPPED_PART == $ss) {
                // 部分分单
                if (OS_SPLITING_PART == $os) {
                    $list['split'] = true;
                    // 分单
                }
                $list['to_delivery'] = true;
                // 去发货
            } else {
                /* 状态:已确认、已付款和付款中、已发货或已收货 */
                if ($priv_list['ss']) {
                    if (SS_SHIPPED == $ss) {
                        $list['receive'] = true;
                        // 收货确认
                    }
                    if (!$is_cod) {
                        $list['unship'] = true;
                        // 设为未发货
                    }
                }
                if ($priv_list['ps'] && $is_cod) {
                    $list['unpay'] = true;
                    // 设为未付款
                }
                if ($priv_list['os'] && $priv_list['ss'] && $priv_list['ps']) {
                    $list['return'] = true;
                    // 退货(包括退款)
                }
            }
        }
    } elseif (OS_CANCELED == $os) {
        /* 状态:取消 */
        if ($priv_list['os']) {
            $list['confirm'] = true;
        }
        if ($priv_list['edit']) {
            $list['remove'] = true;
        }
    } elseif (OS_INVALID == $os) {
        /* 状态:无效 */
        if ($priv_list['os']) {
            $list['confirm'] = true;
        }
        if ($priv_list['edit']) {
            $list['remove'] = true;
        }
    } elseif (OS_RETURNED == $os) {
        /* 状态:退货 */
        if ($priv_list['os']) {
            $list['confirm'] = true;
        }
    }
    /* 修正发货操作 */
    if (!empty($list['split'])) {
        /* 如果是团购活动且未处理成功,不能发货 */
        if ($order['extension_code'] == 'group_buy') {
            include_once ROOT_PATH . 'includes/lib_goods.php';
            $group_buy = group_buy_info(intval($order['extension_id']));
            if ($group_buy['status'] != GBS_SUCCEED) {
                unset($list['split']);
                unset($list['to_delivery']);
            }
        }
        /* 如果部分发货 不允许 取消 订单 */
        if (order_deliveryed($order['order_id'])) {
            $list['return'] = true;
            // 退货(包括退款)
            unset($list['cancel']);
            // 取消
        }
    }
    /* 售后 */
    $list['after_service'] = true;
    return $list;
}
开发者ID:norain2050,项目名称:benhu,代码行数:101,代码来源:order.php

示例2: integral_to_give

/**
 * 取得某订单应该赠送的积分数
 * @param   array   $order  订单
 * @return  int     积分数
 */
function integral_to_give($order)
{
    /* 判断是否团购 */
    if ($order['extension_code'] == 'group_buy') {
        include_once ROOT_PATH . 'includes/lib_goods.php';
        $group_buy = group_buy_info(intval($order['extension_id']));
        return array('custom_points' => $group_buy['gift_integral'], 'rank_points' => $order['goods_amount']);
    } else {
        $sql = "SELECT SUM(og.goods_number * IF(g.give_integral > -1, g.give_integral, og.goods_price)) AS custom_points, SUM(og.goods_number * IF(g.rank_integral > -1, g.rank_integral, og.goods_price)) AS rank_points " . "FROM " . $GLOBALS['ecs']->table('order_goods') . " AS og, " . $GLOBALS['ecs']->table('goods') . " AS g " . "WHERE og.goods_id = g.goods_id " . "AND og.order_id = '{$order['order_id']}' " . "AND og.goods_id > 0 " . "AND og.parent_id = 0 " . "AND og.is_gift = 0 AND og.extension_code != 'package_buy'";
        return $GLOBALS['db']->getRow($sql);
    }
}
开发者ID:dlpc,项目名称:ecshop,代码行数:17,代码来源:lib_order.php

示例3: isset

    }

    /* 查询:取得参数:团购活动id */
    $group_buy_id = isset($_POST['group_buy_id']) ? intval($_POST['group_buy_id']) : 0;
    if ($group_buy_id <= 0)
    {
        ecs_header("Location: ./\n");
        exit;
    }

    /* 查询:取得数量 */
    $number = isset($_POST['number']) ? intval($_POST['number']) : 1;
    $number = $number < 1 ? 1 : $number;

    /* 查询:取得团购活动信息 */
    $group_buy = group_buy_info($group_buy_id, $number);
    if (empty($group_buy))
    {
        ecs_header("Location: ./\n");
        exit;
    }

    /* 查询:检查团购活动是否是进行中 */
    if ($group_buy['status'] != GBS_UNDER_WAY)
    {
        show_message($_LANG['gb_error_status'], '', '', 'error');
    }

    /* 查询:取得团购商品信息 */
    $goods = goods_info($group_buy['goods_id']);
    if (empty($goods))
开发者ID:blowfishJ,项目名称:galaxyCode,代码行数:31,代码来源:group_buy.php

示例4: shipping_info

 $smarty->assign('cod_disabled', $cod_disabled);
 /* 取得支付列表 */
 if ($order['shipping_id'] == 0) {
     $cod = true;
     $cod_fee = 0;
 } else {
     $shipping = shipping_info($order['shipping_id']);
     $cod = $shipping['support_cod'];
     if ($cod) {
         /* 如果是团购,且保证金大于0,不能使用货到付款 */
         if ($flow_type == CART_GROUP_BUY_GOODS) {
             $group_buy_id = $_SESSION['extension_id'];
             if ($group_buy_id <= 0) {
                 show_message('error group_buy_id');
             }
             $group_buy = group_buy_info($group_buy_id);
             if (empty($group_buy)) {
                 show_message('group buy not exists: ' . $group_buy_id);
             }
             if ($group_buy['deposit'] > 0) {
                 $cod = false;
                 $cod_fee = 0;
                 /* 赋值保证金 */
                 $smarty->assign('gb_deposit', $group_buy['deposit']);
             }
         }
         if ($cod) {
             $shipping_area_info = shipping_area_info($order['shipping_id'], $region);
             $cod_fee = $shipping_area_info['pay_fee'];
         }
     } else {
开发者ID:a494008974,项目名称:bzbshop,代码行数:31,代码来源:order.php

示例5: group_buy_list

/**
 * 取得某页的所有团购活动
 * @param   int     $size   每页记录数
 * @param   int     $page   当前页
 * @return  array
 */
function group_buy_list($size, $page)
{
    /* 取得团购活动 */
    $gb_list = array();
    $now = gmtime();
    $sql = "SELECT b.*, IFNULL(g.goods_thumb, '') AS goods_thumb, b.act_id AS group_buy_id, " . "b.start_time AS start_date, b.end_time AS end_date " . "FROM " . $GLOBALS['ecs']->table('goods_activity') . " AS b " . "LEFT JOIN " . $GLOBALS['ecs']->table('goods') . " AS g ON b.goods_id = g.goods_id " . "WHERE b.act_type = '" . GAT_GROUP_BUY . "' " . "AND b.start_time <= '{$now}' AND b.is_finished < 3 ORDER BY b.act_id DESC";
    $res = $GLOBALS['db']->selectLimit($sql, $size, ($page - 1) * $size);
    while ($group_buy = $GLOBALS['db']->fetchRow($res)) {
        $ext_info = unserialize($group_buy['ext_info']);
        $group_buy = array_merge($group_buy, $ext_info);
        /* 格式化时间 */
        $group_buy['formated_start_date'] = local_date($GLOBALS['_CFG']['time_format'], $group_buy['start_date']);
        $group_buy['formated_end_date'] = local_date($GLOBALS['_CFG']['time_format'], $group_buy['end_date']);
        /* 格式化保证金 */
        $group_buy['formated_deposit'] = price_format($group_buy['deposit'], false);
        /* 处理价格阶梯 */
        $price_ladder = $group_buy['price_ladder'];
        if (!is_array($price_ladder) || empty($price_ladder)) {
            $price_ladder = array(array('amount' => 0, 'price' => 0));
        } else {
            foreach ($price_ladder as $key => $amount_price) {
                $price_ladder[$key]['formated_price'] = price_format($amount_price['price']);
            }
        }
        $group_buy['price_ladder'] = $price_ladder;
        $group_buy_info = group_buy_info($group_buy['group_buy_id']);
        $group_buy['formated_cur_price'] = $group_buy_info['formated_cur_price'];
        $tg = group_buy_stat($group_buy['group_buy_id'], 0);
        $group_buy['num'] = $tg['total_order'];
        /* 处理图片 */
        if (empty($group_buy['goods_thumb'])) {
            $group_buy['goods_thumb'] = get_image_path($group_buy['goods_id'], $group_buy['goods_thumb'], true);
        }
        /* 处理链接 */
        $group_buy['url'] = build_uri('group_buy', array('gbid' => $group_buy['group_buy_id']));
        /* 加入数组 */
        $gb_list[] = $group_buy;
    }
    return $gb_list;
}
开发者ID:seanguo166,项目名称:yinoos,代码行数:46,代码来源:group_buy.php

示例6: checkout


//.........这里部分代码省略.........
	        $shipping_list[$key]['shipping_fee']        = $shipping_fee;
	        $shipping_list[$key]['free_money']          = price_format($shipping_cfg['free_money'], false);
	        $shipping_list[$key]['insure_formated']     = strpos($val['insure'], '%') === false ?
	        price_format($val['insure'], false) : $val['insure'];
	
	        #当前的配送方式是否支持保价
	        if ($val['shipping_id'] == $order['shipping_id'])
	        {
	            $insure_disabled = ($val['insure'] == 0);
	            $cod_disabled    = ($val['support_cod'] == 0);
	        }
	    }
		#取得支付列表
	    if ($order['shipping_id'] == 0)
	    {
	        $cod        = true;
	        $cod_fee    = 0;
	    }
	    else
	    {
	        $shipping = shipping_info($order['shipping_id']);
	        $cod = $shipping['support_cod'];
	
	        if ($cod)
	        {
	            #如果是团购,且保证金大于0,不能使用货到付款
	            if ($flow_type == CART_GROUP_BUY_GOODS)
	            {
	                $group_buy_id = $_SESSION['extension_id'];
	                if ($group_buy_id <= 0)
	                {
	                    show_message('error group_buy_id');
	                }
	                $group_buy = group_buy_info($group_buy_id);
	                if (empty($group_buy))
	                {
	                    show_message('group buy not exists: ' . $group_buy_id);
	                }
	
	                if ($group_buy['deposit'] > 0)
	                {
	                    $cod = false;
	                    $cod_fee = 0;
	
	                    #赋值保证金
	                    $smarty->assign('gb_deposit', $group_buy['deposit']);
	                }
	            }
	
	            if ($cod)
	            {
	                $shipping_area_info = shipping_area_info($order['shipping_id'], $region);
	                $cod_fee            = $shipping_area_info['pay_fee'];
	            }
	        }
	        else
	        {
	            $cod_fee = 0;
	        }
	    }
	    
	
	    # 给货到付款的手续费加<span id>,以便改变配送的时候动态显示
	    $payment_list = available_payment_list(1, $cod_fee);
	    if(isset($payment_list))
	    {
开发者ID:noikiy,项目名称:mdwp,代码行数:67,代码来源:flow.action.php

示例7: ecs_header

 if (!empty($_REQUEST['goods_id']) && empty($_POST['goods'])) {
     if (!is_numeric($_REQUEST['goods_id']) || intval($_REQUEST['goods_id']) <= 0) {
         ecs_header("Location:./\n");
     }
     $goods_id = intval($_REQUEST['goods_id']);
     exit;
 }
 $result = array('error' => 0, 'message' => '', 'content' => '', 'goods_id' => '');
 $json = new JSON();
 if (empty($_POST['goods'])) {
     $result['error'] = 1;
     die($json->encode($result));
 }
 $goods = $json->decode($_POST['goods']);
 /* 查询:取得团购活动信息 */
 $group_buy = group_buy_info($goods->goods_id, $goods->number);
 if (empty($group_buy)) {
     ecs_header("Location: ./\n");
     exit;
 }
 /* 查询:检查团购活动是否是进行中 */
 if ($group_buy['status'] != GBS_UNDER_WAY) {
     $result['error'] = 10;
     //该活动已结束
     $result['goods_id'] = $goods->goods_id;
     $result['parent'] = $goods->parent;
     $result['message'] = $spe_array;
     die($json->encode($result));
 }
 /* 查询:取得团购商品信息 */
 $goods = goods_info($group_buy['goods_id']);
开发者ID:jinjing1989,项目名称:wei,代码行数:31,代码来源:group_buy.php

示例8: integral_to_give2

/**
 * 取得某订单应该赠送的积分数
 * @param   array   $order  订单
 * @return  int     积分数
 */
function integral_to_give2($order)
{
    /* 判断是否团购 */
    if ($order['extension_code'] == 'group_buy') {
        include_once ROOT_PATH . 'includes/lib_goods.php';
        $group_buy = group_buy_info(intval($order['extension_id']));
        return array('custom_points' => $group_buy['gift_integral'], 'rank_points' => $order['goods_amount']);
    } else {
        $sql1 = "SELECT SUM(og.goods_number * IF(g.give_integral < 0, og.goods_price*(g.give_integral/10)*(-1), g.give_integral)) AS custom_points, SUM(og.goods_number * og.goods_price) AS rank_points " . "FROM " . $GLOBALS['ecs']->table('order_goods') . " AS og, " . $GLOBALS['ecs']->table('goods') . " AS g " . "WHERE og.goods_id = g.goods_id " . "AND og.order_id = '{$order['order_id']}' " . "AND og.goods_id > 0 " . "AND og.parent_id = 0 " . "AND og.is_integral = 0 " . "AND og.is_gift = 0";
        /*$sql = "SELECT SUM(og.goods_number * IF(g.give_integral > -1, g.give_integral, og.goods_price)) AS custom_points, SUM(og.goods_number * og.goods_price) AS rank_points " .
        				"FROM " . $GLOBALS['ecs']->table('order_goods') . " AS og, " .
        						  $GLOBALS['ecs']->table('goods') . " AS g " .
        				"WHERE og.goods_id = g.goods_id " .
        				"AND og.order_id = '$order[order_id]' " .
        				"AND og.goods_id > 0 " .
        				"AND og.parent_id = 0 " .
        				"AND og.is_gift = 0";
        		*/
        $res1 = $GLOBALS['db']->getRow($sql1);
        //print_r($res1);
        $sql2 = "SELECT SUM(og.goods_number * g.integral) AS custom_points, SUM(og.goods_number * og.goods_price) AS rank_points " . "FROM " . $GLOBALS['ecs']->table('order_goods') . " AS og, " . $GLOBALS['ecs']->table('goods') . " AS g " . "WHERE og.goods_id = g.goods_id " . "AND og.order_id = '{$order['order_id']}' " . "AND og.goods_id > 0 " . "AND og.parent_id = 0 " . "AND og.is_integral = 1 " . "AND g.cat_id <> 4 " . "AND og.is_gift = 0";
        $res2 = $GLOBALS['db']->getRow($sql2);
        //print_r($res2);
        $sql3 = "SELECT SUM(og.goods_number * og.goods_price) AS custom_points, SUM(og.goods_number * og.goods_price) AS rank_points " . "FROM " . $GLOBALS['ecs']->table('order_goods') . " AS og, " . $GLOBALS['ecs']->table('goods') . " AS g " . "WHERE og.goods_id = g.goods_id " . "AND og.order_id = '{$order['order_id']}' " . "AND og.goods_id > 0 " . "AND og.parent_id = 0 " . "AND og.is_integral = 1 " . "AND g.cat_id = 4 " . "AND og.is_gift = 0";
        $res3 = $GLOBALS['db']->getRow($sql3);
        //print_r($res3);
        if ($order['discount'] == 0) {
            $res['custom_points'] = $res1['custom_points'] + $order['shipping_fee'] / 10 + $order['pay_fee'] / 10 - $res2['custom_points'] - $res3['custom_points'];
            $res['rank_points'] = $res1['rank_points'] + $res2['rank_points'] + $res3['rank_points'];
        } else {
            $res['custom_points'] = $res1['custom_points'] * 0.95 + $order['shipping_fee'] / 10 + $order['pay_fee'] / 10 - $res2['custom_points'] - $res3['custom_points'];
            $res['rank_points'] = $res1['rank_points'] + $res2['rank_points'] + $res3['rank_points'];
        }
        return $res;
    }
}
开发者ID:songtaiwu,项目名称:m-cmsold,代码行数:41,代码来源:lib_order.php

示例9: stripslashes

             $result['one_step_buy'] = $_CFG['one_step_buy'];
         } else {
             $result['message'] = $err->last_message();
             $result['error'] = $err->error_no;
             $result['package_id'] = stripslashes($package->package_id);
         }
     }
     $result['confirm_type'] = !empty($_CFG['cart_confirm']) ? $_CFG['cart_confirm'] : 2;
     die($json->encode($result));
 } elseif ($_REQUEST['step'] == 'update_group_cart') {
     include_once 'includes/cls_json.php';
     $json = new JSON();
     $result = array('error' => ", 'content' => ");
     $rec_id = $_GET['rec_id'];
     $number = $_GET['number'];
     $group_buy = group_buy_info($_SESSION['extension_id'], $number);
     if (!is_numeric($number)) {
         $result['error'] = '1';
         $result['content'] = '请输入合法数量';
         die($json->encode($result));
     }
     if ($group_buy['restrict_amount'] > 0 && $number > $group_buy['restrict_amount'] - $group_buy['valid_goods']) {
         $result['error'] = '1';
         $restrict_amount = $group_buy['restrict_amount'] - $group_buy['valid_goods'];
         $result['content'] = '您最多可买' . $restrict_amount . '件';
         die($json->encode($result));
     }
     $sql = "UPDATE " . $GLOBALS['ecs']->table('cart') . " SET goods_number = '{$number}' WHERE rec_id = {$rec_id}";
     $GLOBALS['db']->query($sql);
     $subtotal = $GLOBALS['db']->getONE("select goods_price * goods_number AS subtotal from " . $GLOBALS['ecs']->table('cart') . " where rec_id = {$rec_id}");
     $cart_amount = cart_amount($_SESSION['flow_type']);
开发者ID:norain2050,项目名称:benhu,代码行数:31,代码来源:flow.php


注:本文中的group_buy_info函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。