本文整理汇总了PHP中virtual_card_shipping函数的典型用法代码示例。如果您正苦于以下问题:PHP virtual_card_shipping函数的具体用法?PHP virtual_card_shipping怎么用?PHP virtual_card_shipping使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了virtual_card_shipping函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: array
/* 操作失败 */
$links[] = array('text' => $_LANG['order_info'], 'href' => 'order.php?act=delivery_info&delivery_id=' . $delivery_id);
sys_msg(sprintf($_LANG['act_good_vacancy'], $value['goods_name']), 1, $links);
break;
}
/* 虚拟商品列表 virtual_card*/
if ($value['is_real'] == 0) {
$virtual_goods[] = array('goods_id' => $value['goods_id'], 'goods_name' => $value['goods_name'], 'num' => $value['send_number']);
}
}
}
/* 发货 */
/* 处理虚拟卡 商品(虚货) */
if (is_array($virtual_goods) && count($virtual_goods) > 0) {
foreach ($virtual_goods as $virtual_value) {
virtual_card_shipping($virtual_value, $order['order_sn'], $msg, 'split');
}
}
/* 如果使用库存,且发货时减库存,则修改库存 */
if ($_CFG['use_storage'] == '1' && $_CFG['stock_dec_time'] == SDT_SHIP) {
foreach ($delivery_stock_result as $value) {
/* 商品(实货)、超级礼包(实货) */
if ($value['is_real'] != 0) {
//(货品)
if (!empty($value['product_id'])) {
$minus_stock_sql = "UPDATE " . $GLOBALS['ecs']->table('products') . "\n SET product_number = product_number - " . $value['sums'] . "\n WHERE product_id = " . $value['product_id'];
$GLOBALS['db']->query($minus_stock_sql, 'SILENT');
}
$minus_stock_sql = "UPDATE " . $GLOBALS['ecs']->table('goods') . "\n SET goods_number = goods_number - " . $value['sums'] . "\n WHERE goods_id = " . $value['goods_id'];
$GLOBALS['db']->query($minus_stock_sql, 'SILENT');
}
开发者ID:norain2050,项目名称:benhu,代码行数:31,代码来源:order.php
示例2: virtual_goods_ship
/**
* 虚拟商品发货
*
* @access public
* @param array $virtual_goods 虚拟商品数组
* @param string $msg 错误信息
* @param string $order_sn 订单号。
* @param string $process 设定当前流程:split,发货分单流程;other,其他,默认。
*
* @return bool
*/
function virtual_goods_ship(&$virtual_goods, &$msg, $order_sn, $return_result = false, $process = 'other')
{
$virtual_card = array();
foreach ($virtual_goods as $code => $goods_list) {
/* 只处理虚拟卡 */
if ($code == 'virtual_card') {
foreach ($goods_list as $goods) {
if (virtual_card_shipping($goods, $order_sn, $msg, $process)) {
if ($return_result) {
$virtual_card[] = array('goods_id' => $goods['goods_id'], 'goods_name' => $goods['goods_name'], 'info' => virtual_card_result($order_sn, $goods));
}
} else {
return false;
}
}
$GLOBALS['smarty']->assign('virtual_card', $virtual_card);
}
}
return true;
}
开发者ID:YangZeSummer,项目名称:NanJingSecond-Hand,代码行数:31,代码来源:lib_common.php
示例3: delivery
function delivery($order_id, $deliery_id, $express_no)
{
/* 定义当前时间 */
define('GMTIME_UTC', gmtime());
// 获取 UTC 时间戳
/* 取得参数 */
$delivery = array();
$delivery['invoice_no'] = $express_no;
$action_note = isset($_REQUEST['action_note']) ? trim($_REQUEST['action_note']) : '';
/* 根据发货单id查询发货单信息 */
if (!empty($delivery_id)) {
$delivery_order = delivery_order_info($delivery_id);
} else {
die('order does not exist');
}
/* 查询订单信息 */
$order = order_info($order_id);
/* 检查此单发货商品库存缺货情况 */
$virtual_goods = array();
$delivery_stock_sql = "SELECT DG.goods_id, DG.is_real, DG.product_id, SUM(DG.send_number) AS sums, IF(DG.product_id > 0, P.product_number, G.goods_number) AS storage, G.goods_name, DG.send_number\r\n FROM " . $GLOBALS['ecs']->table('delivery_goods') . " AS DG, " . $GLOBALS['ecs']->table('goods') . " AS G, " . $GLOBALS['ecs']->table('products') . " AS P\r\n WHERE DG.goods_id = G.goods_id\r\n AND DG.delivery_id = '{$delivery_id}'\r\n AND DG.product_id = P.product_id\r\n GROUP BY DG.product_id ";
$delivery_stock_result = $GLOBALS['db']->getAll($delivery_stock_sql);
/* 如果商品存在规格就查询规格,如果不存在规格按商品库存查询 */
if (!empty($delivery_stock_result)) {
foreach ($delivery_stock_result as $value) {
if (($value['sums'] > $value['storage'] || $value['storage'] <= 0) && ($_CFG['use_storage'] == '1' && $_CFG['stock_dec_time'] == SDT_SHIP || $_CFG['use_storage'] == '0' && $value['is_real'] == 0)) {
/* 操作失败 */
$links[] = array('text' => $GLOBALS['_LANG']['order_info'], 'href' => 'order.php?act=delivery_info&delivery_id=' . $delivery_id);
sys_msg(sprintf($GLOBALS['_LANG']['act_good_vacancy'], $value['goods_name']), 1, $links);
break;
}
/* 虚拟商品列表 virtual_card*/
if ($value['is_real'] == 0) {
$virtual_goods[] = array('goods_id' => $value['goods_id'], 'goods_name' => $value['goods_name'], 'num' => $value['send_number']);
}
}
} else {
$delivery_stock_sql = "SELECT DG.goods_id, DG.is_real, SUM(DG.send_number) AS sums, G.goods_number, G.goods_name, DG.send_number\r\n FROM " . $GLOBALS['ecs']->table('delivery_goods') . " AS DG, " . $GLOBALS['ecs']->table('goods') . " AS G\r\n WHERE DG.goods_id = G.goods_id\r\n AND DG.delivery_id = '{$delivery_id}'\r\n GROUP BY DG.goods_id ";
$delivery_stock_result = $GLOBALS['db']->getAll($delivery_stock_sql);
foreach ($delivery_stock_result as $value) {
if (($value['sums'] > $value['goods_number'] || $value['goods_number'] <= 0) && ($_CFG['use_storage'] == '1' && $_CFG['stock_dec_time'] == SDT_SHIP || $_CFG['use_storage'] == '0' && $value['is_real'] == 0)) {
/* 操作失败 */
$links[] = array('text' => $GLOBALS['_LANG']['order_info'], 'href' => 'order.php?act=delivery_info&delivery_id=' . $delivery_id);
sys_msg(sprintf($GLOBALS['_LANG']['act_good_vacancy'], $value['goods_name']), 1, $links);
break;
}
/* 虚拟商品列表 virtual_card*/
if ($value['is_real'] == 0) {
$virtual_goods[] = array('goods_id' => $value['goods_id'], 'goods_name' => $value['goods_name'], 'num' => $value['send_number']);
}
}
}
/* 发货 */
/* 处理虚拟卡 商品(虚货) */
if (is_array($virtual_goods) && count($virtual_goods) > 0) {
foreach ($virtual_goods as $virtual_value) {
virtual_card_shipping($virtual_value, $order['order_sn'], $msg, 'split');
}
}
/* 如果使用库存,且发货时减库存,则修改库存 */
if ($_CFG['use_storage'] == '1' && $_CFG['stock_dec_time'] == SDT_SHIP) {
foreach ($delivery_stock_result as $value) {
/* 商品(实货)、超级礼包(实货) */
if ($value['is_real'] != 0) {
//(货品)
if (!empty($value['product_id'])) {
$minus_stock_sql = "UPDATE " . $GLOBALS['ecs']->table('products') . "\r\n SET product_number = product_number - " . $value['sums'] . "\r\n WHERE product_id = " . $value['product_id'];
$GLOBALS['db']->query($minus_stock_sql, 'SILENT');
}
$minus_stock_sql = "UPDATE " . $GLOBALS['ecs']->table('goods') . "\r\n SET goods_number = goods_number - " . $value['sums'] . "\r\n WHERE goods_id = " . $value['goods_id'];
$GLOBALS['db']->query($minus_stock_sql, 'SILENT');
}
}
}
/* 修改发货单信息 */
$invoice_no = str_replace(',', '<br>', $delivery['invoice_no']);
$invoice_no = trim($invoice_no, '<br>');
$_delivery['invoice_no'] = $invoice_no;
$_delivery['status'] = 0;
// 0,为已发货
$query = $db->autoExecute($ecs->table('delivery_order'), $_delivery, 'UPDATE', "delivery_id = {$delivery_id}", 'SILENT');
if (!$query) {
/* 操作失败 */
$links[] = array('text' => $GLOBALS['_LANG']['delivery_sn'] . $GLOBALS['_LANG']['detail'], 'href' => 'order.php?act=delivery_info&delivery_id=' . $delivery_id);
sys_msg($GLOBALS['_LANG']['act_false'], 1, $links);
}
/* 标记订单为已确认 “已发货” */
/* 更新发货时间 */
$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'] = trim($order['invoice_no'] . '<br>' . $invoice_no, '<br>');
update_order($order_id, $arr);
/* 发货单发货记录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) {
//.........这里部分代码省略.........
开发者ID:seanguo166,项目名称:yinoos,代码行数:101,代码来源:order.php
注:本文中的virtual_card_shipping函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论