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


PHP delivery_order_info函数代码示例

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


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

示例1: array

         $db->query("DELETE FROM " . $ecs->table('order_action') . " WHERE order_id = '{$order_id}'");
         $action_array = array('delivery', 'back');
         del_delivery($order_id, $action_array);
         /* todo 记录日志 */
         admin_log($order['order_sn'], 'remove', 'order');
         /* 返回 */
         sys_msg($_LANG['order_removed'], 0, array(array('href' => 'order.php?act=list&' . list_link_postfix(), 'text' => $_LANG['return_list'])));
     }
 } elseif (isset($_REQUEST['remove_invoice'])) {
     // 删除发货单
     $delivery_id = $_REQUEST['delivery_id'];
     $delivery_id = is_array($delivery_id) ? $delivery_id : array($delivery_id);
     foreach ($delivery_id as $value_is) {
         $value_is = intval(trim($value_is));
         // 查询:发货单信息
         $delivery_order = delivery_order_info($value_is);
         // 如果status不是退货
         if ($delivery_order['status'] != 1) {
             /* 处理退货 */
             delivery_return_goods($value_is, $delivery_order);
         }
         // 如果status是已发货并且发货单号不为空
         if ($delivery_order['status'] == 0 && $delivery_order['invoice_no'] != '') {
             /* 更新:删除订单中的发货单号 */
             del_order_invoice_no($delivery_order['order_id'], $delivery_order['invoice_no']);
         }
         // 更新:删除发货单
         $sql = "DELETE FROM " . $ecs->table('delivery_order') . " WHERE delivery_id = '{$value_is}'";
         $db->query($sql);
     }
     /* 返回 */
开发者ID:norain2050,项目名称:benhu,代码行数:31,代码来源:order.php

示例2: array

*/
/* 显示模板
 $smarty->assign('ur_here', $_LANG['delivery_operate'] . $_LANG['detail']);
$smarty->assign('action_link', array('href' => 'order.php?act=delivery_list&' . list_link_postfix(), 'text' => $_LANG['09_delivery_order']));
$smarty->assign('action_act', ($delivery_order['status'] == 2) ? 'delivery_ship' : 'delivery_cancel_ship');
assign_query_info();
$smarty->display('delivery_info.htm');
exit; //
*/
/* 取得参数 */
$delivery = array();
$delivery['invoice_no'] = $invoice_no;
$action_note = '批量处理';
/* 根据发货单id查询发货单信息 */
if (!empty($delivery_id)) {
    $delivery_order = delivery_order_info($delivery_id);
} else {
    die('order does not exist');
}
/* 查询订单信息 */
$order = order_info($order_id);
/* 检查此单发货商品库存缺货情况 */
$virtual_goods = array();
$delivery_stock_sql = "SELECT DG.goods_id, DG.is_real, DG.product_id, SUM(DG.send_number) AS sums, IF(DG.product_id > 0, P.product_number, G.goods_number) AS storage, G.goods_name, DG.send_number\n        FROM " . $GLOBALS['hhs']->table('delivery_goods') . " AS DG, " . $GLOBALS['hhs']->table('goods') . " AS G, " . $GLOBALS['hhs']->table('products') . " AS P\n        WHERE DG.goods_id = G.goods_id\n        AND DG.delivery_id = '{$delivery_id}'\n        AND DG.product_id = P.product_id\n        GROUP BY DG.product_id ";
$delivery_stock_result = $GLOBALS['db']->getAll($delivery_stock_sql);
/* 如果商品存在规格就查询规格,如果不存在规格按商品库存查询 */
if (!empty($delivery_stock_result)) {
    foreach ($delivery_stock_result as $value) {
        if (($value['sums'] > $value['storage'] || $value['storage'] <= 0) && ($_CFG['use_storage'] == '1' && $_CFG['stock_dec_time'] == SDT_SHIP || $_CFG['use_storage'] == '0' && $value['is_real'] == 0)) {
            /* 操作失败 */
            $links[] = array('text' => $_LANG['order_info'], 'href' => 'order.php?act=delivery_info&delivery_id=' . $delivery_id);
开发者ID:shiruolin,项目名称:hzzshop,代码行数:31,代码来源:split.php

示例3: cancel_delivery

function cancel_delivery($order_id, $delivery_id)
{
    global $db, $ecs;
    /* 取得参数 */
    $delivery = '';
    /* 根据发货单id查询发货单信息 */
    if (!empty($delivery_id)) {
        $delivery_order = delivery_order_info($delivery_id);
    } else {
        sys_msg('订单号不能为空!', 1);
    }
    /* 查询订单信息 */
    $order = order_info($order_id);
    /* 取消当前发货单物流单号 */
    $_delivery['invoice_no'] = '';
    $_delivery['status'] = 2;
    $query = $db->autoExecute($ecs->table('delivery_order'), $_delivery, 'UPDATE', "delivery_id = {$delivery_id}", 'SILENT');
    if (!$query) {
        /* 操作失败 */
        $links[] = array('text' => $GLOBALS['_LANG']['delivery_sn'] . $GLOBALS['_LANG']['detail'], 'href' => 'order.php?act=delivery_info&delivery_id=' . $delivery_id);
        sys_msg($GLOBALS['_LANG']['act_false'], 1, $links);
        exit;
    }
    /* 修改定单发货单号 */
    $invoice_no_order = explode('<br>', $order['invoice_no']);
    $invoice_no_delivery = explode('<br>', $delivery_order['invoice_no']);
    foreach ($invoice_no_order as $key => $value) {
        $delivery_key = array_search($value, $invoice_no_delivery);
        if ($delivery_key !== false) {
            unset($invoice_no_order[$key], $invoice_no_delivery[$delivery_key]);
            if (count($invoice_no_delivery) == 0) {
                break;
            }
        }
    }
    $_order['invoice_no'] = implode('<br>', $invoice_no_order);
    /* 更新配送状态 */
    $order_finish = get_all_delivery_finish($order_id);
    $shipping_status = $order_finish == -1 ? SS_SHIPPED_PART : SS_SHIPPED_ING;
    $arr['shipping_status'] = $shipping_status;
    if ($shipping_status == SS_SHIPPED_ING) {
        $arr['shipping_time'] = '';
        // 发货时间
    }
    $arr['invoice_no'] = $_order['invoice_no'];
    update_order($order_id, $arr);
    /* 发货单取消发货记录log */
    order_action($order['order_sn'], $order['order_status'], $shipping_status, $order['pay_status'], $action_note, null, 1);
    /* 如果使用库存,则增加库存 */
    if ($_CFG['use_storage'] == '1' && $_CFG['stock_dec_time'] == SDT_SHIP) {
        // 检查此单发货商品数量
        $virtual_goods = array();
        $delivery_stock_sql = "SELECT DG.goods_id, DG.product_id, DG.is_real, SUM(DG.send_number) AS sums\r\n            FROM " . $GLOBALS['ecs']->table('delivery_goods') . " AS DG\r\n            WHERE DG.delivery_id = '{$delivery_id}'\r\n            GROUP BY DG.goods_id ";
        $delivery_stock_result = $GLOBALS['db']->getAll($delivery_stock_sql);
        foreach ($delivery_stock_result as $key => $value) {
            /* 虚拟商品 */
            if ($value['is_real'] == 0) {
                continue;
            }
            //(货品)
            if (!empty($value['product_id'])) {
                $minus_stock_sql = "UPDATE " . $GLOBALS['ecs']->table('products') . "\r\n                                    SET product_number = product_number + " . $value['sums'] . "\r\n                                    WHERE product_id = " . $value['product_id'];
                $GLOBALS['db']->query($minus_stock_sql, 'SILENT');
            }
            $minus_stock_sql = "UPDATE " . $GLOBALS['ecs']->table('goods') . "\r\n                                SET goods_number = goods_number + " . $value['sums'] . "\r\n                                WHERE goods_id = " . $value['goods_id'];
            $GLOBALS['db']->query($minus_stock_sql, 'SILENT');
        }
    }
    /* 发货单全退回时,退回其它 */
    if ($order['order_status'] == SS_SHIPPED_ING) {
        /* 如果订单用户不为空,计算积分,并退回 */
        if ($order['user_id'] > 0) {
            /* 取得用户信息 */
            $user = user_info($order['user_id']);
            /* 计算并退回积分 */
            $integral = integral_to_give($order);
            log_account_change($order['user_id'], 0, 0, -1 * intval($integral['rank_points']), -1 * intval($integral['custom_points']), sprintf($GLOBALS['_LANG']['return_order_gift_integral'], $order['order_sn']));
            /* todo 计算并退回红包 */
            return_order_bonus($order_id);
        }
    }
    /* 清除缓存 */
    clear_cache_files();
    /* 操作成功 */
    $links[] = array('text' => $GLOBALS['_LANG']['delivery_sn'] . $GLOBALS['_LANG']['detail'], 'href' => 'order.php?act=delivery_info&delivery_id=' . $delivery_id);
    sys_msg($GLOBALS['_LANG']['act_ok'], 0, $links);
}
开发者ID:seanguo166,项目名称:yinoos,代码行数:87,代码来源:order.php

示例4: cancel_delivery

function cancel_delivery($order_id, $delivery_id)
{
    global $db, $ecs, $_CFG;
    /* 取得参数 */
    $delivery = '';
    /* 根据发货单id查询发货单信息 */
    if (!empty($delivery_id)) {
        $delivery_order = delivery_order_info($delivery_id);
    } else {
        sys_msg('订单号不能为空!', 1);
    }
    /* 查询订单信息 */
    $order = order_info($order_id);
    /* 取消当前发货单物流单号 */
    $_delivery['invoice_no'] = '';
    $_delivery['status'] = 2;
    $query = $db->autoExecute($ecs->table('delivery_order'), $_delivery, 'UPDATE', "delivery_id = {$delivery_id}", 'SILENT');
    if (!$query) {
        /* 操作失败 */
        $links[] = array('text' => $GLOBALS['_LANG']['delivery_sn'] . $GLOBALS['_LANG']['detail'], 'href' => 'order.php?act=delivery_info&delivery_id=' . $delivery_id);
        sys_msg($GLOBALS['_LANG']['act_false'], 1, $links);
        exit;
    }
    /* 修改定单发货单号 */
    $invoice_no_order = explode('<br>', $order['invoice_no']);
    $invoice_no_delivery = explode('<br>', $delivery_order['invoice_no']);
    foreach ($invoice_no_order as $key => $value) {
        $delivery_key = array_search($value, $invoice_no_delivery);
        if ($delivery_key !== false) {
            unset($invoice_no_order[$key], $invoice_no_delivery[$delivery_key]);
            if (count($invoice_no_delivery) == 0) {
                break;
            }
        }
    }
    $_order['invoice_no'] = implode('<br>', $invoice_no_order);
    /* 更新配送状态 */
    $order_finish = get_all_delivery_finish($order_id);
    $shipping_status = $order_finish == -1 ? SS_SHIPPED_PART : SS_SHIPPED_ING;
    $arr['shipping_status'] = $shipping_status;
    if ($shipping_status == SS_SHIPPED_ING) {
        $arr['shipping_time'] = '';
        // 发货时间
    }
    $arr['invoice_no'] = $_order['invoice_no'];
    update_order($order_id, $arr);
    /* 发货单取消发货记录log */
    order_action($order['order_sn'], $order['order_status'], $shipping_status, $order['pay_status'], $action_note, null, 1);
    /* 如果使用库存,则增加库存 */
    /* 代码增加_start   By  morestock_morecity  */
    if ($_CFG['use_storage'] == '1' && $_CFG['stock_dec_time'] == SDT_SHIP) {
        $delivery_stock_sql = "SELECT * FROM " . $GLOBALS['ecs']->table('delivery_goods') . " WHERE delivery_id = '{$delivery_id}' ";
        $delivery_stock_result = $GLOBALS['db']->getAll($delivery_stock_sql);
        $store_error = '';
        //$goods_attr_id = get_goods_attr_id($value['goods_id'], $value['goods_attr']);
        $store_id_zhyh = get_storeid_by_ssq($order['province'], $order['city'], $order['district'], $order['xiangcun'], $order['supplier_id']);
        if (!$store_id_zhyh) {
            $store_error = '该发货单没有对应仓库!';
        }
        if ($store_error) {
            sys_msg($store_error);
        } else {
            foreach ($delivery_stock_result as $key => $value) {
                $goods_attr_id = get_goods_attr_id($value['goods_id'], $value['goods_attr']);
                $store_row = get_storeid_youhuo($order['province'], $order['city'], $order['district'], $order['xiangcun'], $value['goods_id'], $goods_attr_id, $order['supplier_id'], $order_id);
                $add_time = gmtime();
                $add_date = local_date('Ymd');
                $sql = "select max(today_sn) from " . $ecs->table('store_inout_list') . " where inout_mode=2 and  add_date='{$add_date}' ";
                $inout_count = $db->getOne($sql);
                $inout_sn = $inout_count ? intval($inout_count + 1) : 1;
                $today_sn = $inout_sn;
                $inout_sn = str_pad($inout_sn, 4, "0", STR_PAD_LEFT);
                $inout_sn = 'rk' . $add_date . $inout_sn;
                $stock_type_id = 0;
                if ($order['supplier_id'] > 0) {
                    $stock_type_id = $db->getOne('select type from ' . $ecs->table('store_type') . " where supplier_id=" . $order['supplier_id']);
                }
                $sql = "insert into " . $ecs->table('store_inout_list') . "(inout_sn, inout_status, store_id, adminer_id, inout_type, inout_mode, order_sn, " . "takegoods_man, today_sn, add_date, add_time, supplier_id, store_type_id)  " . "values('{$inout_sn}', '3', '{$store_row['store_id']}', '{$_SESSION['supplier_user_id']}', '5', '2', '{$order['order_sn']}', " . "'{$_SESSION['supplier_name']}', '{$today_sn}' , '{$add_date}', '{$add_time}','{$order['supplier_id']}', '{$stock_type_id}' ) ";
                $db->query($sql);
                $inout_rec_id = $db->insert_id();
                $sql = "insert into " . $ecs->table('store_inout_goods') . "(inout_rec_id, goods_id, goods_sn, attr_value, inout_mode, number_yingshou, number_shishou, supplier_id, store_type_id)  " . "values('{$inout_rec_id}', '{$value['goods_id']}', '{$value['goods_sn']}', '{$goods_attr_id}', '2', '{$value['send_number']}', '{$value['send_number']}','{$order['supplier_id']}', '{$stock_type_id}') ";
                $db->query($sql);
                $upre = update_stock_in($inout_rec_id, $store_row['store_id']);
                //更新库存表
            }
        }
    }
    /* 代码增加_end   By  morestock_morecity  */
    /* 发货单全退回时,退回其它 */
    if ($order['order_status'] == SS_SHIPPED_ING) {
        /* 如果订单用户不为空,计算积分,并退回 */
        if ($order['user_id'] > 0) {
            /* 取得用户信息 */
            $user = user_info($order['user_id']);
            /* 计算并退回积分 */
            $integral = integral_to_give($order);
            log_account_change($order['user_id'], 0, 0, -1 * intval($integral['rank_points']), -1 * intval($integral['custom_points']), sprintf($GLOBALS['_LANG']['return_order_gift_integral'], $order['order_sn']));
            /* todo 计算并退回红包 */
            return_order_bonus($order_id);
        }
//.........这里部分代码省略.........
开发者ID:moonlight-wang,项目名称:feilun,代码行数:101,代码来源:order.php


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