• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP exist_real_goods函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: get_order_detail

/**
 *  获取指订单的详情
 *
 * @access  public
 * @param   int         $order_id       订单ID
 * @param   int         $user_id        用户ID
 *
 * @return   arr        $order          订单所有信息的数组
 */
function get_order_detail($order_id, $user_id = 0)
{
    include_once ROOT_PATH . 'includes/lib_order.php';
    $order_id = intval($order_id);
    if ($order_id <= 0) {
        $GLOBALS['err']->add(L('invalid_order_id'));
        return false;
    }
    $order = order_info($order_id);
    //检查订单是否属于该用户
    if ($user_id > 0 && $user_id != $order['user_id']) {
        $GLOBALS['err']->add(L('no_priv'));
        return false;
    }
    /* 对发货号处理 */
    if (!empty($order['invoice_no'])) {
        $shipping_code = $GLOBALS['db']->GetOne("SELECT shipping_code FROM " . $GLOBALS['ecs']->table('shipping') . " WHERE shipping_id = '{$order['shipping_id']}'");
        $plugin = ROOT_PATH . 'includes/modules/shipping/' . $shipping_code . '.php';
        if (file_exists($plugin)) {
            include_once $plugin;
            $shipping = new $shipping_code();
            $order['invoice_no'] = $shipping->query($order['invoice_no']);
        }
    }
    /* 只有未确认才允许用户修改订单地址 */
    if ($order['order_status'] == OS_UNCONFIRMED) {
        $order['allow_update_address'] = 1;
        //允许修改收货地址
    } else {
        $order['allow_update_address'] = 0;
    }
    /* 获取订单中实体商品数量 */
    $order['exist_real_goods'] = exist_real_goods($order_id);
    /* 如果是未付款状态,生成支付按钮 */
    if ($order['pay_status'] == PS_UNPAYED && ($order['order_status'] == OS_UNCONFIRMED || $order['order_status'] == OS_CONFIRMED)) {
        /*
         * 在线支付按钮
         */
        //支付方式信息
        $payment_info = array();
        $payment_info = payment_info($order['pay_id']);
        //无效支付方式
        if ($payment_info === false) {
            $order['pay_online'] = '';
        } else {
            //取得支付信息,生成支付代码
            $payment = unserialize_config($payment_info['pay_config']);
            //获取需要支付的log_id
            $order['log_id'] = get_paylog_id($order['order_id'], $pay_type = PAY_ORDER);
            $order['user_name'] = $_SESSION['user_name'];
            $order['pay_desc'] = $payment_info['pay_desc'];
            /* 调用相应的支付方式文件 */
            include_once ROOT_PATH . 'includes/modules/payment/' . $payment_info['pay_code'] . '.php';
            /* 取得在线支付方式的支付按钮 */
            $pay_obj = new $payment_info['pay_code']();
            $order['pay_online'] = $pay_obj->get_code($order, $payment);
        }
    } else {
        $order['pay_online'] = '';
    }
    /* 无配送时的处理 */
    $order['shipping_id'] == -1 and $order['shipping_name'] = L('shipping_not_need');
    /* 其他信息初始化 */
    $order['how_oos_name'] = $order['how_oos'];
    $order['how_surplus_name'] = $order['how_surplus'];
    /* 虚拟商品付款后处理 */
    if ($order['pay_status'] != PS_UNPAYED) {
        /* 取得已发货的虚拟商品信息 */
        $virtual_goods = get_virtual_goods($order_id, true);
        $virtual_card = array();
        foreach ($virtual_goods as $code => $goods_list) {
            /* 只处理虚拟卡 */
            if ($code == 'virtual_card') {
                foreach ($goods_list as $goods) {
                    if ($info = virtual_card_result($order['order_sn'], $goods)) {
                        $virtual_card[] = array('goods_id' => $goods['goods_id'], 'goods_name' => $goods['goods_name'], 'info' => $info);
                    }
                }
            }
            /* 处理超值礼包里面的虚拟卡 */
            if ($code == 'package_buy') {
                foreach ($goods_list as $goods) {
                    $sql = 'SELECT g.goods_id FROM ' . $GLOBALS['ecs']->table('package_goods') . ' AS pg, ' . $GLOBALS['ecs']->table('goods') . ' AS g ' . "WHERE pg.goods_id = g.goods_id AND pg.package_id = '" . $goods['goods_id'] . "' AND extension_code = 'virtual_card'";
                    $vcard_arr = $GLOBALS['db']->getAll($sql);
                    foreach ($vcard_arr as $val) {
                        if ($info = virtual_card_result($order['order_sn'], $val)) {
                            $virtual_card[] = array('goods_id' => $goods['goods_id'], 'goods_name' => $goods['goods_name'], 'info' => $info);
                        }
                    }
                }
            }
//.........这里部分代码省略.........
开发者ID:connwap135,项目名称:ectouch,代码行数:101,代码来源:transaction_helper.php


示例2: user_info

 if ($order['user_id'] > 0) {
     $user = user_info($order['user_id']);
     if (!empty($user)) {
         $order['user_name'] = $user['user_name'];
     }
 }
 /* 查询:取得区域名 */
 $sql = "SELECT concat(IFNULL(c.region_name, ''), '  ', IFNULL(p.region_name, ''), " . "'  ', IFNULL(t.region_name, ''), '  ', IFNULL(d.region_name, '')) AS region " . "FROM " . $ecs->table('order_info') . " AS o " . "LEFT JOIN " . $ecs->table('region') . " AS c ON o.country = c.region_id " . "LEFT JOIN " . $ecs->table('region') . " AS p ON o.province = p.region_id " . "LEFT JOIN " . $ecs->table('region') . " AS t ON o.city = t.region_id " . "LEFT JOIN " . $ecs->table('region') . " AS d ON o.district = d.region_id " . "WHERE o.order_id = '{$order['order_id']}'";
 $order['region'] = $db->getOne($sql);
 /* 查询:其他处理 */
 $order['order_time'] = local_date($_CFG['time_format'], $order['add_time']);
 $order['invoice_no'] = $order['shipping_status'] == SS_UNSHIPPED || $order['shipping_status'] == SS_PREPARING ? $_LANG['ss'][SS_UNSHIPPED] : $order['invoice_no'];
 /* 查询:是否保价 */
 $order['insure_yn'] = empty($order['insure_fee']) ? 0 : 1;
 /* 查询:是否存在实体商品 */
 $exist_real_goods = exist_real_goods($order_id);
 /* 查询:取得订单商品 */
 $_goods = get_order_goods(array('order_id' => $order['order_id'], 'order_sn' => $order['order_sn']));
 $attr = $_goods['attr'];
 $goods_list = $_goods['goods_list'];
 unset($_goods);
 /* 查询:商品已发货数量 此单可发货数量 */
 if ($goods_list) {
     foreach ($goods_list as $key => $goods_value) {
         if (!$goods_value['goods_id']) {
             continue;
         }
         /* 超级礼包 */
         if ($goods_value['extension_code'] == 'package_buy' && count($goods_value['package_goods_list']) > 0) {
             $goods_list[$key]['package_goods_list'] = package_goods($goods_value['package_goods_list'], $goods_value['goods_number'], $goods_value['order_id'], $goods_value['extension_code'], $goods_value['goods_id']);
             foreach ($goods_list[$key]['package_goods_list'] as $pg_key => $pg_value) {
开发者ID:norain2050,项目名称:benhu,代码行数:31,代码来源:order.php


示例3: check_consignee_info

/**
 * 检查收货人信息是否完整
 * @param   array   $consignee  收货人信息
 * @param   int     $flow_type  购物流程类型
 * @return  bool    true 完整 false 不完整
 */
function check_consignee_info($consignee, $flow_type)
{
    if (exist_real_goods(0, $flow_type)) {
        /* 如果存在实体商品 */
        $res = !empty($consignee['consignee']) && !empty($consignee['country']) && !empty($consignee['email']) && !empty($consignee['tel']);
        if ($res) {
            if (empty($consignee['province'])) {
                /* 没有设置省份,检查当前国家下面有没有设置省份 */
                $pro = get_regions(1, $consignee['country']);
                $res = empty($pro);
            } elseif (empty($consignee['city'])) {
                /* 没有设置城市,检查当前省下面有没有城市 */
                $city = get_regions(2, $consignee['province']);
                $res = empty($city);
            } elseif (empty($consignee['district'])) {
                $dist = get_regions(3, $consignee['city']);
                $res = empty($dist);
            }
        }
        return $res;
    } else {
        /* 如果不存在实体商品 */
        return !empty($consignee['consignee']) && !empty($consignee['email']) && !empty($consignee['tel']);
    }
}
开发者ID:dlpc,项目名称:ecshop,代码行数:31,代码来源:lib_order.php


示例4: isset

$flow_type = 0;
$_LANG['gram'] = '克';
$_LANG['kilogram'] = '千克';
$tips = '订单提交成功!';
if ($_SESSION['user_id'] > 0) {
    $smarty->assign('user_name', $_SESSION['user_name']);
}
if ($_REQUEST['act'] == 'order_lise') {
    include_once ROOT_PATH . 'includes/lib_transaction.php';
    $flow_type = isset($_SESSION['flow_type']) ? intval($_SESSION['flow_type']) : CART_GENERAL_GOODS;
    /* 检查购物车中是否有商品 */
    $sql = "SELECT COUNT(*) FROM " . $ecs->table('cart') . " WHERE session_id = '" . SESS_ID . "' " . "AND parent_id = 0 AND is_gift = 0 AND rec_type = '{$flow_type}'";
    if ($db->getOne($sql) == 0) {
        $tips = '您的购物车中没有商品';
    }
    $real_goods_count = exist_real_goods(0, $flow_type) ? 1 : 0;
    if ($real_goods_count) {
        $db->query("update " . $ecs->table('user_address') . " set best_time='" . $_POST['best_time'] . ' ' . $_POST['best_time1'] . "' where address_id=" . $_POST['address_id'] . " and user_id=" . $_SESSION['user_id']);
        $consignee = get_consignee_info($_SESSION['user_id'], $_POST['address_id']);
        $_SESSION['flow_consignee'] = stripslashes_deep($consignee);
        //$consignee = get_consignee($_SESSION['user_id']);
        //14:07 2013-07-17
        $where = "1";
        if ($consignee['city']) {
            $where = " region_id = '{$consignee['city']}'";
        }
        if ($consignee['district']) {
            $where .= " OR region_id = '{$consignee['district']}'";
        }
        $sql = 'SELECT region_name FROM ' . $GLOBALS['ecs']->table('region') . " WHERE " . $where;
        $rnarr = $db->GetAll($sql);
开发者ID:nanhuacrab,项目名称:ecshop,代码行数:31,代码来源:order.php


示例5: array

     $province_list = array();
     $city_list = array();
     $district_list = array();
     foreach ($consignee_list as $region_id => $consignee) {
         $consignee['country'] = isset($consignee['country']) ? intval($consignee['country']) : 0;
         $consignee['province'] = isset($consignee['province']) ? intval($consignee['province']) : 0;
         $consignee['city'] = isset($consignee['city']) ? intval($consignee['city']) : 0;
         $province_list[$region_id] = get_regions(1, $consignee['country']);
         $city_list[$region_id] = get_regions(2, $consignee['province']);
         $district_list[$region_id] = get_regions(3, $consignee['city']);
     }
     $smarty->assign('province_list', $province_list);
     $smarty->assign('city_list', $city_list);
     $smarty->assign('district_list', $district_list);
     /* 返回收货人页面代码 */
     $smarty->assign('real_goods_count', exist_real_goods(0, $flow_type) ? 1 : 0);
 } else {
     /*
      * 保存收货人信息
      */
     $consignee = array('address_id' => empty($_POST['address_id']) ? 0 : intval($_POST['address_id']), 'consignee' => empty($_POST['consignee']) ? '' : trim($_POST['consignee']), 'country' => empty($_POST['country']) ? '' : $_POST['country'], 'province' => empty($_POST['province']) ? '' : $_POST['province'], 'city' => empty($_POST['city']) ? '' : $_POST['city'], 'district' => empty($_POST['district']) ? '' : $_POST['district'], 'email' => empty($_POST['email']) ? '' : $_POST['email'], 'address' => empty($_POST['address']) ? '' : $_POST['address'], 'zipcode' => empty($_POST['zipcode']) ? '' : make_semiangle(trim($_POST['zipcode'])), 'tel' => empty($_POST['tel']) ? '' : make_semiangle(trim($_POST['tel'])), 'mobile' => empty($_POST['mobile']) ? '' : make_semiangle(trim($_POST['mobile'])), 'sign_building' => empty($_POST['sign_building']) ? '' : $_POST['sign_building'], 'best_time' => empty($_POST['best_time']) ? '' : $_POST['best_time']);
     if ($_SESSION['user_id'] > 0) {
         include_once ROOT_PATH . 'includes/lib_transaction.php';
         /* 如果用户已经登录,则保存收货人信息 */
         $consignee['user_id'] = $_SESSION['user_id'];
         save_consignee($consignee, true);
     }
     /* 保存到session */
     $_SESSION['flow_consignee'] = stripslashes_deep($consignee);
     ecs_header("Location: flow.php?step=checkout\n");
     exit;
开发者ID:will0306,项目名称:bianli100,代码行数:31,代码来源:flow.php


示例6: quick_delivery

function quick_delivery($order_id, $invoice_no, $action_note = 'Wap端一键发货')
{
    global $db, $ecs;
    if (!empty($invoice_no)) {
        $order_id = intval(trim($order_id));
        $action_note = trim($action_note);
        /* 查询:根据订单id查询订单信息 */
        if (!empty($order_id)) {
            $order = order_info($order_id);
        } else {
            die('order does not exist');
        }
        /* 查询:根据订单是否完成 检查权限 */
        if (order_finished($order)) {
            admin_priv('order_view_finished');
        } else {
            admin_priv('order_view');
        }
        /* 查询:如果管理员属于某个办事处,检查该订单是否也属于这个办事处 */
        $sql = "SELECT agency_id FROM " . $ecs->table('supplier_admin_user') . " WHERE user_id = '{$_SESSION['supplier_user_id']}'";
        $agency_id = $db->getOne($sql);
        if ($agency_id > 0) {
            if ($order['agency_id'] != $agency_id) {
                sys_msg($_LANG['priv_error'], 0);
            }
        }
        /* 查询:取得用户名 */
        if ($order['user_id'] > 0) {
            $user = user_info($order['user_id']);
            if (!empty($user)) {
                $order['user_name'] = $user['user_name'];
            }
        }
        /* 查询:取得区域名 */
        $order['region'] = $db->getOne($sql);
        /* 查询:其他处理 */
        $order['order_time'] = local_date($_CFG['time_format'], $order['add_time']);
        $order['invoice_no'] = $order['shipping_status'] == SS_UNSHIPPED || $order['shipping_status'] == SS_PREPARING ? $_LANG['ss'][SS_UNSHIPPED] : $order['invoice_no'];
        /* 查询:是否保价 */
        $order['insure_yn'] = empty($order['insure_fee']) ? 0 : 1;
        /* 查询:是否存在实体商品 */
        $exist_real_goods = exist_real_goods($order_id);
        /* 查询:取得订单商品 */
        $_goods = get_order_goods(array('order_id' => $order['order_id'], 'order_sn' => $order['order_sn']));
        $attr = $_goods['attr'];
        $goods_list = $_goods['goods_list'];
        unset($_goods);
        /* 查询:商品已发货数量 此单可发货数量 */
        if ($goods_list) {
            foreach ($goods_list as $key => $goods_value) {
                if (!$goods_value['goods_id']) {
                    continue;
                }
                /* 超级礼包 */
                if ($goods_value['extension_code'] == 'package_buy' && count($goods_value['package_goods_list']) > 0) {
                    $goods_list[$key]['package_goods_list'] = package_goods($goods_value['package_goods_list'], $goods_value['goods_number'], $goods_value['order_id'], $goods_value['extension_code'], $goods_value['goods_id']);
                    foreach ($goods_list[$key]['package_goods_list'] as $pg_key => $pg_value) {
                        $goods_list[$key]['package_goods_list'][$pg_key]['readonly'] = '';
                        /* 使用库存 是否缺货 */
                        if ($pg_value['storage'] <= 0 && $_CFG['use_storage'] == '1' && $_CFG['stock_dec_time'] == SDT_SHIP) {
                            $goods_list[$key]['package_goods_list'][$pg_key]['send'] = $_LANG['act_good_vacancy'];
                            $goods_list[$key]['package_goods_list'][$pg_key]['readonly'] = 'readonly="readonly"';
                        } elseif ($pg_value['send'] <= 0) {
                            $goods_list[$key]['package_goods_list'][$pg_key]['send'] = $_LANG['act_good_delivery'];
                            $goods_list[$key]['package_goods_list'][$pg_key]['readonly'] = 'readonly="readonly"';
                        }
                    }
                } else {
                    $goods_list[$key]['sended'] = $goods_value['send_number'];
                    $goods_list[$key]['sended'] = $goods_value['goods_number'];
                    $goods_list[$key]['send'] = $goods_value['goods_number'] - $goods_value['send_number'];
                    $goods_list[$key]['readonly'] = '';
                    /* 是否缺货 */
                    if ($goods_value['storage'] <= 0 && $_CFG['use_storage'] == '1' && $_CFG['stock_dec_time'] == SDT_SHIP) {
                        $goods_list[$key]['send'] = $_LANG['act_good_vacancy'];
                        $goods_list[$key]['readonly'] = 'readonly="readonly"';
                    } elseif ($goods_list[$key]['send'] <= 0) {
                        $goods_list[$key]['send'] = $_LANG['act_good_delivery'];
                        $goods_list[$key]['readonly'] = 'readonly="readonly"';
                    }
                }
            }
        }
        $suppliers_id = 0;
        $delivery['order_sn'] = trim($order['order_sn']);
        $delivery['add_time'] = trim($order['order_time']);
        $delivery['user_id'] = intval(trim($order['user_id']));
        $delivery['how_oos'] = trim($order['how_oos']);
        $delivery['shipping_id'] = trim($order['shipping_id']);
        $delivery['shipping_fee'] = trim($order['shipping_fee']);
        $delivery['consignee'] = trim($order['consignee']);
        $delivery['address'] = trim($order['address']);
        $delivery['country'] = intval(trim($order['country']));
        $delivery['province'] = intval(trim($order['province']));
        $delivery['city'] = intval(trim($order['city']));
        $delivery['district'] = intval(trim($order['district']));
        $delivery['sign_building'] = trim($order['sign_building']);
        $delivery['email'] = trim($order['email']);
        $delivery['zipcode'] = trim($order['zipcode']);
        $delivery['tel'] = trim($order['tel']);
//.........这里部分代码省略.........
开发者ID:seanguo166,项目名称:yinoos,代码行数:101,代码来源:order.php


示例7: operable_list

 $operable_list = operable_list($order);
 $smarty->assign('operable_list', $operable_list);
 /* 取得订单操作记录 */
 $act_list = array();
 $sql = "SELECT * FROM " . $ecs->table('order_action') . " WHERE order_id='{$order['order_id']}' ORDER BY log_time DESC,action_id DESC";
 $res = $db->query($sql);
 while ($row = $db->fetchRow($res)) {
     $row['order_status'] = $_LANG['os'][$row['order_status']];
     $row['pay_status'] = $_LANG['ps'][$row['pay_status']];
     $row['shipping_status'] = $_LANG['ss'][$row['shipping_status']];
     $row['action_time'] = date($_CFG['time_format'], $row['log_time']);
     $act_list[] = $row;
 }
 $smarty->assign('action_list', $act_list);
 /* 取得是否存在实体商品 */
 $smarty->assign('exist_real_goods', exist_real_goods($order['order_id']));
 $sql = 'SELECT COUNT(user_id) FROM ' . $ecs->table('order_info') . " WHERE user_id={$order['user_id']} GROUP BY user_id HAVING COUNT(user_id)";
 if ($db->getOne($sql) > 1) {
     $smarty->assign('old_buyer', '◆');
 }
 $sql_select = 'SELECT card_number FROM ' . $GLOBALS['ecs']->table('memship_number') . " WHERE user_id={$order['user_id']}";
 $card_number = $GLOBALS['db']->getOne($sql_select);
 /* 是否打印订单,分别赋值 */
 if (isset($_GET['print'])) {
     $smarty->assign('shop_name', $_CFG['shop_name']);
     $smarty->assign('shop_url', $ecs->url());
     $smarty->assign('shop_address', $_CFG['shop_address']);
     $smarty->assign('service_phone', $_CFG['service_phone']);
     $smarty->assign('print_time', strstr($order['order_time'], ' ', true));
     $smarty->assign('action_user', $_SESSION['admin_name']);
     $smarty->assign('card_number', $card_number);
开发者ID:554119220,项目名称:kjrscrm,代码行数:31,代码来源:order.php


示例8: user_info

         $user = user_info($order['user_id']);
         /* 计算可用余额 */
         $smarty->assign('available_user_money', $order['surplus'] + $user['user_money']);
         /* 计算可用积分 */
         $smarty->assign('available_pay_points', $order['integral'] + $user['pay_points']);
         /* 取得用户可用红包 */
         $user_bonus = user_bonus($order['user_id'], $order['goods_amount']);
         if ($order['bonus_id'] > 0) {
             $bonus = bonus_info($order['bonus_id']);
             $user_bonus[] = $bonus;
         }
         $smarty->assign('available_bonus', $user_bonus);
     }
 } elseif ('invoice' == $step) {
     /* 如果不存在实体商品 */
     if (!exist_real_goods($order_id)) {
         die('Hacking Attemp');
     }
     /* 取得可用的配送方式列表 */
     $region_id_list = array($order['country'], $order['province'], $order['city'], $order['district']);
     $shipping_list = available_shipping_list($region_id_list);
     //        /* 取得配送费用 */
     //        $total = order_weight_price($order_id);
     //        foreach ($shipping_list AS $key => $shipping)
     //        {
     //            $shipping_fee = shipping_fee($shipping['shipping_code'],
     //                unserialize($shipping['configure']), $total['weight'], $total['amount'], $total['number']);
     //            $shipping_list[$key]['shipping_fee'] = $shipping_fee;
     //            $shipping_list[$key]['format_shipping_fee'] = price_format($shipping_fee);
     //            $shipping_list[$key]['free_money'] = price_format($shipping['configure']['free_money']);
     //        }
开发者ID:BGCX261,项目名称:zishashop-svn-to-git,代码行数:31,代码来源:order.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP existeSql函数代码示例发布时间:2022-05-15
下一篇:
PHP exist_plugin_convert函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap