本文整理汇总了PHP中update_order函数的典型用法代码示例。如果您正苦于以下问题:PHP update_order函数的具体用法?PHP update_order怎么用?PHP update_order使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了update_order函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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 [email protected] 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
示例16: pos_order_shipping
/**
* 变更订单的发货状态
*
* @access private
* @param string $brand_name
* @return array
*/
function pos_order_shipping($order_id)
{
if (!check_priviege()) {
exit;
}
$operation = 'ship';
/* 查询订单信息 */
$order = order_info($order_id);
/* 检查能否操作 */
$operable_list = operable_list($order);
if (!isset($operable_list[$operation])) {
die('Hacking attempt');
}
if ($order['order_status'] != OS_CONFIRMED) {
$post['order_status'] = OS_CONFIRMED;
$post['confirm_time'] = gmtime();
}
$post['shipping_status'] = SS_SHIPPED;
$post['shipping_time'] = gmtime();
update_order($order_id, $post);
$action_note = '[OrderHelper ' . TUNNELVERSION . '] 打印快递单';
/* 记录log */
order_action($order['order_sn'], OS_CONFIRMED, SS_SHIPPED, $order['pay_status'], $action_note);
}
开发者ID:babaloveyou1,项目名称:uims,代码行数:31,代码来源:orders.php
示例17: respond
/**
* 處理函數
*/
function respond()
{
$arPayment = get_payment('ecshop_allpay_atm');
$isTestMode = $arPayment['ecshop_allpay_atm_test_mode'] == 'Yes';
$arFeedback = null;
$arQueryFeedback = null;
$szLogID = $_GET['log_id'];
$szOrderID = $_GET['order_id'];
//$isPaymentInfo = ($_GET['pi'] == 'true');
$this->HashKey = trim($arPayment['ecshop_allpay_atm_key']);
$this->HashIV = trim($arPayment['ecshop_allpay_atm_iv']);
try {
// 取得回傳的付款結果。
$arFeedback = $this->CheckOutFeedback();
if (sizeof($arFeedback) > 0) {
// 查詢付款結果資料。
$this->ServiceURL = $isTestMode ? "https://payment-stage.allpay.com.tw/Cashier/QueryTradeInfo/v2" : "https://payment.allpay.com.tw/Cashier/QueryTradeInfo/V2";
$this->MerchantID = trim($arPayment['ecshop_allpay_atm_account']);
$this->Query['MerchantTradeNo'] = $arFeedback['MerchantTradeNo'];
$arQueryFeedback = $this->QueryTradeInfo();
if (sizeof($arQueryFeedback) > 0) {
$arOrder = order_info($szOrderID);
// 檢查支付金額與訂單是否相符。
if (round($arOrder['order_amount']) == $arFeedback['TradeAmt'] && $arQueryFeedback['TradeAmt'] == $arFeedback['TradeAmt']) {
$szCheckAmount = '1';
}
// 確認產生虛擬帳號。
if ($arFeedback['RtnCode'] == '2' && $szCheckAmount == '1' && $arQueryFeedback["TradeStatus"] == '0') {
$szPaymentType = $arFeedback['PaymentType'];
$szTradeDate = $arFeedback['TradeDate'];
$szBankCode = $arFeedback['BankCode'];
$szVirtualAccount = $arFeedback['vAccount'];
$szExpireDate = $arFeedback['ExpireDate'];
$szNote = sprintf($GLOBALS['_LANG']['text_paying'], date("Y-m-d H:i:s"), $szPaymentType, $szTradeDate, $szBankCode, $szVirtualAccount, $szExpireDate);
// 變更訂單狀態為已確認
update_order($szOrderID, array('order_status' => OS_CONFIRMED, 'confirm_time' => gmtime()));
// 將付款資訊記入操作訊息
order_action($arOrder['order_sn'], OS_CONFIRMED, $arOrder['shipping_status'], $arOrder['pay_status'], $szNote);
ob_get_clean();
print '1|OK';
exit;
}
// 確認付款結果。
if ($arFeedback['RtnCode'] == '1' && $szCheckAmount == '1' && $arQueryFeedback["TradeStatus"] == '1') {
$szNote = $GLOBALS['_LANG']['text_paid'] . date("Y-m-d H:i:s");
order_paid($szLogID, PS_PAYED, $szNote);
if ($_GET['background']) {
echo '1|OK';
exit;
} else {
return true;
}
} else {
if ($_GET['background']) {
echo !$szCheckAmount ? '0|訂單金額不符。' : $arFeedback['RtnMsg'];
exit;
} else {
return false;
}
}
} else {
throw new Exception('AllPay 查無訂單資料。');
}
}
} catch (Exception $ex) {
/* 例外處理 */
}
return false;
}
开发者ID:sac071213,项目名称:dev,代码行数:72,代码来源:ecshop_allpay_atm.php
示例18: handle_order_money_change
/**
* 处理编辑订单时订单金额变动
* @param array $order 订单信息
* @param array $msgs 提示信息
* @param array $links 链接信息
*/
function handle_order_money_change($order, &$msgs, &$links)
{
$order_id = $order['order_id'];
if ($order['pay_status'] == PS_PAYED || $order['pay_status'] == PS_PAYING) {
/* 应付款金额 */
$money_dues = $order['order_amount'];
if ($money_dues > 0) {
/* 修改订单为未付款 */
update_order($order_id, array('pay_status' => PS_UNPAYED, 'pay_time' => 0));
$msgs[] = $GLOBALS['_LANG']['amount_increase'];
$links[] = array('text' => $GLOBALS['_LANG']['order_info'], 'href' => 'order.php?act=info&order_id=' . $order_id);
} elseif ($money_dues < 0) {
$anonymous = $order['user_id'] > 0 ? 0 : 1;
$msgs[] = $GLOBALS['_LANG']['amount_decrease'];
$links[] = array('text' => $GLOBALS['_LANG']['refund'], 'href' => 'order.php?act=process&func=load_refund&anonymous=' . $anonymous . '&order_id=' . $order_id . '&refund_amount=' . abs($money_dues));
}
}
}
开发者ID:seanguo166,项目名称:yinoos,代码行数:24,代码来源:order.php
示例19: action_insert_update
/**
* 添加/编辑预售活动的提交
*/
function action_insert_update()
{
$user = $GLOBALS['user'];
$_CFG = $GLOBALS['_CFG'];
$_LANG = $GLOBALS['_LANG'];
$smarty = $GLOBALS['smarty'];
$db = $GLOBALS['db'];
$ecs = $GLOBALS['ecs'];
$user_id = $_SESSION['user_id'];
/* 取得预售活动id */
$pre_sale_id = intval($_POST['act_id']);
if (isset($_POST['finish']) || isset($_POST['succeed']) || isset($_POST['fail']) || isset($_POST['mail'])) {
if ($pre_sale_id <= 0) {
sys_msg($_LANG['error_pre_sale'], 1);
}
$pre_sale = pre_sale_info($pre_sale_id);
if (empty($pre_sale)) {
sys_msg($_LANG['error_pre_sale'], 1);
}
}
if (isset($_POST['finish'])) {
/* 设置活动结束 */
/* 判断活动状态 */
if ($pre_sale['status'] != PSS_UNDER_WAY) {
sys_msg($_LANG['error_status'], 1);
// 此处怀疑是如果活动进行中突然要结束掉,应该抛出禁止的页面,貌似去掉了,所以程序继续执行
}
/* 结束预售活动,修改结束时间为当前时间 */
$sql = "UPDATE " . $ecs->table('goods_activity') . " SET end_time = '" . gmtime() . "' " . "WHERE act_id = '{$pre_sale_id}' LIMIT 1";
$db->query($sql);
/* 清除缓存 */
clear_cache_files();
/* 提示信息 */
$links = array(array('href' => 'pre_sale.php?act=list', 'text' => $_LANG['back_list']));
sys_msg($_LANG['edit_success'], 0, $links);
} elseif (isset($_POST['succeed'])) {
/* 设置活动成功 */
/* 判断订单状态 */
if ($pre_sale['status'] != PSS_FINISHED) {
sys_msg($_LANG['error_status'], 1);
}
/* 如果有订单,更新订单信息 */
if ($pre_sale['total_order'] > 0) {
/* 查找该预售活动的已确认或未确认订单(已取消的就不管了) */
$sql = "SELECT order_id " . "FROM " . $ecs->table('order_info') . " WHERE extension_code = '" . PRE_SALE_CODE . "' " . "AND extension_id = '{$pre_sale_id}' " . "AND (order_status = '" . OS_CONFIRMED . "' or order_status = '" . OS_UNCONFIRMED . "')";
$order_id_list = $db->getCol($sql);
/* 更新订单商品价 */
$final_price = $pre_sale['trans_price'];
$sql = "UPDATE " . $ecs->table('order_goods') . " SET goods_price = '{$final_price}' " . "WHERE order_id " . db_create_in($order_id_list);
$db->query($sql);
/* 查询订单商品总额 */
$sql = "SELECT order_id, SUM(goods_number * goods_price) AS goods_amount " . "FROM " . $ecs->table('order_goods') . " WHERE order_id " . db_create_in($order_id_list) . " GROUP BY order_id";
$res = $db->query($sql);
while ($row = $db->fetchRow($res)) {
$order_id = $row['order_id'];
$goods_amount = floatval($row['goods_amount']);
/* 取得订单信息 */
$order = order_info($order_id);
/* 判断订单是否有效:余额支付金额 + 已付款金额 >= 保证金 */
if ($order['surplus'] + $order['money_paid'] >= $pre_sale['deposit']) {
/* 有效,设为已确认,更新订单 */
// 更新商品总额
$order['goods_amount'] = $goods_amount;
// 如果保价,重新计算保价费用
if ($order['insure_fee'] > 0) {
$shipping = shipping_info($order['shipping_id']);
$order['insure_fee'] = shipping_insure_fee($shipping['shipping_code'], $goods_amount, $shipping['insure']);
}
// 重算支付费用
$order['order_amount'] = $order['goods_amount'] + $order['shipping_fee'] + $order['insure_fee'] + $order['pack_fee'] + $order['card_fee'] - $order['money_paid'] - $order['surplus'];
if ($order['order_amount'] > 0) {
$order['pay_fee'] = pay_fee($order['pay_id'], $order['order_amount']);
} else {
$order['pay_fee'] = 0;
}
// 计算应付款金额
$order['order_amount'] += $order['pay_fee'];
// 计算付款状态
if ($order['order_amount'] > 0) {
$order['pay_status'] = PS_UNPAYED;
$order['pay_time'] = 0;
} else {
$order['pay_status'] = PS_PAYED;
$order['pay_time'] = gmtime();
}
// 如果需要退款,退到帐户余额
if ($order['order_amount'] < 0) {
// todo (现在手工退款)
}
// 订单状态
$order['order_status'] = OS_CONFIRMED;
$order['confirm_time'] = gmtime();
// 更新订单
$order = addslashes_deep($order);
update_order($order_id, $order);
} else {
/* 无效,取消订单,退回已付款 */
//.........这里部分代码省略.........
开发者ID:seanguo166,项目名称:yinoos,代码行数:101,代码来源:pre_sale.php
示例20: order_refund
$order['order_status'] = OS_CANCELED;
$order['to_buyer'] = $_LANG['cancel_order_reason'];
$order['pay_status'] = PS_UNPAYED;
$order['pay_time'] = 0;
/* 如果使用余额或有已付款金额,退回帐户余额 */
$money = $order['surplus'] + $order['money_paid'];
if ($money > 0) {
$order['surplus'] = 0;
$order['money_paid'] = 0;
$order['order_amount'] = $money;
// 退款到帐户余额
order_refund($order, 1, $_LANG['cancel_order_reason'] . ':' . $order['order_sn'], $money);
}
/* 更新订单 */
$order = addslashes_deep($order);
update_order($order['order_id'], $order);
}
}
/* 修改团购活动状态为失败,记录失败原因(活动说明) */
$sql = "UPDATE " . $ecs->table('goods_activity') . " SET is_finished = '" . GBS_FAIL . "', " . "act_desc = '{$_POST['act_desc']}' " . "WHERE act_id = '{$group_buy_id}' LIMIT 1";
$db->query($sql);
/* 清除缓存 */
clear_cache_files();
/* 提示信息 */
$links = array(array('href' => 'group_buy.php?act=list', 'text' => $_LANG['ba
|
请发表评论