Example #1
0
$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);
        @($consignee['address'] = $rnarr[0]['region_name'] . ' ' . $rnarr[1]['region_name'] . ' ' . $consignee['address']);
        //end
        $_SESSION['flow_consignee'] = $consignee;
Example #2
0
                $return_goods['return_type'] = 1;
                //退货
                $return_goods['back_num'] = 0;
                $return_goods['out_attr'] = 0;
                $return_goods['out_num'] = 1;
                $query = $db->autoExecute($ecs->table('return_goods'), $return_goods, 'INSERT', '', 'SILENT');
                $return_goods['return_type'] = 2;
                //换货
                $return_goods['back_num'] = 0;
                $return_goods['out_attr'] = $value['attr_name'];
                $return_goods['out_num'] = 1;
                $query = $db->autoExecute($ecs->table('return_goods'), $return_goods, 'INSERT', '', 'SILENT');
            }
        }
        $consignee = get_consignee($_SESSION['user_id']);
        $address_detail = get_consignee_info($consignee['country'], $consignee['province'], $consignee['city'], $consignee['district']);
        $add_message = "<p>商品寄回地址: " . $address_detail . "</p><p>邮政编码:" . $order_return['zipcode'] . "</p><p>收件人:" . $order_return['addressee'] . "</p>";
        show_message($add_message, '', 'user.php?act=return_list', 'info');
    } else {
        show_message('申请提交出现了异常,请稍后重试', '', '', 'info', true);
    }
} elseif ($action == 'return_list') {
    include_once ROOT_PATH . 'includes/lib_transaction.php';
    include_once ROOT_PATH . 'includes/lib_order.php';
    $page = isset($_REQUEST['page']) ? intval($_REQUEST['page']) : 1;
    $record_count = $db->getOne("SELECT COUNT(*) FROM " . $ecs->table('order_return') . " WHERE user_id =" . $_SESSION['user_id']);
    $pager = get_pager('user.php', array('act' => $action), $record_count, $page);
    $return_list = return_order();
    //快递公司
    $consignee = get_consignee($_SESSION['user_id']);
    $region = array($consignee['country'], $consignee['province'], $consignee['city'], $consignee['district']);