本文整理汇总了PHP中deleteRepeat函数的典型用法代码示例。如果您正苦于以下问题:PHP deleteRepeat函数的具体用法?PHP deleteRepeat怎么用?PHP deleteRepeat使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了deleteRepeat函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_order_detail
//.........这里部分代码省略.........
}
/* 对发货号处理 */
if (!empty($order['invoice_no'])) {
$shipping_code = $GLOBALS['db']->GetOne("SELECT shipping_code FROM " . $GLOBALS['ecs']->table('shipping') . " WHERE shipping_id = '{$order['shipping_id']}'");
$plugin = ROOT_PATH . 'includes/modules/shipping/' . $shipping_code . '.php';
if (file_exists($plugin)) {
include_once $plugin;
$shipping = new $shipping_code();
$order['invoice_no'] = $shipping->query($order['invoice_no']);
}
}
/* 只有未确认才允许用户修改订单地址 */
if ($order['order_status'] == OS_UNCONFIRMED) {
$order['allow_update_address'] = 1;
//允许修改收货地址
} else {
$order['allow_update_address'] = 0;
}
/* 获取订单中实体商品数量 */
$order['exist_real_goods'] = exist_real_goods($order_id);
/* 如果是未付款状态,生成支付按钮 */
if ($order['pay_status'] == PS_UNPAYED && ($order['order_status'] == OS_UNCONFIRMED || $order['order_status'] == OS_CONFIRMED)) {
/*
* 在线支付按钮
*/
//支付方式信息
$payment_info = array();
$payment_info = payment_info($order['pay_id']);
//无效支付方式
if ($payment_info === false) {
$order['pay_online'] = '';
} else {
//取得支付信息,生成支付代码
$payment = unserialize_config($payment_info['pay_config']);
//获取需要支付的log_id
$order['log_id'] = get_paylog_id($order['order_id'], $pay_type = PAY_ORDER);
$order['user_name'] = $_SESSION['user_name'];
$order['pay_desc'] = $payment_info['pay_desc'];
/* 调用相应的支付方式文件 */
include_once ROOT_PATH . 'includes/modules/payment/' . $payment_info['pay_code'] . '.php';
/* 取得在线支付方式的支付按钮 */
$pay_obj = new $payment_info['pay_code']();
$order['pay_online'] = $pay_obj->get_code($order, $payment);
}
} else {
$order['pay_online'] = '';
}
/* 无配送时的处理 */
$order['shipping_id'] == -1 and $order['shipping_name'] = L('shipping_not_need');
/* 其他信息初始化 */
$order['how_oos_name'] = $order['how_oos'];
$order['how_surplus_name'] = $order['how_surplus'];
/* 虚拟商品付款后处理 */
if ($order['pay_status'] != PS_UNPAYED) {
/* 取得已发货的虚拟商品信息 */
$virtual_goods = get_virtual_goods($order_id, true);
$virtual_card = array();
foreach ($virtual_goods as $code => $goods_list) {
/* 只处理虚拟卡 */
if ($code == 'virtual_card') {
foreach ($goods_list as $goods) {
if ($info = virtual_card_result($order['order_sn'], $goods)) {
$virtual_card[] = array('goods_id' => $goods['goods_id'], 'goods_name' => $goods['goods_name'], 'info' => $info);
}
}
}
/* 处理超值礼包里面的虚拟卡 */
if ($code == 'package_buy') {
foreach ($goods_list as $goods) {
$sql = 'SELECT g.goods_id FROM ' . $GLOBALS['ecs']->table('package_goods') . ' AS pg, ' . $GLOBALS['ecs']->table('goods') . ' AS g ' . "WHERE pg.goods_id = g.goods_id AND pg.package_id = '" . $goods['goods_id'] . "' AND extension_code = 'virtual_card'";
$vcard_arr = $GLOBALS['db']->getAll($sql);
foreach ($vcard_arr as $val) {
if ($info = virtual_card_result($order['order_sn'], $val)) {
$virtual_card[] = array('goods_id' => $goods['goods_id'], 'goods_name' => $goods['goods_name'], 'info' => $info);
}
}
}
}
}
$var_card = deleteRepeat($virtual_card);
$GLOBALS['smarty']->assign('virtual_card', $var_card);
}
/* 确认时间 支付时间 发货时间 */
if ($order['confirm_time'] > 0 && ($order['order_status'] == OS_CONFIRMED || $order['order_status'] == OS_SPLITED || $order['order_status'] == OS_SPLITING_PART)) {
$order['confirm_time'] = sprintf(L('confirm_time'), local_date(C('time_format'), $order['confirm_time']));
} else {
$order['confirm_time'] = '';
}
if ($order['pay_time'] > 0 && $order['pay_status'] != PS_UNPAYED) {
$order['pay_time'] = sprintf(L('pay_time'), local_date(C('time_format'), $order['pay_time']));
} else {
$order['pay_time'] = '';
}
if ($order['shipping_time'] > 0 && in_array($order['shipping_status'], array(SS_SHIPPED, SS_RECEIVED))) {
$order['shipping_time'] = sprintf(L('shipping_time'), local_date(C('time_format'), $order['shipping_time']));
} else {
$order['shipping_time'] = '';
}
return $order;
}
示例2: get_order_detail
//.........这里部分代码省略.........
if (!empty($order['invoice_no'])) {
$sql = "SELECT shipping_code FROM " . $this->pre . "shipping WHERE shipping_id = '{$order['shipping_id']}'";
$res = $this->row($sql);
$shipping_code = $res['shipping_code'];
$plugin = ROOT_PATH . 'includes/modules/shipping/' . $shipping_code . '.php';
if (file_exists($plugin)) {
include_once $plugin;
$shipping = new $shipping_code();
$order['invoice_no'] = $shipping->query($order['invoice_no']);
}
}
/* 只有未确认才允许用户修改订单地址 */
if ($order['order_status'] == OS_UNCONFIRMED) {
$order['allow_update_address'] = 1;
//允许修改收货地址
} else {
$order['allow_update_address'] = 0;
}
/* 获取订单中实体商品数量 */
$order['exist_real_goods'] = model('Order')->exist_real_goods($order_id);
/* 如果是未付款状态,生成支付按钮 */
if ($order['pay_status'] == PS_UNPAYED && ($order['order_status'] == OS_UNCONFIRMED || $order['order_status'] == OS_CONFIRMED)) {
/*
* 在线支付按钮
*/
//支付方式信息
$payment_info = array();
$payment_info = Model('Order')->payment_info($order['pay_id']);
//无效支付方式
if ($payment_info === false) {
$order['pay_online'] = '';
} else {
//取得支付信息,生成支付代码
$payment = unserialize_config($payment_info['pay_config']);
//获取需要支付的log_id
$order['log_id'] = model('ClipsBase')->get_paylog_id($order['order_id'], $pay_type = PAY_ORDER);
$order['user_name'] = $_SESSION['user_name'];
$order['pay_desc'] = $payment_info['pay_desc'];
/* 调用相应的支付方式文件 */
include_once ROOT_PATH . 'plugins/payment/' . $payment_info['pay_code'] . '.php';
/* 取得在线支付方式的支付按钮 */
$pay_obj = new $payment_info['pay_code']();
$order['pay_online'] = $pay_obj->get_code($order, $payment);
}
} else {
$order['pay_online'] = '';
}
/* 无配送时的处理 */
$order['shipping_id'] == -1 and $order['shipping_name'] = L('shipping_not_need');
/* 其他信息初始化 */
$order['how_oos_name'] = $order['how_oos'];
$order['how_surplus_name'] = $order['how_surplus'];
/* 虚拟商品付款后处理 */
if ($order['pay_status'] != PS_UNPAYED) {
/* 取得已发货的虚拟商品信息 */
$virtual_goods = model('OrderBase')->get_virtual_goods($order_id, true);
$virtual_card = array();
foreach ($virtual_goods as $code => $goods_list) {
/* 只处理虚拟卡 */
if ($code == 'virtual_card') {
foreach ($goods_list as $goods) {
if ($info = model('OrderBase')->virtual_card_result($order['order_sn'], $goods)) {
$virtual_card[] = array('goods_id' => $goods['goods_id'], 'goods_name' => $goods['goods_name'], 'info' => $info);
}
}
}
/* 处理超值礼包里面的虚拟卡 */
if ($code == 'package_buy') {
foreach ($goods_list as $goods) {
$sql = 'SELECT g.goods_id FROM ' . $this->pre . 'package_goods AS pg, ' . $this->pre . 'goods AS g ' . "WHERE pg.goods_id = g.goods_id AND pg.package_id = '" . $goods['goods_id'] . "' AND extension_code = 'virtual_card'";
$vcard_arr = $this->query($sql);
foreach ($vcard_arr as $val) {
if ($info = model('OrderBase')->virtual_card_result($order['order_sn'], $val)) {
$virtual_card[] = array('goods_id' => $goods['goods_id'], 'goods_name' => $goods['goods_name'], 'info' => $info);
}
}
}
}
}
$var_card = deleteRepeat($virtual_card);
ECTouch::view()->assign('virtual_card', $var_card);
}
/* 确认时间 支付时间 发货时间 */
if ($order['confirm_time'] > 0 && ($order['order_status'] == OS_CONFIRMED || $order['order_status'] == OS_SPLITED || $order['order_status'] == OS_SPLITING_PART)) {
$order['confirm_time'] = sprintf(L('confirm_time'), local_date(C('time_format'), $order['confirm_time']));
} else {
$order['confirm_time'] = '';
}
if ($order['pay_time'] > 0 && $order['pay_status'] != PS_UNPAYED) {
$order['pay_time'] = sprintf(L('pay_time'), local_date(C('time_format'), $order['pay_time']));
} else {
$order['pay_time'] = '';
}
if ($order['shipping_time'] > 0 && in_array($order['shipping_status'], array(SS_SHIPPED, SS_RECEIVED))) {
$order['shipping_time'] = sprintf(L('shipping_time'), local_date(C('time_format'), $order['shipping_time']));
} else {
$order['shipping_time'] = '';
}
return $order;
}