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


PHP order_amount函数代码示例

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


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

示例1: order_bonus

/**
 * 取得订单应该发放的红包
 * @param   int     $order_id   订单id
 * @return  array
 */
function order_bonus($order_id)
{
    /* 查询按商品发的红包 */
    $day = getdate();
    $today = local_mktime(23, 59, 59, $day['mon'], $day['mday'], $day['year']);
    $sql = "SELECT b.type_id, b.type_money, SUM(o.goods_number) AS number " . "FROM " . $GLOBALS['ecs']->table('order_goods') . " AS o, " . $GLOBALS['ecs']->table('goods') . " AS g, " . $GLOBALS['ecs']->table('bonus_type') . " AS b " . " WHERE o.order_id = '{$order_id}' " . " AND o.is_gift = 0 " . " AND o.goods_id = g.goods_id " . " AND g.bonus_type_id = b.type_id " . " AND b.send_type = '" . SEND_BY_GOODS . "' " . " AND b.send_start_date <= '{$today}' " . " AND b.send_end_date >= '{$today}' " . " GROUP BY b.type_id ";
    $list = $GLOBALS['db']->getAll($sql);
    /* 查询定单中非赠品总金额 */
    $amount = order_amount($order_id, false);
    /* 查询订单日期 */
    $sql = "SELECT add_time " . " FROM " . $GLOBALS['ecs']->table('order_info') . " WHERE order_id = '{$order_id}' LIMIT 1";
    $order_time = $GLOBALS['db']->getOne($sql);
    /* 查询按订单发的红包 */
    $sql = "SELECT type_id, type_money, IFNULL(FLOOR('{$amount}' / min_amount), 1) AS number " . "FROM " . $GLOBALS['ecs']->table('bonus_type') . "WHERE send_type = '" . SEND_BY_ORDER . "' " . "AND send_start_date <= '{$order_time}' " . "AND send_end_date >= '{$order_time}' ";
    $list = array_merge($list, $GLOBALS['db']->getAll($sql));
    return $list;
}
开发者ID:dlpc,项目名称:ecshop,代码行数:22,代码来源:lib_order.php

示例2: sys_msg

         }
         /* 显示提示信息 */
         if (!empty($msgs)) {
             sys_msg(join(chr(13), $msgs), 0, $links);
         } else {
             /* 完成 */
             ecs_header("Location: order.php?act=info&order_id=" . $order_id . "\n");
             exit;
         }
     }
 } elseif ('payment' == $step) {
     /* 取得支付信息 */
     $pay_id = $_POST['payment'];
     $payment = payment_info($pay_id);
     /* 计算支付费用 */
     $order_amount = order_amount($order_id);
     if ($payment['is_cod'] == 1) {
         $order = order_info($order_id);
         $region_id_list = array($order['country'], $order['province'], $order['city'], $order['district']);
         $shipping = shipping_area_info($order['shipping_id'], $region_id_list);
         $pay_fee = pay_fee($pay_id, $order_amount, $shipping['pay_fee']);
     } else {
         $pay_fee = pay_fee($pay_id, $order_amount);
     }
     /* 保存订单 */
     $order = array('pay_id' => $pay_id, 'pay_name' => addslashes($payment['pay_name']), 'pay_fee' => $pay_fee);
     update_order($order_id, $order);
     update_order_amount($order_id);
     /* 更新 pay_log */
     update_pay_log($order_id);
     /* todo 记录日志 */
开发者ID:seanguo166,项目名称:yinoos,代码行数:31,代码来源:order.php

示例3: admin_priv

     admin_priv('order_edit');
     /* 取得参数 */
     $rec_id = intval($_GET['rec_id']);
     $step_act = $_GET['step_act'];
     $order_id = intval($_GET['order_id']);
     /* 如果使用库存,且下订单时减库存,则修改库存 */
     if ($_CFG['use_storage'] == '1' && $_CFG['stock_dec_time'] == SDT_PLACE) {
         $goods = $db->getRow("SELECT goods_id, goods_number FROM " . $ecs->table('order_goods') . " WHERE rec_id = " . $rec_id);
         $sql = "UPDATE " . $ecs->table('goods') . " SET `goods_number` = goods_number + '" . $goods['goods_number'] . "' " . " WHERE `goods_id` = '" . $goods['goods_id'] . "' LIMIT 1";
         $db->query($sql);
     }
     /* 删除 */
     $sql = "DELETE FROM " . $ecs->table('order_goods') . " WHERE rec_id = '{$rec_id}' LIMIT 1";
     $db->query($sql);
     /* 更新商品总金额和订单总金额 */
     update_order($order_id, array('goods_amount' => order_amount($order_id)));
     update_order_amount($order_id);
     /* 跳回订单商品 */
     ecs_header("Location: order.php?act=" . $step_act . "&order_id=" . $order_id . "&step=goods\n");
     exit;
 } elseif ('cancel_order' == $func) {
     $step_act = $_GET['step_act'];
     $order_id = isset($_GET['order_id']) ? intval($_GET['order_id']) : 0;
     if ($step_act == 'add') {
         /* 如果是添加,删除订单,返回订单列表 */
         if ($order_id > 0) {
             $sql = "DELETE FROM " . $ecs->table('order_info') . " WHERE order_id = '{$order_id}' LIMIT 1";
             $db->query($sql);
         }
         ecs_header("Location: order.php?act=list\n");
         exit;
开发者ID:norain2050,项目名称:benhu,代码行数:31,代码来源:order.php

示例4: order_bonus

    /**
     * 取得订单应该发放的红包
     * @param   int     $order_id   订单id
     * @return  array
     */
    function order_bonus($order_id) {
        /* 查询按商品发的红包 */
        $day = getdate();
        $today = local_mktime(23, 59, 59, $day['mon'], $day['mday'], $day['year']);

        $sql = "SELECT b.type_id, b.type_money, SUM(o.goods_number) AS number " .
                "FROM " . $this->pre . "order_goods AS o, " .
                $this->pre . "goods AS g, " .
                $this->pre . "bonus_type AS b " .
                " WHERE o.order_id = '$order_id' " .
                " AND o.is_gift = 0 " .
                " AND o.goods_id = g.goods_id " .
                " AND g.bonus_type_id = b.type_id " .
                " AND b.send_type = '" . SEND_BY_GOODS . "' " .
                " AND b.send_start_date <= '$today' " .
                " AND b.send_end_date >= '$today' " .
                " GROUP BY b.type_id ";
        $list = $this->query($sql);

        /* 查询定单中非赠品总金额 */
        $amount = order_amount($order_id, false);

        /* 查询订单日期 */
        $sql = "SELECT add_time " .
                " FROM " . $this->pre .
                "order_info WHERE order_id = '$order_id' LIMIT 1";
        $res = $this->row($sql);
        $order_time = $res['add_time'];
        /* 查询按订单发的红包 */
        $sql = "SELECT type_id, type_money, IFNULL(FLOOR('$amount' / min_amount), 1) AS number " .
                "FROM " . $this->pre .
                "bonus_type WHERE send_type = '" . SEND_BY_ORDER . "' " .
                "AND send_start_date <= '$order_time' " .
                "AND send_end_date >= '$order_time' ";
        $list = array_merge($list, $this->query($sql));

        return $list;
    }
开发者ID:sayi21cn,项目名称:ecshopAndEctouch,代码行数:43,代码来源:OrderModel.class.php


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