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


PHP update_order函数代码示例

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


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

示例1: update_actions

function update_actions($glob)
{
    $arr_action = give_action();
    $cur_list_action = $glob['list_action'];
    $arr_action_add = array();
    $arr_tmp = array();
    for ($i = 0, $flag = 0; $cur_list_action[$i]; $i++) {
        for ($j = 0; $arr_action[$j]; $j++) {
            if (substr($cur_list_action[$i]['nom_action'], 0, 2) == "b_") {
                if ($cur_list_action[$i]['done'] == 0) {
                    if ($cur_list_action[$i]['nom_action'] == $arr_action[$j]['nom']) {
                        if ($flag == 0) {
                            for ($k = 0; $arr_action[$j]['actions'][$k]; $k++) {
                                array_push($arr_action_add, name_to_arr($arr_action[$j]['actions'][$k]));
                                $arr_tmp = array();
                            }
                            $cur_list_action = add_action_place($cur_list_action, $arr_action_add, $i);
                            $arr_action_add = array();
                            $flag = 1;
                        }
                    }
                }
            }
        }
    }
    $cur_list_action = update_order($cur_list_action);
    $glob['list_action'] = $cur_list_action;
    return $glob;
}
开发者ID:nott0ny,项目名称:zappy2010,代码行数:29,代码来源:build_action.php

示例2: add_note

function add_note($idnote = 0)
{
    global $dbh, $base_path, $idtype, $idobject, $comment, $ordre_cible;
    $iddemande = $idobject;
    $commentaire = trim($comment);
    if ($ordre_cible) {
        $ordre = $ordre_cible;
    } else {
        $req = "select max(ordre)+1 from rapport_demandes where num_demande='" . $iddemande . "'";
        $res = mysql_query($req, $dbh);
        $ordre = mysql_result($res, 0, 0);
    }
    $req = "insert into rapport_demandes set \n\t\tcontenu='" . $commentaire . "',\n\t\tnum_demande='" . $iddemande . "',\n\t\tnum_note='" . $idnote . "',\n\t\tordre = '" . $ordre . "',\n\t\ttype='" . $idtype . "'\n\t\t";
    mysql_query($req, $dbh);
    if ($ordre_cible) {
        update_order(mysql_insert_id());
    }
    $req = "select rd.id_item, rd.contenu, rd.ordre, rd.type, rd.num_note, sujet_action from rapport_demandes rd left join demandes_notes on num_note=id_note left join demandes_actions on num_action=id_action where rd.num_demande='" . $iddemande . "' order by ordre";
    $res = mysql_query($req, $dbh);
    $display = "";
    while ($item = mysql_fetch_object($res)) {
        $titre = substr($item->contenu, 0, 15) . "...";
        $style = "";
        if (!$item->num_note) {
            //Ajout manuel
            switch ($item->type) {
                case '1':
                    //Titre
                    $style = "style='background-color:#DECDEC' titre='yes'";
                    $content = $item->contenu;
                    break;
                case '0':
                    //Commmentaire
                    $content = "* " . $item->contenu;
                    break;
            }
        } else {
            $content = $item->contenu;
        }
        $ordre = $item->ordre;
        if ($item->sujet_action) {
            $contenu = "<u>" . $item->sujet_action . "</u> : " . $content;
        } else {
            $contenu = $content;
        }
        $drag = "<span id=\"rap_handle_{$item->id_item}\" style='padding-left:7px'  ><img src=\"" . $base_path . "/images/notice_drag.png\" /></span>";
        $del = "<span id=\"rap_del_{$item->id_item}\" style='padding-left:7px' onclick='delete_item({$item->id_item});' ><img src=\"" . $base_path . "/images/cross.png\" style='cursor:pointer;width:10px;vertical-align:middle;' /></span>";
        $modif = "<span id=\"rap_modif_{$item->id_item}\" style='padding-left:7px;' onclick='modif_item({$item->id_item});' ><img src=\"" . $base_path . "/images/b_edit.png\" style='cursor:pointer;width:10px;vertical-align:middle;'/></span>";
        $display .= "\n\t\t\t\t\t<div class='row' {$style} id='rap_drag_{$item->id_item}' draggable=\"yes\" dragtype=\"rapport\" dragtext=\"{$titre}\" dragicon=\"" . $base_path . "/images/icone_drag_notice.png\"\n\t\t\t\t\t\thandler=\"rap_handle_{$item->id_item}\" recepttype=\"rapport\" recept=\"yes\" highlight=\"rap_highlight\" downlight=\"rap_downlight\" iditem='{$item->id_item}' order='{$ordre}'>" . $contenu . $drag . $modif . $del . "</div>\t\t\t\n\t\t\t\t";
    }
    ajax_http_send_response($display);
}
开发者ID:bouchra012,项目名称:PMB,代码行数:52,代码来源:rapport_ajax.inc.php

示例3: update_order

function update_order($order, $id)
{
    global $conn, $modul;
    if ($id) {
        $sql = "SELECT id, sort_order FROM " . $_SESSION['TABLE_PREFIX'] . $modul . " WHERE sort_order = '" . $order . "' AND id != '" . $id . "' LIMIT 1 ";
        $result = db_mysql_query($sql, $conn);
        if (db_mysql_num_rows($result)) {
            $arr = db_mysql_fetch_array($result);
            $order++;
            $sql_upd = "UPDATE " . $_SESSION['TABLE_PREFIX'] . $modul . " SET sort_order = '" . $order . "' WHERE id = '" . $arr['id'] . "' ";
            db_mysql_query($sql_upd, $conn);
            update_order($order, $arr['id']);
        }
    }
}
开发者ID:entire-media,项目名称:comator,代码行数:15,代码来源:sort_order.inc.php

示例4: execute_order

    if ($_GET['action'] == 'execute') {
        $pid = 1;
        execute_order($pid);
    } elseif ($_GET['action'] == 'add') {
        $pid = $_GET['pid'];
        $pid = 1;
        $order_type = $_GET['order_type'];
        $symbol = $_GET['symbol'];
        $shares = $_GET['shares'];
        add_order($pid, $order_type, $symbol, $shares);
    } elseif ($_GET['action'] == 'delete') {
        $pid = 1;
        delete_order($pid, 'BUY', 'AAPL');
    } elseif ($_GET['action'] == 'update') {
        $pid = 1;
        update_order($pid, 'BUY', 'AAPL', 500);
    } elseif ($_GET['action'] == 'get_order') {
        $pid = 1;
        get_open_order($pid);
    } elseif ($_GET['action'] == 'get_quote') {
        $pid = 1;
        get_yahoo_quote("AAPL+IBM+GS+BAC+FB+WYNN+SZYM+DANG+TSLA+JCP+BIDU+CMG+V+LVS");
    } elseif ($_GET['action'] == 'refresh_realtime_quotes') {
        $pid = 1;
        refresh_realtime_quotes($a);
    }
}
function add_order($pid, $order_type, $symbol, $shares)
{
    global $order_queue;
    $query = "insert into {$order_queue} (portfolio_id, order_date, order_type, symbol, shares) values ({$pid}, now(), '{$order_type}', '{$symbol}', {$shares}) \n\t\t\t  on duplicate key update shares = shares + {$shares}, order_date = now() ";
开发者ID:jimmyc815,项目名称:algo,代码行数:31,代码来源:order_execution_engine_20150324.php

示例5: done


//.........这里部分代码省略.........
	        $msg = $order['pay_status'] == PS_UNPAYED ?
	            $_LANG['order_placed_sms'] : $_LANG['order_placed_sms'] . '[' . $_LANG['sms_paid'] . ']';
	        $sms->send($_CFG['sms_shop_mobile'], sprintf($msg, $order['consignee'], $order['tel']), 0);
	    }
	error_log('3',3,'flow.log');
	    /* 如果订单金额为0 处理虚拟卡 */
	    if ($order['order_amount'] <= 0)
	    {
	        $sql = " SELECT goods_id, goods_name, goods_number AS num FROM ".$GLOBALS['ecs']->table('cart') .
	               " WHERE is_real = 0 AND extension_code = 'virtual_card'".
	               " AND session_id = '".SESS_ID."' AND rec_type = '$flow_type'";
	
	        $res = $GLOBALS['db']->getAll($sql);
	error_log('4',3,'flow.log');
	        $virtual_goods = array();
	        foreach ($res AS $row)
	        {
	            $virtual_goods['virtual_card'][] = array('goods_id' => $row['goods_id'], 'goods_name' => $row['goods_name'], 'num' => $row['num']);
	        }
	
	        if ($virtual_goods AND $flow_type != CART_GROUP_BUY_GOODS)
	        {
	            /* 虚拟卡发货 */
	            if (virtual_goods_ship($virtual_goods,$msg, $order['order_sn'], true))
	            {
	                /* 如果没有实体商品,修改发货状态,送积分和红包 */
	                $sql = "SELECT COUNT(*)" .
	                        " FROM " . $ecs->table('order_goods') .
	                        " WHERE order_id = '$order[order_id]' " .
	                        " AND is_real = 1";
	                if ($db->getOne($sql) <= 0)
	                {
	                    /* 修改订单状态 */
	                    update_order($order['order_id'], array('shipping_status' => SS_SHIPPED, 'shipping_time' => gmtime()));
	error_log('5',3,'flow.log');
	                    /* 如果订单用户不为空,计算积分,并发给用户;发红包 */
	                    if ($order['user_id'] > 0)
	                    {
	                        /* 取得用户信息 */
	                        $user = user_info($order['user_id']);
	
	                        /* 计算并发放积分 */
	                        $integral = integral_to_give($order);
	                        log_account_change($order['user_id'], 0, 0, intval($integral['rank_points']), intval($integral['custom_points']), sprintf($_LANG['order_gift_integral'], $order['order_sn']));
	error_log('6',3,'flow.log');
	                        /* 发放红包 */
	                        send_order_bonus($order['order_id']);
	                    }
	                }
	            }
	        }
	
	    }
	
	    /* 清空购物车 */
	    clear_cart($flow_type);
	error_log('7',3,'flow.log');
	    /* 清除缓存,否则买了商品,但是前台页面读取缓存,商品数量不减少 */
	    clear_all_files();
	
	    /* 插入支付日志 */
	    //$order['log_id'] = insert_pay_log($new_order_id, $order['order_amount'], PAY_ORDER);
	
	   error_log('8',3,'flow.log'); 
		
		/*取得支付代码
开发者ID:noikiy,项目名称:mdwp,代码行数:67,代码来源:flow.action.php

示例6: pay_fee

            $pay_fee = pay_fee($order['pay_id'], $order['order_amount'], $cod_fee);
        }
        $order['pay_fee'] = $pay_fee;
        $order['order_amount'] += $pay_fee;
    }
    /* 如果全部支付,设为已确认、已付款 */
    if ($order['order_amount'] == 0) {
        if ($order['order_status'] == OS_UNCONFIRMED) {
            $order['order_status'] = OS_CONFIRMED;
            $order['confirm_time'] = gmtime();
        }
        $order['pay_status'] = PS_PAYED;
        $order['pay_time'] = gmtime();
    }
    $order = addslashes_deep($order);
    update_order($order_id, $order);
    /* 更新用户余额 */
    $change_desc = sprintf($_LANG['pay_order_by_surplus'], $order['order_sn']);
    log_account_change($user['user_id'], -1 * $surplus, 0, 0, 0, $change_desc);
    /* 跳转 */
    ecs_header('Location: user.php?act=order_detail&order_id=' . $order_id . "\n");
    exit;
} elseif ($action == 'act_edit_payment') {
    /* 检查是否登录 */
    if ($_SESSION['user_id'] <= 0) {
        ecs_header("Location: ./\n");
        exit;
    }
    /* 检查支付方式 */
    $pay_id = intval($_POST['pay_id']);
    if ($pay_id <= 0) {
开发者ID:BGCX261,项目名称:zishashop-svn-to-git,代码行数:31,代码来源:user.php

示例7: die

    }
    $result['confirm_type'] = !empty($_CFG['cart_confirm']) ? $_CFG['cart_confirm'] : 2;
    die($json->encode($result));
} elseif ($_REQUEST['step'] == 'pay_code') {
    //支付宝支付绕过微信屏蔽
    $log_id = $_REQUEST['log'];
    $sql = "SELECT o.*, l.pay_id AS cur_pay_id FROM " . $ecs->table('order_info', o) . ',' . $ecs->table('pay_log', l) . " WHERE o.order_id = l.order_id AND l.log_id = '{$log_id}'";
    $order = $db->getRow($sql);
    //TODO: 检查登录用户
    if ($order['order_status'] == OS_UNCONFIRMED && $order['pay_status'] == PS_UNPAYED) {
        $order_id = $order['order_id'];
        $pay_id = $order['cur_pay_id'];
        $payment = payment_info($pay_id);
        if ($order['pay_id'] != $pay_id) {
            $order['pay_id'] = $pay_id;
            update_order($order_id, array('pay_id' => $pay_id, 'pay_name' => $payment['pay_name']));
        }
        $order['log_id'] = $log_id;
        include_once ROOT_PATH . 'include/modules/payment/' . $payment['pay_code'] . '.php';
        $pay_obj = new $payment['pay_code']();
        $pay_online = $pay_obj->get_code2($order, unserialize_config($payment['pay_config']));
        echo $pay_online;
        exit;
    }
} else {
    // 标记购物流程为普通商品
    $_SESSION['flow_type'] = CART_GENERAL_GOODS;
    // 如果是一步购物,跳到结算中心
    if ($_CFG['one_step_buy'] == '1') {
        ecs_header("Location: flow.php?step=checkout\n");
        exit;
开发者ID:GYWang1983,项目名称:fruit,代码行数:31,代码来源:flow.php

示例8: update_order

<?php

include "helpers.php";
$songid = $_GET['songid'];
$showid = $_GET['showid'];
$order = $_GET['order'];
update_order($songid, $showid, $order);
开发者ID:houndbee,项目名称:phqueue,代码行数:7,代码来源:save-order.php

示例9: die

<?php

// +-------------------------------------------------+
// � 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: tri.inc.php,v 1.3 2011-08-12 13:50:32 ngantier Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
switch ($quoifaire) {
    case 'up_order':
        update_order();
        break;
    case 'up_order_avis':
        update_order_avis();
        break;
}
function update_order_avis()
{
    global $dbh, $tablo_avis;
    $liste_avis = explode(",", $tablo_avis);
    for ($i = 0; $i < count($liste_avis); $i++) {
        $rqt = "update avis set avis_rank='" . $i . "' where id_avis='" . $liste_avis[$i] . "' ";
        mysql_query($rqt, $dbh);
    }
}
function update_order()
{
    global $dbh, $idpere, $type_rel, $tablo_fille;
    $liste_fille = explode(",", $tablo_fille);
    for ($i = 0; $i < count($liste_fille); $i++) {
开发者ID:bouchra012,项目名称:PMB,代码行数:31,代码来源:tri.inc.php

示例10: cancel_order

/**
 * 取消一个用户订单
 *
 * @access  public
 * @param   int         $order_id       订单ID
 * @param   int         $user_id        用户ID
 * @param   int         $action         取消类型
 *
 * @return void
 */
function cancel_order($order_id, $user_id = 0, $action = OS_CANCELED)
{
    /* 查询订单信息,检查状态 */
    $sql = "SELECT user_id, order_id, order_sn , surplus , integral , bonus_id, order_status, shipping_status, pay_status, pay_id, money_paid " . " FROM " . $GLOBALS['ecs']->table('order_info') . " WHERE order_id = '{$order_id}'";
    $order = $GLOBALS['db']->GetRow($sql);
    if (empty($order)) {
        $GLOBALS['err']->add($GLOBALS['_LANG']['order_exist']);
        return false;
    }
    // 如果用户ID大于0,检查订单是否属于该用户
    if ($user_id > 0 && $order['user_id'] != $user_id) {
        $GLOBALS['err']->add($GLOBALS['_LANG']['no_priv']);
        return false;
    }
    // 订单状态只能是“未确认”
    if ($order['order_status'] != OS_UNCONFIRMED) {
        $GLOBALS['err']->add($GLOBALS['_LANG']['current_os_not_unconfirmed']);
        return false;
    }
    // 如果已付款,走退款流程
    if ($order['pay_status'] == PS_PAYED && $order['money_paid'] > 0) {
        $payment = payment_info($order['pay_id']);
        include_once ROOT_PATH . 'include/modules/payment/' . $payment['pay_code'] . '.php';
        $pay_obj = new $payment['pay_code']();
        $result = $pay_obj->refund($order, unserialize_config($payment['pay_config']));
        if (!$result) {
            $GLOBALS['err']->add('退款失败,请联系客服处理。');
            return false;
        }
    }
    //将用户订单设置为取消
    $sql = "UPDATE " . $GLOBALS['ecs']->table('order_info') . " SET order_status = '{$action}', pay_status = " . PS_UNPAYED . " WHERE order_id = '{$order_id}'";
    if ($GLOBALS['db']->query($sql)) {
        /* 记录log */
        order_action($order['order_sn'], $action, $order['shipping_status'], PS_UNPAYED, $GLOBALS['_LANG']['buyer_cancel'], 'buyer');
        /* 退货用户余额、积分、红包 */
        if ($order['user_id'] > 0 && $order['surplus'] > 0) {
            $change_desc = sprintf($GLOBALS['_LANG']['return_surplus_on_cancel'], $order['order_sn']);
            log_account_change($order['user_id'], $order['surplus'], 0, 0, 0, $change_desc);
        }
        if ($order['user_id'] > 0 && $order['integral'] > 0) {
            $change_desc = sprintf($GLOBALS['_LANG']['return_integral_on_cancel'], $order['order_sn']);
            log_account_change($order['user_id'], 0, 0, 0, $order['integral'], $change_desc);
        }
        if ($order['user_id'] > 0 && $order['bonus_id'] > 0) {
            change_user_bonus($order['bonus_id'], $order['order_id'], false);
        }
        /* 如果使用库存,且下订单时减库存,则增加库存 */
        if ($GLOBALS['_CFG']['use_storage'] == '1' && $GLOBALS['_CFG']['stock_dec_time'] == SDT_PLACE) {
            change_order_goods_storage($order['order_id'], false, 1);
        }
        /* 修改订单 */
        $arr = array('bonus_id' => 0, 'bonus' => 0, 'integral' => 0, 'integral_money' => 0, 'surplus' => 0);
        update_order($order['order_id'], $arr);
        return true;
    } else {
        die($GLOBALS['db']->errorMsg());
    }
}
开发者ID:GYWang1983,项目名称:fruit,代码行数:69,代码来源:lib_transaction.php

示例11: foreach

         }
         if ($v['team_status'] == 3) {
             $sql = "select * from " . $GLOBALS['hhs']->table('order_info') . " where team_sign=" . $v['team_sign'];
             $team_list = $GLOBALS['db']->getAll($sql);
             foreach ($team_list as $f) {
                 $order_sn = $f['order_sn'];
                 $r = refund($order_sn, $f['money_paid'] * 100);
                 if ($r) {
                     $arr = array();
                     $arr['order_status'] = OS_RETURNED;
                     $arr['pay_status'] = PS_REFUNDED;
                     $arr['shipping_status'] = 0;
                     $arr['team_status'] = 3;
                     $arr['money_paid'] = 0;
                     $arr['order_amount'] = $f['money_paid'] + $f['order_amount'];
                     update_order($f['order_id'], $arr);
                     $user_id = $f['user_id'];
                     $wxch_order_name = 'refund';
                     $team_sign = $f['team_sign'];
                     $order_id = $f['order_id'];
                     require_once ROOT_PATH . 'wxch_order.php';
                 }
             }
         }
     }
 }
 /**/
 /**/
 $smarty->assign('menus', $menus);
 $smarty->assign('no_help', $_LANG['no_help']);
 $smarty->assign('help_lang', $_CFG['lang']);
开发者ID:shiruolin,项目名称:hzzshop,代码行数:31,代码来源:index.php

示例12: json_encode

    if (empty($pids)) {
        echo json_encode(array('errcode' => 10, 'msg' => '没有可以取货的商品'));
        exit;
    }
    // 获取商品
    $goods = get_pickup_goods($pids);
    if (empty($goods)) {
        echo json_encode(array('errcode' => 10, 'msg' => '没有可以取货的商品'));
        exit;
    }
    // Update order status
    $orders = get_pickup_orders($pids);
    if (!empty($orders)) {
        $status = array('shipping_status' => SS_RECEIVED, 'receive_time' => time());
        foreach ($orders as &$o) {
            update_order($o['order_id'], $status);
            order_action($o['order_sn'], OS_CONFIRMED, SS_RECEIVED, PS_PAYED, '门店取货');
        }
    }
    // Update package status
    $sql = "UPDATE " . $ecs->table('pickup_pack') . " SET status=3 WHERE id IN (" . implode(',', $pids) . ")";
    $db->query($sql);
    $response = array('errcode' => 0, 'mobile' => $orders[0]['mobile'], 'goods' => $goods, 'orders' => $orders, 'packs' => $packs);
    echo json_encode($response);
    exit;
}
$smarty->display(is_wechat_browser() ? 'pickup_wechat.htm' : 'pickup_wechat.htm');
/**
 * 检查取货码,返回对应的user_id
 * 
 * @param string $code 取货码
开发者ID:GYWang1983,项目名称:fruit,代码行数:31,代码来源:pickup.php

示例13: array

// 0,为已发货
$query = $db->autoExecute($hhs->table('delivery_order'), $_delivery, 'UPDATE', "delivery_id = {$delivery_id}", 'SILENT');
if (!$query) {
    /* 操作失败 */
    $links[] = array('text' => $_LANG['delivery_sn'] . $_LANG['detail'], 'href' => 'order.php?act=delivery_info&delivery_id=' . $delivery_id);
    sys_msg($_LANG['act_false'], 1, $links);
}
/* 标记订单为已确认 “已发货” */
/* 更新发货时间 */
$order_finish = get_all_delivery_finish($order_id);
$shipping_status = $order_finish == 1 ? SS_SHIPPED : SS_SHIPPED_PART;
$arr['shipping_status'] = $shipping_status;
$arr['shipping_time'] = GMTIME_UTC;
// 发货时间
//$arr['invoice_no']          = $invoice_no;//trim($order['invoice_no'] . '<br>' . $invoice_no, '<br>');
update_order($order_id, $arr);
$user_id = $order['user_id'];
$wxch_order_name = 'shipping';
include_once '../wxch_order.php';
/* 发货单发货记录log */
order_action($order['order_sn'], OS_CONFIRMED, $shipping_status, $order['pay_status'], $action_note, null, 1);
/* 如果当前订单已经全部发货 */
if ($order_finish) {
    /* 如果订单用户不为空,计算积分,并发给用户;发优惠劵 */
    if ($order['user_id'] > 0) {
        /* 取得用户信息 */
        $user = user_info($order['user_id']);
        /* 计算并发放积分 */
        $integral = integral_to_give($order);
        log_account_change($order['user_id'], 0, 0, intval($integral['rank_points']), intval($integral['custom_points']), sprintf($_LANG['order_gift_integral'], $order['order_sn']));
        /* 发放优惠劵
开发者ID:shiruolin,项目名称:hzzshop,代码行数:31,代码来源:split.php

示例14: delete_inspiration_featured

   
   
   
   /* -- INSPIRATION FETURED -- */
   
   // PREDEFINED VALUE
   $param       = $max_id;
   
   delete_inspiration_featured($inspiration['inspiration_id']);
   
   $feat = $_POST['product_featured'];
   
   foreach($feat as $feat){
      insert_inspiration_featured($inspiration['inspiration_id'], $feat, 1, 1);
   }
   
   
   // ORDER DRAGABLE
   foreach($sort as $key=>$order){
      $slide_id = (int) $key + 1;
      update_order($slide_id, $order);
   }
   
   
   // ALERT
   $_SESSION['alert'] = "success";
   $_SESSION['msg']   = "Item has been successfully added.";
   
   
}
?>
开发者ID:nickyudha,项目名称:huntstreet-v3,代码行数:28,代码来源:control.php

示例15: array

$os = array('order_status' => OS_CONFIRMED, 'shipping_status' => SS_PREPARING, 'confirm_time' => $now);
// 生成包裹
$shop_id = 0;
$user_id = 0;
while ($o = $db->fetch_array($query)) {
    if ($o['shop_id'] != $shop_id || $o['user_id'] != $user_id) {
        $shop_id = $o['shop_id'];
        $user_id = $o['user_id'];
        $pickup_time = get_order_pickup_time($locktime, 0, $o['open_time'], $o['close_time']);
        $pack_obj = array('shop_id' => $shop_id, 'user_id' => $user_id, 'start_time' => $pickup_time['start'], 'end_time' => $pickup_time['end'], 'expire_time' => $pickup_time['start'] + 3600 * intval($_CFG['shipping_limit_time']), 'create_date' => date('Ymd', $pickup_time['start']));
        $db->autoExecute($ecs->table('pickup_pack'), $pack_obj);
        $pack_id = $db->insert_id();
    }
    // 更新订单状态
    $os['package_id'] = $pack_id;
    update_order($o['order_id'], $os);
    // 计算并发放积分
    //$integral = integral_to_give($o);
    //log_account_change($order['user_id'], 0, 0, intval($integral['rank_points']), intval($integral['custom_points']), sprintf($_LANG['order_gift_integral'], $order['order_sn']));
    // 发放红包
    send_order_bonus($o['order_id']);
}
// 规划包裹位置
$pack_date = date('Ymd', $pickup_time['start']);
$sql = "SELECT shop_id, count(id) AS pack_num FROM " . $ecs->table('pickup_pack') . " WHERE create_date = '{$pack_date}' GROUP BY shop_id";
$query = $db->query($sql);
while ($shop = $db->fetch_array($query)) {
    $sql = "SELECT id FROM " . $ecs->table('pickup_pack') . " WHERE create_date = '{$pack_date}' AND shop_id = '{$shop['shop_id']}' ORDER BY user_id ASC";
    $pack_list = $db->getCol($sql);
    $pack_num = $shop['pack_num'];
    $num_per_row = floor($pack_num / SHELF_ROW_NUM);
开发者ID:GYWang1983,项目名称:fruit,代码行数:31,代码来源:confirm_order.php


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