本文整理汇总了PHP中merge_order函数的典型用法代码示例。如果您正苦于以下问题:PHP merge_order函数的具体用法?PHP merge_order怎么用?PHP merge_order使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了merge_order函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: merge_user_order
/**
* 合并指定用户订单
*
* @access public
* @param string $from_order 合并的从订单号
* @param string $to_order 合并的主订单号
*
* @return boolen $bool
*/
function merge_user_order($from_order, $to_order, $user_id = 0)
{
if ($user_id > 0) {
/* 检查订单是否属于指定用户 */
if (strlen($to_order) > 0) {
$sql = "SELECT user_id FROM " . $GLOBALS['ecs']->table('order_info') . " WHERE order_sn = '{$to_order}'";
$order_user = $GLOBALS['db']->getOne($sql);
if ($order_user != $user_id) {
$GLOBALS['err']->add(L('no_priv'));
}
} else {
$GLOBALS['err']->add(L('order_sn_empty'));
return false;
}
}
$result = merge_order($from_order, $to_order);
if ($result === true) {
return true;
} else {
$GLOBALS['err']->add($result);
return false;
}
}
示例2: array
$goods['attr_list'] = array();
$res = $db->query($sql);
while ($row = $db->fetchRow($res)) {
$goods['attr_list'][$row['attr_id']][] = $row;
}
$goods['attr_list'] = array_values($goods['attr_list']);
echo $json->encode($goods);
}
} elseif ($_REQUEST['act'] == 'ajax_merge_order') {
/* 检查权限 */
admin_priv('order_os_edit');
include_once ROOT_PATH . 'includes/cls_json.php';
$json = new JSON();
$from_order_sn = empty($_POST['from_order_sn']) ? '' : json_str_iconv(substr($_POST['from_order_sn'], 1));
$to_order_sn = empty($_POST['to_order_sn']) ? '' : json_str_iconv(substr($_POST['to_order_sn'], 1));
$m_result = merge_order($from_order_sn, $to_order_sn);
$result = array('error' => 0, 'content' => '');
if ($m_result === true) {
$result['message'] = $GLOBALS['_LANG']['act_ok'];
} else {
$result['error'] = 1;
$result['message'] = $m_result;
}
die($json->encode($result));
} elseif ($_REQUEST['act'] == 'remove_order') {
/* 检查权限 */
admin_priv('order_edit');
$order_id = intval($_REQUEST['id']);
/* 检查权限 */
check_authz_json('order_edit');
/* 检查订单是否允许删除操作 */