本文整理汇总了PHP中get_order_goods函数的典型用法代码示例。如果您正苦于以下问题:PHP get_order_goods函数的具体用法?PHP get_order_goods怎么用?PHP get_order_goods使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_order_goods函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_user_orders_1
/**
* 获取用户指定范围的订单列表
*
* @access public
* @param int $user_id 用户ID号
* @param int $num 列表最大数量
* @param int $start 列表起始位置
* @return array $order_list 订单列表
*/
function get_user_orders_1($user_id, $num = 10, $start = 0, $where = '')
{
/* 取得订单列表 */
$arr = array();
$sql = "SELECT o.*, ifnull(ssc.value,'网站自营') as shopname, " . "(goods_amount + shipping_fee + insure_fee + pay_fee + pack_fee + card_fee + tax - discount) AS total_fee " . " FROM " . $GLOBALS['ecs']->table('order_info') . ' as o ' . " LEFT JOIN " . $GLOBALS['ecs']->table('supplier_shop_config') . 'as ssc ' . " ON o.supplier_id=ssc.supplier_id AND ssc.code='shop_name' " . " WHERE user_id = '{$user_id}' {$where} ORDER BY add_time DESC";
$res = $GLOBALS['db']->SelectLimit($sql, $num, $start);
while ($row = $GLOBALS['db']->fetchRow($res)) {
if ($row['order_status'] == OS_UNCONFIRMED) {
$row['handler'] = "<a href=\"user.php?act=cancel_order&order_id=" . $row['order_id'] . "\" onclick=\"if (!confirm('" . $GLOBALS['_LANG']['confirm_cancel'] . "')) return false;\">" . $GLOBALS['_LANG']['cancel'] . "</a>";
} else {
if ($row['order_status'] == OS_SPLITED) {
/* 对配送状态的处理 */
if ($row['shipping_status'] == SS_SHIPPED) {
$back_num = $GLOBALS['db']->getOne("SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('back_order') . " WHERE order_id = " . $row['order_id'] . " AND status_back < 6 AND status_back != 3");
if ($back_num > 0) {
$back_info = "此单存在正在退货商品,确认收货退货申请将取消。";
} else {
$back_info = "";
}
@($okgoods_time = $GLOBALS['db']->getOne("select value from " . $GLOBALS['ecs']->table('shop_config') . " where code='okgoods_time'"));
@($row_time = $okgoods_time - (local_date('d', gmtime()) - local_date('d', $row['shipping_time'])));
@($row['handler'] = "<strong><img src='themesmobile/" . $GLOBALS['_CFG']['template'] . "/images/time.png' height='30px' style='vertical-align:middle;'/>还剩" . $row_time . "天自动收货</strong><a href=\"user.php?act=affirm_received&order_id=" . $row['order_id'] . "\" onclick=\"if (!confirm('" . $back_info . $GLOBALS['_LANG']['confirm_received'] . "')) return false;\" style='display:inline-block; margin-top:12px; width:80px; height:25px; font-size:14px; line-height:25px; border:1px solid #F60; color:#fff; text-align:center;border-radius:5px; background:#F60 '>" . $GLOBALS['_LANG']['received'] . "</a>");
} elseif ($row['shipping_status'] == SS_RECEIVED) {
@($row['handler'] = '<span style="color:red">' . $GLOBALS['_LANG']['ss_received'] . '</span>');
} else {
if ($row['pay_status'] == PS_UNPAYED) {
@($row['handler'] = "<a href=\"user.php?act=order_detail&order_id=" . $row['order_id'] . '">' . $GLOBALS['_LANG']['pay_money'] . '</a>');
} else {
@($row['handler'] = "<a href=\"user.php?act=order_detail&order_id=" . $row['order_id'] . '">' . $GLOBALS['_LANG']['view_order'] . '</a>');
}
}
} else {
$row['handler'] = '<span style="color:red">' . $GLOBALS['_LANG']['os'][$row['order_status']] . '</span>';
}
}
$row['shipping_status'] = $row['shipping_status'] == SS_SHIPPED_ING ? SS_PREPARING : $row['shipping_status'];
$row['order_status1'] = $row['order_status'];
$row['order_status'] = $GLOBALS['_LANG']['os'][$row['order_status']] . ',' . $GLOBALS['_LANG']['ps'][$row['pay_status']] . ',' . $GLOBALS['_LANG']['ss'][$row['shipping_status']];
$cod_code = $GLOBALS['db']->getOne("select pay_code from " . $GLOBALS['ecs']->table('payment') . " where pay_id=" . $row['pay_id']);
$weixiu_time = $GLOBALS['db']->getOne("select value from " . $GLOBALS['ecs']->table('ecsmart_shop_config') . " where code='weixiu_time'");
$row['weixiu_time'] = $weixiu_time - (local_date('d', gmtime()) - local_date('d', $order['shipping_time_end'])) <= 0 ? 0 : 1;
$back_can_a = 1;
$comment_s = 0;
$shaidan_s = 0;
$goods_list_r = get_order_goods($row);
foreach ($goods_list_r as $g_val) {
if ($g_val['back_can'] == 0) {
$back_can_a = 0;
}
if ($g_val['comment_state'] == 0 && $g_val['is_back'] == 0 && $comment_s == 0) {
$comment_s = $g_val['rec_id'];
}
if ($g_val['shaidan_state'] == 0 && $g_val['is_back'] == 0 && $shaidan_s == 0) {
$shaidan_s = $g_val['rec_id'];
}
}
$arr[$row['order_id']] = array('order_id' => $row['order_id'], 'order_sn' => $row['order_sn'], 'shopname' => $row['shopname'], 'order_time' => local_date($GLOBALS['_CFG']['time_format'], $row['add_time']), 'order_status' => str_replace(',', ' ', $row['order_status']), 'order_status1' => $row['order_status1'], 'back_can_a' => $back_can_a, 'comment_s' => $comment_s, 'shaidan_s' => $shaidan_s, 'total_fee' => price_format($row['total_fee'], false), 'goods_list' => $goods_list_r, 'pay_online' => $row['pay_online'], 'is_suborder' => $row['parent_order_id'] ? "(子订单)" : "", 'pay_status' => $row['pay_status'], 'handler' => $row['handler'], 'shipping_id' => $row['shipping_id'], 'shipping_name' => $row['shipping_name'], 'shipping_status' => $row['shipping_status'], 'pay_id' => $cod_code == 'cod' ? '' : $row['pay_id'], 'invoice_no' => $row['invoice_no'], 'weixiu_time' => $row['weixiu_time'], 'supplier_id' => $row['supplier_id'], 'count' => count($goods_list_r));
}
return $arr;
}
开发者ID:moonlight-wang,项目名称:feilun,代码行数:69,代码来源:lib_transaction_1.php
示例2: index
public function index()
{
$pay_status = intval($GLOBALS['request']['pay_status']);
/*0:未付款 、部分,2:已付款*/
$city_name = strim($GLOBALS['request']['city_name']);
//城市名称
//检查用户,用户密码
$user = $GLOBALS['user_info'];
$user_id = intval($user['id']);
$root = array();
$root['return'] = 1;
if ($user_id > 0) {
require_once APP_ROOT_PATH . "system/model/deal_order.php";
$order_table_name = get_user_order_table_name($user_id);
$root['user_login_status'] = 1;
if ($pay_status == 2) {
$pay_status_and = " and pay_status=2 ";
} else {
$pay_status_and = " and pay_status in(0,1) ";
}
//$nowPage = intval($GLOBALS['request']['page']); //当前分页
$nowPage = intval($GLOBALS['request']['page']) ? intval($GLOBALS['request']['page']) : 1;
//当前分页
$totalRows = intval($GLOBALS['request']['totalRows']);
//总记录数
$pageRows = PAGE_SIZE;
//每页显示记录数
$limit = ($nowPage - 1) * $pageRows . "," . $pageRows;
if ($totalRows == 0) {
$totalRows = $GLOBALS['db']->getOne("select count(*) from " . $order_table_name . " where user_id = " . $user_id . " and type = 0 and is_delete = 0 {$pay_status_and}");
}
$totalPages = ceil($totalRows / $pageRows);
//总页数
//$root = array();
$root['totalPages'] = $totalPages;
//总页数
$root['pageRows'] = $pageRows;
//页记录数
$root['nowPage'] = $nowPage;
//当前页
$root['totalRows'] = $totalRows;
//总记录数
$list = $GLOBALS['db']->getAll("select * from " . $order_table_name . " where user_id = " . $user_id . " and type = 0 and is_delete = 0 {$pay_status_and} order by create_time desc limit " . $limit);
$root['return'] = 1;
$orderlist = array();
foreach ($list as $item) {
$orderlist[] = get_order_goods($item);
}
$root['item'] = $orderlist;
if ($pay_status < 2) {
$root['not_pay_count'] = $totalRows;
}
$root['page'] = array("page" => $nowPage, "page_total" => $totalPages, "page_size" => PAGE_SIZE);
} else {
$root['user_login_status'] = 0;
}
$root['city_name'] = $city_name;
$root['page_title'] = '订单列表';
output($root);
}
开发者ID:macall,项目名称:jsd,代码行数:60,代码来源:my_order_list.action.php
示例3: index
public function index()
{
$email = strim($GLOBALS['request']['email']);
//用户名或邮箱
$pwd = strim($GLOBALS['request']['pwd']);
//密码
//检查用户,用户密码
$user = user_check($email, $pwd);
$user_id = intval($user['id']);
$root = array();
$root['return'] = 1;
if ($user_id > 0) {
$root['user_login_status'] = 1;
$nowPage = intval($GLOBALS['request']['page']);
//当前分页
$totalRows = intval($GLOBALS['request']['totalRows']);
//总记录数
$pageRows = PAGE_SIZE;
//每页显示记录数
$limit = ($nowPage - 1) * $pageRows . "," . $pageRows;
if ($totalRows == 0) {
$totalRows = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal_order where user_id = " . $user_id . " and type = 0 and is_delete = 0");
}
$totalPages = ceil($totalRows / $pageRows);
//总页数
//$root = array();
$root['totalPages'] = $totalPages;
//总页数
$root['pageRows'] = $pageRows;
//页记录数
$root['nowPage'] = $nowPage;
//当前页
$root['totalRows'] = $totalRows;
//总记录数
$list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal_order where user_id = " . $user_id . " and type = 0 and is_delete = 0 order by create_time desc limit " . $limit);
$root['return'] = 1;
$orderlist = array();
foreach ($list as $item) {
$orderlist[] = get_order_goods($item);
}
$root['item'] = $orderlist;
$root['page'] = array("page" => $nowPage, "page_total" => $totalPages);
} else {
$root['user_login_status'] = 0;
}
output($root);
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:47,代码来源:my_order_list.action.php
示例4: get_user_orders_1
/**
* 获取用户指定范围的订单列表
*
* @access public
* @param int $user_id 用户ID号
* @param int $num 列表最大数量
* @param int $start 列表起始位置
* @return array $order_list 订单列表
*/
function get_user_orders_1($user_id, $num = 10, $start = 0, $where = '')
{
/* 取得订单列表 */
$arr = array();
$sql = "SELECT o.*, ifnull(ssc.value,'网站自营') as shopname, " . "(goods_amount + shipping_fee + insure_fee + pay_fee + pack_fee + card_fee + tax - discount) AS total_fee " . " FROM " . $GLOBALS['ecs']->table('order_info') . ' as o ' . " LEFT JOIN " . $GLOBALS['ecs']->table('supplier_shop_config') . 'as ssc ' . " ON o.supplier_id=ssc.supplier_id AND ssc.code='shop_name' " . " WHERE user_id = '{$user_id}' {$where} ORDER BY add_time DESC";
$res = $GLOBALS['db']->SelectLimit($sql, $num, $start);
while ($row = $GLOBALS['db']->fetchRow($res)) {
if ($row['order_status'] == OS_UNCONFIRMED) {
$row['handler'] = "<a href=\"user.php?act=cancel_order&order_id=" . $row['order_id'] . "\" onclick=\"if (!confirm('" . $GLOBALS['_LANG']['confirm_cancel'] . "')) return false;\">" . $GLOBALS['_LANG']['cancel'] . "</a>";
} else {
if ($row['order_status'] == OS_SPLITED) {
/* 对配送状态的处理 */
if ($row['shipping_status'] == SS_SHIPPED) {
$back_num = $GLOBALS['db']->getOne("SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('back_order') . " WHERE order_id = " . $row['order_id'] . " AND status_back < 6 AND status_back != 3");
if ($back_num > 0) {
$back_info = "此单存在正在退货商品,确认收货退货申请将取消。";
} else {
$back_info = "";
}
@($okgoods_time = $GLOBALS['db']->getOne("select value from " . $GLOBALS['ecs']->table('shop_config') . " where code='okgoods_time'"));
@($row_time = $okgoods_time - (local_date('d', gmtime()) - local_date('d', $row['shipping_time'])));
//@$row['handler'] = "<img src='themes/" . $GLOBALS['_CFG']['template']. "/images/endtime.jpg' height='18px' style='vertical-align:middle;margin-right:3px;'/>Expect delivered time " . $row_time . " Days <br> <a href=\"user.php?act=affirm_received&order_id=" .$row['order_id']. "\" onclick=\"if (!confirm('".$back_info.$GLOBALS['_LANG']['confirm_received']."')) return false;\" style='display:inline-block;background:#F60;color:#fff;padding:3px 5px ;margin:3px 0px;'>".$GLOBALS['_LANG']['received']."</a>";
@($row['handler'] = "Shipped <br> <a href=\"user.php?act=affirm_received&order_id=" . $row['order_id'] . "\" onclick=\"if (!confirm('" . $back_info . $GLOBALS['_LANG']['confirm_received'] . "')) return false;\" style='display:inline-block;background:#F60;color:#fff;padding:3px 5px ;margin:3px 0px;'>" . $GLOBALS['_LANG']['received'] . "</a>");
} elseif ($row['shipping_status'] == SS_RECEIVED) {
@($row['handler'] = '<span style="color:red">' . $GLOBALS['_LANG']['ss_received'] . '</span>');
} else {
if ($row['pay_status'] == PS_UNPAYED) {
@($row['handler'] = "<a href=\"user.php?act=order_detail&order_id=" . $row['order_id'] . '">' . $GLOBALS['_LANG']['pay_money'] . '</a>');
} else {
@($row['handler'] = "<a href=\"user.php?act=order_detail&order_id=" . $row['order_id'] . '">' . $GLOBALS['_LANG']['view_order'] . '</a>');
}
}
} else {
$row['handler'] = '<span style="color:red">' . $GLOBALS['_LANG']['os'][$row['order_status']] . '</span>';
}
}
$row['shipping_status'] = $row['shipping_status'] == SS_SHIPPED_ING ? SS_PREPARING : $row['shipping_status'];
$row['order_status1'] = $row['order_status'];
$row['order_status'] = $GLOBALS['_LANG']['os'][$row['order_status']] . ',' . $GLOBALS['_LANG']['ps'][$row['pay_status']] . ',' . $GLOBALS['_LANG']['ss'][$row['shipping_status']];
$cod_code = $GLOBALS['db']->getOne("select pay_code from " . $GLOBALS['ecs']->table('payment') . " where pay_id=" . $row['pay_id']);
$weixiu_time = $GLOBALS['db']->getOne("select value from " . $GLOBALS['ecs']->table('shop_config') . " where code='weixiu_time'");
$row['weixiu_time'] = $weixiu_time - (local_date('d', gmtime()) - local_date('d', $order['shipping_time_end'])) <= 0 ? 0 : 1;
$back_can_a = 1;
$comment_s = 0;
$shaidan_s = 0;
$goods_list_r = get_order_goods($row);
foreach ($goods_list_r as $g_val) {
if ($g_val['back_can'] == 0) {
$back_can_a = 0;
}
if ($g_val['comment_state'] == 0 && $g_val['is_back'] == 0 && $comment_s == 0) {
$comment_s = $g_val['rec_id'];
}
if ($g_val['shaidan_state'] == 0 && $g_val['is_back'] == 0 && $shaidan_s == 0) {
$shaidan_s = $g_val['rec_id'];
}
}
$extension_code = $row['extension_code'];
/* 预售活动 */
if ($extension_code == PRE_SALE_CODE) {
include_once '/includes/lib_goods.php';
$pre_sale = pre_sale_info($row['extension_id']);
$pre_sale_status = $pre_sale['status'];
if ($pre_sale['deposit'] > 0) {
$pre_sale_deposit = $pre_sale['deposit'];
$pre_sale_deposit_format = $pre_sale['formated_deposit'];
}
}
$arr[$row['order_id']] = array('order_id' => $row['order_id'], 'order_sn' => $row['order_sn'], 'shopname' => $row['shopname'], 'order_time' => local_date($GLOBALS['_CFG']['time_format'], $row['add_time']), 'order_status' => str_replace(',', '</br>', $row['order_status']), 'order_status1' => $row['order_status1'], 'order_status_text' => $row['order_status'], 'consignee' => $row['consignee'], 'pay_name' => $row['pay_name'], 'back_can_a' => $back_can_a, 'comment_s' => $comment_s, 'shaidan_s' => $shaidan_s, 'total_fee' => price_format($row['total_fee'], false), 'goods_list' => $goods_list_r, 'pay_online' => $row['pay_online'], 'is_suborder' => $row['parent_order_id'] ? "(子订单)" : "", 'pay_status' => $row['pay_status'], 'handler' => $row['handler'], 'shipping_id' => $row['shipping_id'], 'shipping_name' => $row['shipping_name'], 'shipping_name_2' => strpos($row['shipping_name'], '同城快递') != FALSE ? "同城快递" : $row['shipping_name'], 'shipping_status' => $row['shipping_status'], 'pay_id' => $cod_code == 'cod' ? '' : $row['pay_id'], 'invoice_no' => $row['invoice_no'], 'extension_code' => $row['extension_code'], 'pre_sale_status' => $pre_sale_status, 'pre_sale_deposit' => $pre_sale_deposit, 'pre_sale_deposit_format' => $pre_sale_deposit_format, 'weixiu_time' => $row['weixiu_time']);
}
return $arr;
}
开发者ID:firsteam,项目名称:falcons,代码行数:81,代码来源:lib_transaction_1.php
示例5: intval
$delivery['user_id'] = intval($delivery['user_id']);
$delivery['country'] = intval($delivery['country']);
$delivery['province'] = intval($delivery['province']);
$delivery['city'] = intval($delivery['city']);
$delivery['district'] = intval($delivery['district']);
$delivery['agency_id'] = intval($delivery['agency_id']);
$delivery['insure_fee'] = floatval($delivery['insure_fee']);
$delivery['shipping_fee'] = floatval($delivery['shipping_fee']);
/* 订单是否已全部分单检查 */
if ($order['order_status'] == OS_SPLITED) {
/* 操作失败 */
$links[] = array('text' => $_LANG['order_info'], 'href' => 'order.php?act=info&order_id=' . $order_id);
sys_msg(sprintf($_LANG['order_splited_sms'], $order['order_sn'], $_LANG['os'][OS_SPLITED], $_LANG['ss'][SS_SHIPPED_ING], $GLOBALS['_CFG']['shop_name']), 1, $links);
}
/* 取得订单商品 */
$_goods = get_order_goods(array('order_id' => $order_id, 'order_sn' => $delivery['order_sn']));
$goods_list = $_goods['goods_list'];
/* 检查此单发货数量填写是否正确 合并计算相同商品和货品 */
if (!empty($send_number) && !empty($goods_list)) {
$goods_no_package = array();
foreach ($goods_list as $key => $value) {
/* 去除 此单发货数量 等于 0 的商品 */
if (!isset($value['package_goods_list']) || !is_array($value['package_goods_list'])) {
// 如果是货品则键值为商品ID与货品ID的组合
$_key = empty($value['product_id']) ? $value['goods_id'] : $value['goods_id'] . '_' . $value['product_id'];
// 统计此单商品总发货数 合并计算相同ID商品或货品的发货数
if (empty($goods_no_package[$_key])) {
$goods_no_package[$_key] = $send_number[$value['rec_id']];
} else {
$goods_no_package[$_key] += $send_number[$value['rec_id']];
}
开发者ID:norain2050,项目名称:benhu,代码行数:31,代码来源:order.php
示例6: index
public function index()
{
$city_name = strim($GLOBALS['request']['city_name']);
//城市名称
//检查用户,用户密码
$user = $GLOBALS['user_info'];
$user_id = intval($user['id']);
$root = array();
$root['return'] = 1;
if ($user_id > 0) {
$root['user_login_status'] = 1;
$order_id = intval($GLOBALS['request']['id']);
require_once APP_ROOT_PATH . "system/model/deal_order.php";
$order_table_name = get_user_order_table_name($user_id);
//echo $order_id; exit;
$sql = "select o.*,r1.name as r1_name, r2.name as r2_name, r3.name as r3_name, r4.name as r4_name from " . $order_table_name . " as o " . "left outer join " . DB_PREFIX . "delivery_region as r1 on r1.id = o.region_lv1 " . "left outer join " . DB_PREFIX . "delivery_region as r2 on r2.id = o.region_lv2 " . "left outer join " . DB_PREFIX . "delivery_region as r3 on r3.id = o.region_lv3 " . "left outer join " . DB_PREFIX . "delivery_region as r4 on r4.id = o.region_lv4 " . " where o.is_delete = 0 and o.user_id = {$user_id} and o.id = {$order_id} limit 1";
$order_info = $GLOBALS['db']->getRow($sql);
if ($order_info) {
$root = get_order_goods($order_info);
$root['return'] = 1;
$root['user_login_status'] = 1;
$deliveryAddr = array();
$deliveryAddr['consignee'] = $order_info['consignee'];
//联系人姓名
$deliveryAddr['delivery'] = $order_info['r1_name'] . $order_info['r2_name'] . $order_info['r3_name'] . $order_info['r4_name'];
$deliveryAddr['region_lv1'] = $order_info['region_lv1'];
//国家
$deliveryAddr['region_lv2'] = $order_info['region_lv2'];
//省
$deliveryAddr['region_lv3'] = $order_info['region_lv3'];
//城市
$deliveryAddr['region_lv4'] = $order_info['region_lv4'];
//地区/县
$deliveryAddr['delivery_detail'] = $order_info['address'];
//详细地址
$deliveryAddr['phone'] = $order_info['mobile'];
//手机号码
$deliveryAddr['postcode'] = $order_info['zip'];
//邮编
$root['deliveryAddr'] = $deliveryAddr;
$root['delivery_status_2'] = $order_info['delivery_status'];
$root['content'] = $order_info['memo'];
//订单备注
$root['send_mobile'] = $user['mobile'];
//团购券手机
$root['tax_title'] = $order_info['tax_title'];
//发票抬头
$root['tax_id'] = 0;
//发票内容
$root['deliver_time_id'] = 0;
//配送日期ID 默认没有这个参数,所以填0
$root['delivery_list'] = $GLOBALS['m_config']['delivery_list'];
//$default_payment_id = $GLOBALS['m_config']['select_payment_id'];
if ($GLOBALS['request']['payment_id']) {
$default_payment_id = intval($GLOBALS['request']['payment_id']);
} else {
$default_payment_id = $order_info['payment_id'];
}
//$default_payment_id = $order_info['payment_id'];
$root['payment_id'] = $default_payment_id;
//支付方式
$root['order_parm'] = init_order_parm($GLOBALS['m_config']);
$root['order_parm']['has_ecv'] = 0;
//订单付款不支持代金券
$root['evc_sn'] = '';
//优惠券序号
$root['evc_pwd'] = '';
//优惠券序号
$order_item_table_name = get_user_order_item_table_name($user_id);
$goods_list = $GLOBALS['db']->getAll("select * from " . $order_item_table_name . " where order_id = " . $order_id);
$ids = array();
$cart_ids = array();
$root['dp_able'] = 0;
$root['goods_list'] = $goods_list;
foreach ($goods_list as $cart_goods) {
array_push($ids, $cart_goods['deal_id']);
array_push($cart_ids, $cart_goods['id']);
if (empty($cart_goods['dp_id'])) {
if ($root['pay_status'] == 2 && $root['order_status'] == 1 && ($root['delivery_status_code'] == 2 || $root['delivery_status_code'] == 5)) {
$root['dp_able'] = 1;
$root['dp_deal_id'] = $cart_goods['id'];
}
}
}
$ids_str = implode(",", $ids);
$cart_ids_str = implode(",", $cart_ids);
$is_delivery = intval($GLOBALS['db']->getOne("select is_delivery from " . DB_PREFIX . "deal where is_delivery = 1 and id in (" . $ids_str . ")"));
if ($is_delivery == 0) {
$delivery_id = 0;
$root['order_parm']['has_delivery'] = 0;
} else {
if ($GLOBALS['request']['delivery_id']) {
$delivery_id = intval($GLOBALS['request']['delivery_id']);
} else {
$delivery_id = $order_info['delivery_id'];
//配送方式;
}
//$delivery_id = $order_info['delivery_id'];
$root['order_parm']['has_delivery'] = 1;
}
//.........这里部分代码省略.........
开发者ID:macall,项目名称:jishida,代码行数:101,代码来源:my_order_detail.action.php
示例7: 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
示例8: shipping_info
$invoice_no = $_REQUEST['invoice_no'];
/*获取快递名称*/
$shipping = shipping_info($shipping_id);
$arr = array('return_status' => RF_SWAPPED_OUT, 'out_shipping_name' => $shipping['shipping_name'], 'out_invoice_no' => $invoice_no);
/*换出商品寄出*/
$GLOBALS['db']->autoExecute($GLOBALS['ecs']->table('order_return'), $arr, 'UPDATE', "rec_id = '{$rec_id}'");
return_action($ret_id, RF_SWAPPED_OUT, FF_NOREFUND, RC_APPLY_SUCCESS, $action_note);
} elseif ('complete' == $operation) {
$arr = array('return_status' => RF_COMPLETE);
//换出商品寄出
$GLOBALS['db']->autoExecute($GLOBALS['ecs']->table('order_return'), $arr, 'UPDATE', "rec_id = '{$rec_id}'");
return_action($ret_id, RF_COMPLETE, $back_order['refund_status'], RC_APPLY_SUCCESS, $action_note);
} elseif ('canceled' == $operation) {
/* 标记订单为“取消”,记录取消原因 */
$cancel_note = isset($_REQUEST['cancel_note']) ? trim($_REQUEST['cancel_note']) : '';
$arr = array('return_status' => RF_CANCELED, 'refund_status' => FF_NOREFUND, 'is_check' => RC_APPLY_FALSE, 'to_buyer' => $cancel_note, 'actual_return' => 0);
$GLOBALS['db']->autoExecute($GLOBALS['ecs']->table('order_return'), $arr, 'UPDATE', "rec_id = '{$rec_id}'");
/*更新log*/
return_action($ret_id, RF_CANCELED, FF_NOREFUND, RC_APPLY_FALSE, $action_note);
} elseif ('invalid' == $operation) {
//TODO
} elseif ('refund' == $operation) {
include_once ROOT_PATH . 'includes/lib_transaction.php';
/* 定义当前时间 */
define('GMTIME_UTC', gmtime());
// 获取 UTC 时间戳
$order_goods = get_order_goods($order);
//订单商品
foreach ($order_goods['goods_list'] as $key => $value) {
$array_rec_id[] = $value['rec_id'];
}
开发者ID:jianhuaixie,项目名称:yundds,代码行数:31,代码来源:aftermarket.php
示例9: index
public function index()
{
$email = strim($GLOBALS['request']['email']);
//用户名或邮箱
$pwd = strim($GLOBALS['request']['pwd']);
//密码
//检查用户,用户密码
$user = user_check($email, $pwd);
$user_id = intval($user['id']);
$root = array();
$root['return'] = 1;
if ($user_id > 0) {
$root['user_login_status'] = 1;
$order_id = intval($GLOBALS['request']['id']);
//echo $order_id; exit;
$sql = "select o.*,r1.name as r1_name, r2.name as r2_name, r3.name as r3_name, r4.name as r4_name from " . DB_PREFIX . "deal_order as o " . "left outer join " . DB_PREFIX . "delivery_region as r1 on r1.id = o.region_lv1 " . "left outer join " . DB_PREFIX . "delivery_region as r2 on r2.id = o.region_lv2 " . "left outer join " . DB_PREFIX . "delivery_region as r3 on r3.id = o.region_lv3 " . "left outer join " . DB_PREFIX . "delivery_region as r4 on r4.id = o.region_lv4 " . " where o.is_delete = 0 and o.user_id = {$user_id} and o.id = {$order_id} limit 1";
$order_info = $GLOBALS['db']->getRow($sql);
if ($order_info) {
$root = get_order_goods($order_info);
$root['return'] = 1;
$root['user_login_status'] = 1;
$deliveryAddr = array();
$deliveryAddr['consignee'] = $order_info['consignee'];
//联系人姓名
$deliveryAddr['delivery'] = $order_info['r1_name'] . $order_info['r2_name'] . $order_info['r3_name'] . $order_info['r4_name'];
$deliveryAddr['region_lv1'] = $order_info['region_lv1'];
//国家
$deliveryAddr['region_lv2'] = $order_info['region_lv2'];
//省
$deliveryAddr['region_lv3'] = $order_info['region_lv3'];
//城市
$deliveryAddr['region_lv4'] = $order_info['region_lv4'];
//地区/县
$deliveryAddr['delivery_detail'] = $order_info['address'];
//详细地址
$deliveryAddr['phone'] = $order_info['mobile'];
//手机号码
$deliveryAddr['postcode'] = $order_info['zip'];
//邮编
$root['deliveryAddr'] = $deliveryAddr;
$root['content'] = $order_info['memo'];
//订单备注
$root['send_mobile'] = $user['mobile'];
//团购券手机
$root['tax_title'] = $item['tax_title'];
//发票抬头
$root['tax_id'] = 0;
//发票内容
$root['deliver_time_id'] = 0;
//配送日期ID 默认没有这个参数,所以填0
//$default_payment_id = $GLOBALS['m_config']['select_payment_id'];
$default_payment_id = $order_info['payment_id'];
$root['payment_id'] = $default_payment_id;
//支付方式
$root['order_parm'] = init_order_parm($GLOBALS['m_config']);
$root['order_parm']['has_ecv'] = 0;
//订单付款不支持代金券
$root['evc_sn'] = '';
//优惠券序号
$root['evc_pwd'] = '';
//优惠券序号
$goods_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal_order_item where order_id = " . $order_id);
$ids = array();
$cart_ids = array();
foreach ($goods_list as $cart_goods) {
array_push($ids, $cart_goods['deal_id']);
array_push($cart_ids, $cart_goods['id']);
}
$ids_str = implode(",", $ids);
$cart_ids_str = implode(",", $cart_ids);
$is_delivery = intval($GLOBALS['db']->getOne("select is_delivery from " . DB_PREFIX . "deal where is_delivery = 1 and id in (" . $ids_str . ")"));
if ($is_delivery == 0) {
$delivery_id = 0;
$root['order_parm']['has_delivery'] = 0;
} else {
$delivery_id = $order_info['delivery_id'];
$root['order_parm']['has_delivery'] = 1;
}
$root['delivery_id'] = $delivery_id;
//配送方式
$has_coupon = intval($GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal where is_coupon = 1 and id in (" . $ids_str . ")"));
if (!$has_coupon) {
$root['order_parm']['has_moblie'] = 0;
} else {
$root['order_parm']['has_moblie'] = 1;
}
$root['order_parm']['has_mcod'] = 1;
$forbid_payment = $GLOBALS['db']->getAll("select payment_id from " . DB_PREFIX . "deal_payment where deal_id in (" . $ids_str . ")");
foreach ($forbid_payment as $forbid_payment_item) {
foreach ($root['order_parm']['payment_list'] as $k => $v) {
if ($v['id'] == $forbid_payment_item['payment_id']) {
unset($root['order_parm']['payment_list'][$k]);
}
}
}
$forbid_delivery = $GLOBALS['db']->getAll("select delivery_id from " . DB_PREFIX . "deal_delivery where deal_id in (" . $ids_str . ")");
foreach ($forbid_delivery as $forbid_delivery_item) {
foreach ($root['order_parm']['delivery_list'] as $k => $v) {
if ($v['id'] == $forbid_payment_item['delivery_id']) {
unset($root['order_parm']['delivery_list'][$k]);
//.........这里部分代码省略.........
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:101,代码来源:my_order_detail.action.php
示例10: get_user_orders_2
/**
* 获取用户指定范围的订单列表
*
* @access public
* @param int $user_id 用户ID号
* @param int $num 列表最大数量
* @param int $start 列表起始位置
* @return array $order_list 订单列表
*/
function get_user_orders_2($user_id, $num = 10, $start = 0, $where = '')
{
/* 取得订单列表 */
$arr = array();
$sql = "SELECT o.*, ifnull(ssc.value,'网站自营') as shopname, " . "(goods_amount + shipping_fee + insure_fee + pay_fee + pack_fee + card_fee + tax - discount) AS total_fee " . " FROM " . $GLOBALS['ecs']->table('order_info') . ' as o ' . " LEFT JOIN " . $GLOBALS['ecs']->table('supplier_shop_config') . 'as ssc ' . " ON o.supplier_id=ssc.supplier_id AND ssc.code='shop_name' " . " WHERE user_id = '{$user_id}' {$where} ORDER BY add_time DESC";
$res = $GLOBALS['db']->SelectLimit($sql, $num, $start);
while ($row = $GLOBALS['db']->fetchRow($res)) {
$row['handler'][] = array('name' => '订单详情', 'code' => 'order_detail');
if ($row['order_status'] != OS_CANCELED && $row['order_status'] != OS_INVALID && $row['pay_status'] == PS_UNPAYED && !empty($row['pay_id'])) {
$row['handler'][] = array('name' => '立即付款', 'code' => 'order_detail');
}
if ($row['order_status'] == OS_UNCONFIRMED) {
$row['handler'][] = array('name' => $GLOBALS['_LANG']['cancel'], 'code' => 'cancel_order');
}
/* 对配送状态的处理 */
if ($row['shipping_status'] == SS_SHIPPED) {
$back_num = $GLOBALS['db']->getOne("SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('back_order') . " WHERE order_id = " . $row['order_id'] . " AND status_back < 6 AND status_back != 3");
if ($back_num > 0) {
$back_info = "此单存在正在退货商品,确认收货退货申请将取消。";
} else {
$back_info = "";
}
@($okgoods_time = $GLOBALS['db']->getOne("select value from " . $GLOBALS['ecs']->table('shop_config') . " where code='okgoods_time'"));
@($row_time = $okgoods_time - (local_date('d', gmtime()) - local_date('d', $row['shipping_time'])));
@($row['receive_confirm_deadline'] = $row_time);
$row['handler'][] = array('name' => $GLOBALS['_LANG']['confirm_received'], 'code' => 'affirm_received');
}
$row['shipping_status'] = $row['shipping_status'] == SS_SHIPPED_ING ? SS_PREPARING : $row['shipping_status'];
$row['order_status_text'] = $GLOBALS['_LANG']['os'][$row['order_status']];
$row['pay_status_text'] = $GLOBALS['_LANG']['ps'][$row['pay_status']];
$row['shipping_status_text'] = $GLOBALS['_LANG']['ss'][$row['shipping_status']];
$cod_code = $GLOBALS['db']->getOne("select pay_code from " . $GLOBALS['ecs']->table('payment') . " where pay_id=" . $row['pay_id']);
$row['cod_code'] = $cod_code;
$weixiu_time = $GLOBALS['db']->getOne("select value from " . $GLOBALS['ecs']->table('shop_config') . " where code='weixiu_time'");
$row['weixiu_time'] = $weixiu_time - (local_date('d', gmtime()) - local_date('d', $order['shipping_time_end'])) <= 0 ? 0 : 1;
$back_can_a = 1;
$comment_s = 0;
$shaidan_s = 0;
$goods_list_r = get_order_goods($row);
foreach ($goods_list_r as $g_val) {
if ($g_val['back_can'] == 0) {
$back_can_a = 0;
}
if ($g_val['comment_state'] == 0 && $g_val['is_back'] == 0 && $comment_s == 0) {
$comment_s = $g_val['rec_id'];
}
if ($g_val['shaidan_state'] == 0 && $g_val['is_back'] == 0 && $shaidan_s == 0) {
$shaidan_s = $g_val['rec_id'];
}
}
if ($row['shipping_status'] == SS_RECEIVED) {
if ($comment_s != 0) {
$row['handler'][] = array('name' => '评价', 'code' => 'my_comment');
}
if ($shaidan_s != 0) {
$row['handler'][] = array('name' => '晒单', 'code' => 'shaidan_send');
}
}
$extension_code = $row['extension_code'];
/* 预售活动 */
// if($extension_code == PRE_SALE_CODE)
// {
// include_once '/includes/lib_goods.php';
// $pre_sale = pre_sale_info($row['extension_id']);
// $pre_sale_status = $pre_sale['status'];
// if($pre_sale['deposit'] > 0)
// {
// $pre_sale_deposit = $pre_sale['deposit'];
// $pre_sale_deposit_format = $pre_sale['formated_deposit'];
// }
// }
$arr[$row['order_id']] = array('order_id' => $row['order_id'], 'order_sn' => $row['order_sn'], 'shopname' => $row['shopname'], 'order_time' => local_date($GLOBALS['_CFG']['time_format'], $row['add_time']), 'order_status' => $row['order_status'], 'pay_status' => $row['pay_status'], 'shipping_status' => $row['shipping_status'], 'order_status_text' => $row['order_status_text'], 'pay_status_text' => $row['pay_status_text'], 'shipping_status_text' => $row['shipping_status_text'], 'consignee' => $row['consignee'], 'pay_name' => $row['pay_name'], 'back_can_a' => $back_can_a, 'comment_s' => $comment_s, 'shaidan_s' => $shaidan_s, 'total_fee' => price_format($row['total_fee'], false), 'goods_list' => $goods_list_r, 'pay_online' => $row['pay_online'], 'is_suborder' => $row['parent_order_id'] ? "(子订单)" : "", 'pay_status' => $row['pay_status'], 'handler' => $row['handler'], 'shipping_id' => $row['shipping_id'], 'shipping_name' => $row['shipping_name'], 'shipping_status' => $row['shipping_status'], 'pay_id' => $cod_code == 'cod' ? '' : $row['pay_id'], 'invoice_no' => $row['invoice_no'], 'extension_code' => $row['extension_code'], 'weixiu_time' => $row['weixiu_time']);
}
return $arr;
}
开发者ID:firsteam,项目名称:falcons,代码行数:84,代码来源:lib_transaction_2.php
示例11: get_user_orders
/**
* 获取用户指定范围的订单列表
*
* @access public
* @param int $user_id 用户ID号
* @param int $num 列表最大数量
* @param int $start 列表起始位置
* @return array $order_list 订单列表
*/
function get_user_orders($user_id, $num = 10, $start = 0)
{
/* 取得订单列表 */
$arr = array();
$sql = "SELECT order_id, order_sn, order_status, shipping_status, pay_status, add_time, " . "(goods_amount + shipping_fee + insure_fee + pay_fee + pack_fee + card_fee + tax - discount) AS total_fee " . " FROM " . $GLOBALS['ecs']->table('order_info') . " WHERE user_id = '{$user_id}' ORDER BY add_time DESC";
$res = $GLOBALS['db']->SelectLimit($sql, $num, $start);
while ($row = $GLOBALS['db']->fetchRow($res)) {
if ($row['order_status'] == OS_UNCONFIRMED) {
$row['handler'] = "<a href=\"user.php?act=cancel_order&order_id=" . $row['order_id'] . "\" onclick=\"if (!confirm('" . $GLOBALS['_LANG']['confirm_cancel'] . "')) return false;\">" . $GLOBALS['_LANG']['cancel'] . "</a>";
} else {
if ($row['order_status'] == OS_SPLITED) {
/* 对配送状态的处理 */
if ($row['shipping_status'] == SS_SHIPPED) {
@($row['handler'] = "<a href=\"user.php?act=affirm_received&order_id=" . $row['order_id'] . "\" onclick=\"if (!confirm('" . $GLOBALS['_LANG']['confirm_received'] . "')) return false;\">" . $GLOBALS['_LANG']['received'] . "</a>");
} elseif ($row['shipping_status'] == SS_RECEIVED) {
@($row['handler'] = '<span>' . $GLOBALS['_LANG']['ss_received'] . '</span>');
} else {
if ($row['pay_status'] == PS_UNPAYED) {
@($row['handler'] = "<a href=\"user.php?act=order_detail&order_id=" . $row['order_id'] . '">' . $GLOBALS['_LANG']['pay_money'] . '</a>
|
请发表评论