本文整理匯總了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');
/* 檢查訂單是否允許刪除操作 */