$this->load->library('user_agent'); $this->load->model('xb_userinfo_model'); $this->load->model('xb_trademark'); //取缓存 $this->load->driver('cache', array('adapter' => 'redis')); if($r=='') { $r = trim($this->input->get_post("xbNum",true)); $c = intval($this->input->get_post("xbClass")); } $r = strtoupper($r); //转大写 $this->urldata["trade_url"] = "/search/tmdetails/".$c."/"; $this->urldata["trade_html"] = $r.".html"; $db['default']['db_debug'] = FALSE; $this->load->database(); $userip = $this->input->ip_address(); //ip地址 //$this->load->model("cntoenmodel"); if($this->urldata["trade_lang"]!="") { $ip_allow = array("allow" => 1,"bz" => ""); //其它语言的默认为白名单 }else{ //白名单判断 $ip_allow = $this->xb_pay_show->check_ip_allow_list($userip); } //写入日志 $userid = $this->loginmodel->getlogineduserid(); if($ip_allow["allow"]==0) //不在白名单 { if($is_logined=$this->loginmodel->islogin())//已登录的传入userid { //检测 注册+类别 +用户ID $is_buy = $this->xb_pay_show->check_pay_tmshow($r,$c,$userid); //取用户的积分 $userpoints = $this->xb_userinfo_model->get_points_by_userid($userid); } //检测一个IP是否已超过1天免费的3次查询 if($is_buy==false && $userid >0) //没有购买检测是否今天到了3次这个IP { //第一步取此用户的搜索记录 $free_search_arr = $this->xb_pay_show->check_pay_free_tmshow($r,$c,$userid); $is_search_num = count($free_search_arr['user_free_search']); } //已购买,免费搜索少于3次 if($is_buy==true||$free_search_arr["is_free"]==true) { $is_lock = false; } }else{ //白名单取消锁 $is_lock = false; $is_logined = false; } //取商标数据 //远程取商标数据 $http_data = @json_decode($this->post_http("http://".$this->config->item('api_ip').":9205/trademark_db/get_xb","xbNum=".$r."&xbClass=".$c)); //$query = $this->db->query("select * from xb_trademark where xbNum=? and xbClass=? limit 1",array($r,$c)); $data = array( "xb" => null, "is_logined" => $is_logined, "is_search_num" =>$is_search_num, //免费搜索次数 "is_buy" => $is_buy, //是否购买 "is_lock" =>$is_lock, "userpoints" =>$userpoints ); if($http_data) { $data["xb"] = $http_data->data; $data["gazette_page"] = $http_data->gazette_page; } if($data["xb"]) { $num = 1; // $data["gazette_page"] = $this->xb_trademark->get_tm_gazette_page($r,$c); }else { $num = 0; } if($is_buy==false) //已购的的无需再写到免费日志里面去了 { if($ip_allow["allow"]==0) //不在白名单 { //有数据更新,并搜索到了数据 if( $userid >0 && $free_search_arr["is_add"]==true && $num==1 ) { //加到缓存里面去 $this->xb_pay_show->add_pay_free_tmshow($r,$c,$userid,$free_search_arr['user_free_search']); } $this->log_model->log_xbshow($userid,$r,$c,$num, $this->agent->referrer()); }else { //在白名单内 $this->log_model->log_xbshow_allow($userid,$r,$c,$num, $this->agent->referrer(),$ip_allow["bz"]); } } //echo ip2long($userip),time(); //exit; //$this->load->view('www/search/xbshow_msg',$data); $this->load_view('www/search/xbshow_msg',$data); } function xbshows($r='') { $this->load->model('loginmodel'); $this->load->model('cntoenmodel'); $this->load->model('commHtml'); $this->load->model('xb_agent'); $this->load->library('user_agent'); $db['default']['db_debug'] = FALSE; $this->load->database(); //$this->load->model("cntoenmodel"); $query = $this->db->query("select * from xb_trademark where xbNum=?",array($r)); $data = array( "xb_list" => $query->result() ); $this->load->view('www/search/xbshows_msg',$data); } function xbshow_json($r='',$c='',$log_filp=0) { //header("Content-type: text/html; charset=gb2312"); $this->load->model('loginmodel'); $this->load->model('cntoenmodel'); $this->load->model('commHtml'); $this->load->model('xb_agent'); $db['default']['db_debug'] = FALSE; $this->load->database(); $this->load->model("cntoenmodel"); $query = $this->db->query("select * from xb_trademark where xbNum=? and xbClass=? limit 1",array($r,$c)); $data = array( "xb" => $query->row() ); echo json_encode($data); } function xbstates($xbNum,$xbClass) { $url = $this->config->item('xb_api_url')."update_tm_states.php?xbNum=$xbNum&xbClass=$xbClass"; echo file_get_contents($url); } function xbtmstates($xbNum='',$xbClass=0,$xbLang='en') { $this->load->model("xb_tmstates_model"); //加载商标状态 $this->xb_tmstates_model->get_states($xbNum,$xbClass,$xbLang); } function xbtmstatestxt($xbNum='',$xbClass=0,$xbLang='en') { $this->load->model("xb_tmstates_model"); //加载商标状态 $this->xb_tmstates_model->get_states_txt($xbNum,$xbClass,$xbLang); } function xbtmstatespage() { $post_data = "xbNum=".$this->input->get_post("xbNum")."&ln=".$this->input->get_post("ln"); $url = 'http://'.$this->config->item('api_ip').':10088/index.php?c=tdsearch&m=tmstatespage'; //url地址 $ch = @curl_init($url); //初始化 @curl_setopt($ch,CURLOPT_HEADER,0);
No database connection settings were found in the database config file.