function xt_yiqifa_is_session_ready() { $app = xt_get_app_yiqifa(); if (empty($app) || empty($app['appKey']) || empty($app['appSecret'])) { return false; } if (empty($app['account']) || !isset($app['sid']) || empty($app['syncSecret'])) { return false; } return $app; }
function _xt_report_yiqifa_page($start, $end, $page = 1, $action_id = '', $order_no = '', $status = '') { $app = xt_get_app_yiqifa(); if (empty($app) || empty($app['account']) || empty($app['sid']) || empty($app['syncSecret'])) { wp_die('尚未配置亿起发账号,网站主ID,密钥!'); } //$url = 'http://o.yiqifa.com/servlet/queryCpsMultiRow?sid=' . urlencode($app['sid']) . '&username='******'account']) . '&privatekey=' . urlencode($app['syncSecret']) . '&st=' . urlencode($start) . '&ed=' . urlencode($end); $url = 'http://o.yiqifa.com/servlet/queryCpsMultiRow?sid=' . $app['sid'] . '&username='******'account']) . '&privatekey=' . urlencode($app['syncSecret']) . '&ed=' . urlencode($end) . '&st=' . urlencode($start) . '&action_id=' . urlencode($action_id) . '&order_no=' . urlencode($order_no) . '&status=' . urlencode($status); $body = file_get_contents($url); if (!empty($body)) { $body = xt_iconv($body, 'GBK', 'UTF-8'); $lines = explode("\n", $body); if (!empty($lines)) { foreach ($lines as $line) { $line = trim($line); if (!empty($line)) { $params = explode("||", $line); if (!empty($params) && count($params) > 17) { $yiqifaId = $params[0]; // 亿起发唯一编号 $actionId = $params[1]; // 联盟活动编号 $sid = $params[2]; // 网营商ID(商城) $wid = $params[3]; // 网站编号 $orderTime = $params[4]; // 下单时间 $orderNo = $params[5]; // 订单编号 $commissionType = $params[6]; //佣金分类 $itemId = $params[7]; //商品编号 $itemNums = $params[8]; //订单商品件数 $itemPrice = $params[9]; //订单商品价格 $outerCode = $params[10]; //反馈标签(返利标识) $orderStatus = $params[11]; //订单状态 $commission = $params[12]; //网站主佣金 $cid = $params[13]; //商品分类 //14 未知 $itemTitle = $params[15]; //商品标题 $actionName = $params[16]; //商城活动标题 //17 ?时间 //18无 //19无 //20 ?价格 //21无 //22无 global $xt_report_total; $xt_report_total++; global $wpdb; $count = $wpdb->get_var("SELECT COUNT(*) FROM " . XT_TABLE_YIQIFA_REPORT . " WHERE yiqifaId={$yiqifaId}"); $_user_id = ''; $_user_name = ''; $users = xt_report_fanxian_member('yiqifa', $outerCode); $buyer = $users['buyer']; $sharer = $users['sharer']; $adser = $users['adser']; if ($buyer->exists()) { $_user_id = $buyer->ID; $_user_name = $buyer->user_login; } if ($count == 0) { $wpdb->insert(XT_TABLE_YIQIFA_REPORT, array('yiqifaId' => $yiqifaId, 'actionId' => $actionId, 'actionName' => $actionName, 'cid' => $cid, 'cname' => $cid, 'commission' => $commission, 'commissionType' => $commissionType, 'itemId' => $itemId, 'itemNums' => $itemNums, 'itemPrice' => $itemPrice, 'itemTitle' => $itemTitle, 'orderNo' => $orderNo, 'orderStatus' => $orderStatus, 'orderTime' => $orderTime, 'outerCode' => $outerCode, 'sid' => $sid, 'wid' => $wid, 'user_id' => $_user_id, 'user_name' => $_user_name)); global $xt_report_insert; $xt_report_insert++; } else { $wpdb->update(XT_TABLE_YIQIFA_REPORT, array('actionId' => $actionId, 'actionName' => $actionName, 'cid' => $cid, 'cname' => $cid, 'commission' => $commission, 'commissionType' => $commissionType, 'itemId' => $itemId, 'itemNums' => $itemNums, 'itemPrice' => $itemPrice, 'itemTitle' => $itemTitle, 'orderNo' => $orderNo, 'orderStatus' => $orderStatus, 'orderTime' => $orderTime, 'outerCode' => $outerCode, 'sid' => $sid, 'wid' => $wid), array('yiqifaId' => $yiqifaId)); } if ($orderStatus == 'A' && xt_is_fanxian()) { //订单状态已确认 xt_report_fanxian_save('yiqifa', $buyer, $sharer, $adser, $yiqifaId, $commission, $orderTime); } } } } } } }
s = parseInt(maxtime % 60); msg = d + "天" + h + "小时" + m + "分" + s + "秒"; fn(msg); --maxtime; } else { clearInterval(timer); fn("已失效!"); } }, 1000); } </script> <?php $app_xt = xt_get_app_xt(); $app_taobao = xt_get_app_taobao(); $app_paipai = xt_get_app_paipai(); $app_yiqifa = xt_get_app_yiqifa(); $app_weibo = xt_get_app_weibo(); $app_qq = xt_get_app_qq(); $_loginurl = $_loginurl = xt_platform_authorize_url('[PLATFORM]', 'authoritySuccess', 'admin'); ?> <div id="dashboard-widgets-wrap"> <?php if (IS_CLOUD) { if (strpos(home_url(), 'sinaapp.com') !== false) { ?> <div class="updated" style="color:red;font-weight: bold;font-size:15px;padding:10px 5px;"> 建议绑定自己的独立域名后,再到以下平台用独立域名申请APP,<a href="http://plugin.xintaonet.com/help/?id=126#X_Help-4" target="_blank">新浪SAE域名绑定</a> </div> <?php } elseif (strpos(home_url(), 'duapp.com') !== false) {