zoukankan      html  css  js  c++  java
  • 记录搜索关键字到数据库

    //记录搜索关键字到数据库
    public function AddSearchKey($SearchKey,$userinfo=''){
    $cip=getip();
    if($userinfo!=''){
    $cus_id=$userinfo['cus_id'];
    }else{
    $cus_id=0;
    }
    //搜索关键字转拼音,以及拼音首字母
    $Pinyin = new APPExtendChinesePinyin();
    $pinyinall=$Pinyin->TransformWithoutTone($SearchKey);
    $pinyinfirst=$Pinyin->TransformUcwords($SearchKey);
    $Model=M('search_key');
    $SearchList=$Model->where("key_word='" .$SearchKey. "'")->select();
    if(count($SearchList)>0){
    $sql="Update yd_search_key set search_num=search_num+1 where key_word='" .$SearchKey. "'";
    }else{
    $sql="INSERT INTO yd_search_key (key_word, key_word_pinyin, key_word_pinyin_first, is_show, search_num, search_order) VALUES('" .$SearchKey. "', '" .$pinyinall. "', '" .$pinyinfirst. "',0,1,0)";
    }
    $Dao=M();
    $SearchList = $Dao->execute($sql);
    $sql="INSERT INTO yd_hot_word(ctime,word,is_show,fm,ip,cus_id) values ('" .time(). "','" .$SearchKey. "',1,0,'" .$cip. "'," .$cus_id. ")";
    $Dao=M();
    $SearchList = $Dao->execute($sql);
    return 'OK' ;
    }

  • 相关阅读:
    菜鸟浅谈软件开发项目管理
    中国准货币体系的概要简析
    使用dockercompose安装wordpress
    货币乘数
    安全测试的相关内容
    TCP三次握手和四次挥手
    HTTP协议相关
    描述浏览器登录的过程
    AJAX相关知识
    什么是热钱
  • 原文地址:https://www.cnblogs.com/mike1314/p/7168578.html
Copyright © 2011-2022 走看看