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


PHP order_finished函数代码示例

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


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

示例1: local_date

 $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', local_date($_CFG['time_format']));
 $smarty->assign('action_user', $_SESSION['admin_name']);
 $html = '';
 $order_sn_list = explode(',', $_POST['order_id']);
 foreach ($order_sn_list as $order_sn) {
     /* 取得订单信息 */
     $order = order_info(0, $order_sn);
     if (empty($order)) {
         continue;
     }
     /* 根据订单是否完成检查权限 */
     if (order_finished($order)) {
         if (!admin_priv('order_view_finished', '', false)) {
             continue;
         }
     } else {
         if (!admin_priv('order_view', '', false)) {
             continue;
         }
     }
     /* 如果管理员属于某个办事处,检查该订单是否也属于这个办事处 */
     $sql = "SELECT agency_id FROM " . $ecs->table('admin_user') . " WHERE user_id = '{$_SESSION['admin_id']}'";
     $agency_id = $db->getOne($sql);
     if ($agency_id > 0) {
         if ($order['agency_id'] != $agency_id) {
             continue;
         }
开发者ID:norain2050,项目名称:benhu,代码行数:31,代码来源:order.php

示例2: 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


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