public function check_pay() { parent::_authUser(array(1, 2, 9)); $id = $this->_postid('order_id', 0); if (!$id) { $this->JsonReturn('参数丢失'); } $rs = M('ste_order')->where(array('order_id' => $id))->find(); if (!$rs) { $this->JsonReturn('订单不存在'); } if (parent::_checkIsPresident()) { //社长 if ($rs['service_id'] != steadmin::$adminInfo['service_id']) { $this->JsonReturn('没有操作权限!'); } } elseif (!parent::_checkIsAdmin()) { $this->JsonReturn('没有操作权限'); } if (!in_array($rs['status'], array(0, 2, 12))) { //不是未支付或者过期订单,直接退出 $this->JsonReturn('该订单状态无需处理'); } //查询订单的支付情况(pay_model:固定为1,小管家) $payInfo = M('pay')->where(array('out_trade_no' => $rs['order_sn'], 'pay_model' => 1))->find(); if (!$payInfo) { $this->JsonReturn('支付信息不存在'); } //如果确认支付已完成,则按异步通知方式处理订单信息 if ($payInfo['notify_time'] && $payInfo['pay_time']) { if ($rs['status'] == 2) { //如果是用户已取消订单,则只修改订单信息并且提交退款申请 if (!D('steOrderRefund')->field('order_id')->where(array('order_id' => $rs['order_id']))->find()) { //先取订单商品数据 $goods = M('ste_order_goods')->where(array('order_id' => $id))->findAll(false); //处理库存和店铺销量 $goodsList = array(); foreach ($goods as $val) { $goodsList[] = array('gid' => $val['gid'], 'goods_sn' => $val['goods_sn'], 'goods_name' => $val['goods_name'], 'goods_spec' => $val['goods_spec'], 'goods_counts' => $val['goods_counts'], 'goods_price' => $val['goods_price'], 'credits' => $val['credits']); } $refund = array('order_id' => $rs['order_id'], 'buyer_id' => $rs['uid'], 'refund_info' => json_encode($goodsList), 'refund_shipping' => $rs['shipping_fee'], 'refund_note' => '', 'refund_time' => TIME, 'refund_amount' => $payInfo['total_fee']); D('steOrderRefund')->addOrderRefund($refund); M('ste_order')->update(array('pay_amount' => $payInfo['total_fee'], 'pay_type' => $this->payType[$payInfo['pay_type']], 'pay_id' => $payInfo['id'], 'pay_time' => $payInfo['pay_time']), array('order_id' => $rs['order_id'])); } } else { $status = getHttp(U($payInfo['router'], array('out_sn' => $rs['order_sn']))); if ($status != 'success') { $this->JsonReturn('路由通知失败,请检查!'); } } //===记录操作日志==== parent::saveSySLog(4, array('order_id' => $id, 'act' => '检查异常支付'), $id, array(), '订单管理-检查支付'); //===记录操作日志==== $this->JsonReturn('ok', array('pay_amount' => $payInfo['total_fee'], 'pay_type' => $payInfo['pay_type'], 'pay_id' => $payInfo['id'], 'pay_time' => outTime($payInfo['pay_time'])), 1); } else { $this->JsonReturn('未检查到支付信息'); } }
function changeGpsToMap($x, $y) { $rs = json_decode(getHttp('http://apis.map.qq.com/ws/coord/v1/translate?locations=' . $y . ',' . $x . '&type=1&key=1aa6a77c877c9d026f2f7640bb722f41'), true); if ($rs['status'] == 0 && isset($rs['locations']) && is_array($rs['locations'])) { return $rs['locations'][0]; } else { return false; } }
{ if (get_magic_quotes_gpc() && $value) { return stripslashes($value); } else { return $value; } } $pReload = false; if ($_REQUEST['mode'] == 'purge') { $objType = new Type(); $objType->delete("type=" . TznDb::zValueToSql(getHttp($_REQUEST['type'])) . " AND " . "((finishDate < '" . strftime(TZN_DATE_SQL, PRJ_DTE_NOW) . "' " . " AND status = " . AAT_STATUS_LEVELS . ") OR (status = " . AAT_STATUS_LEVELS . "))"); $pReload = true; } else { if ($_REQUEST['mode'] == 'delete') { $objType = new Type(); $objType->delete("type=" . TznDb::zValueToSql(getHttp($_REQUEST['type']))); $pReload = true; } else { if ($_REQUEST['mode'] == 'purgeAll') { $objType = new Type(); $objType->delete("(finishDate < " . "'" . strftime(TZN_DATE_SQL, PRJ_DTE_NOW) . "'" . " AND status = " . AAT_STATUS_LEVELS . ") OR (status = " . AAT_STATUS_LEVELS . ")"); $pReload = true; } else { if ($_REQUEST['mode'] == 'deleteAll') { $objType = new Type(); $objType->emptyTable(); $pReload = true; } } } }
function address() { $x = $this->_get('x'); $y = $this->_get('y'); if (!$x || !$y) { $this->JsonReturn('参数不正确'); } $rs = json_decode(getHttp('http://apis.map.qq.com/ws/geocoder/v1/?location=' . $y . ',' . $x . '&key=' . $this->key), true); if (isset($rs['status']) && $rs['status'] == 0) { // z($rs['result']); if (isHave($rs['result']['address_component']['street_number'])) { $path = $rs['result']['address_component']['city'] . $rs['result']['address_component']['district'] . $rs['result']['address_component']['street_number']; } else { $path = $rs['result']['address_component']['city'] . $rs['result']['address_component']['district'] . $rs['result']['address_component']['street']; } return $this->JsonReturn('ok', array('location' => $rs['result']['location'], 'address' => $rs['result']['address'], 'component' => $rs['result']['address_component'], 'path' => $path), 1); } else { return $this->JsonReturn('error'); } }
<?php header("Content-Type:text/xml"); header('Content-Type: text/xml; charset=utf-8'); header('Cache-Control', 'no-cache'); function getHttp($url) { $http_handle = fopen($url, 'r'); $http_content = ""; while (!feof($http_handle)) { $temp_buffer = fgets($http_handle, 1024); $http_content .= $temp_buffer; } fclose($http_handle); return $http_content; } $url = "http://del.icio.us/rss/"; $user = $_GET["user_name"]; if ($user == "") { echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?> \n<rdf/>"; return; } $user = htmlspecialchars($user, ENT_QUOTES); $url .= $user; $feed = getHttp($url); echo $feed;