function xt_yiqifa_api_ad_list($params = array())
{
    $app = xt_yiqifa_is_ready();
    if (!$app) {
        return new WP_Error('系统错误', '尚未配置亿起发开放平台!');
    }
    $fields = isset($params['fields']) ? $params['fields'] : '';
    if (empty($fields)) {
        $fields = 'ad_id,ad_name,ad_catid,ad_cname,logo_url,ad_o_url,adver_name,adver_id,charge_type,audit_mode,ad_type,begin_date,end_date,create_time,modified_time,commission,introduction,confirm_time,total';
    }
    $charge_type = 'cps';
    $ad_catid = isset($params['ad_catid']) ? $params['ad_catid'] : '';
    $audit_mode = urlencode(iconv('UTF-8', 'GBK', isset($params['audit_mode']) ? $params['audit_mode'] : '无需审核,自动审核,人工审核'));
    $ad_type = isset($params['ad_type']) ? $params['ad_type'] : 'web';
    $url = XT_YIQIFA_URL . "/open.yiqifa.ad.list.get.json";
    $query_args = array('fields' => $fields, 'charge_type' => $charge_type, 'ad_catid' => $ad_catid, 'audit_mode' => $audit_mode, 'ad_type' => $ad_type);
    $response = trim(YiqifaUtils::sendRequest(add_query_arg($query_args, $url), $app['appKey'], $app['appSecret']));
    return xt_yiqifa_api_result($response);
}
Exemple #2
0
 public function curl($url, $consumerKey, $consumerSecret)
 {
     $result = YiqifaUtils::sendRequest($url, $consumerKey, $consumerSecret);
     return $result;
 }