| 搜索表單變量說明 |
| 變量名 | 說明 | 例子 |
| 搜索表單提交地址 | POST方式:/e/search/index.php | <form name="searchform" method="post" action="/e/search/index.php"> |
| GET方式:/e/search/?searchget=1 | /e/search/?searchget=1&keyboard=帝國&show=title | |
| keyboard | 搜索關(guān)鍵字變量 | <input name="keyboard" type="text"> |
| show | 搜索字段變量(多個字段用","格開。搜索字段必須是后臺模型開啟搜索的字段) | <input type="hidden" name="show" value="title,newstext"> |
| classid | 搜索欄目ID(不設(shè)置為不限,多個欄目可用","格開,設(shè)置父欄目會搜索所有子欄目) | <input type="hidden" name="classid" value="1"> |
| ztid | 搜索專題ID(不設(shè)置為不限,多個專題可用","格開) | <input type="hidden" name="ztid" value="1"> |
| tbname | 按數(shù)據(jù)表搜索(需與搜索模板ID結(jié)合) | <input type="hidden" name="tbname" value="news"> |
| tempid | 所用搜索模板ID(一般跟按表搜索結(jié)合使用) | <input type="hidden" name="tempid" value="1"> |
| starttime與endtime | 分別為搜索發(fā)布起始時間與結(jié)束時間的信息(不填為不限.格式:2008-02-27) | <input name="starttime" type="text" value="0000-00-00" size="12"> <input name="endtime" type="text" value="0000-00-00" size="12"> |
| startprice與endprice | 分別為商品價格的起始價格與結(jié)束價格(不填為不限) | <input name="startprice" type="text" value="0" size="6"> <input name="endprice" type="text" value="0" size="6"> |
| 搜索特殊字段 | id : 按信息ID搜索 keyboard : 按關(guān)鍵字搜索(可實現(xiàn)按tags列出信息) userid : 按發(fā)布者用戶ID搜索 username : 按發(fā)布者用戶名搜索 | <input type="hidden" name="show" value="keyboard"> |
| member | 值為0則不限制 值為1則為只搜索會員投稿的信息 值為2則為只搜索管理員增加的信息 | <input type="hidden" name="member" value="1"> |
| orderby | 排序字段: 0:按發(fā)布日期(默認) 1:按ID 2:按評論數(shù) 3:按瀏覽人氣 4:按下載數(shù) | <input type="hidden" name="orderby" value="1"> |
| myorder | 排序方式: 0:倒序排列(默認) 1:順序排列 | <input type="hidden" name="myorder" value="1"> |
| andor | 設(shè)置多條件查詢之間關(guān)聯(lián)關(guān)系,有兩種: or : 或者的關(guān)系(默認) and : 并且的關(guān)系 | <input type="hidden" name="andor" value="and"> |
| hh | 邏輯運算聯(lián)結(jié)符變量: LT : 小于 GT : 大于 EQ : 等于 LE : 小于等于 GE : 大于等于 NE : 不等于 IN : 包含(搜索關(guān)鍵字用空格隔開每個值) BT : 范圍,兩個值之間(搜索關(guān)鍵字用空格隔開兩個值) LK : 模糊查詢(默認) | <input type="hidden" name="hh" value="LK"> |
| 搜索表單多條件并列搜索語法說明 |
| 多字段、多邏輯運算聯(lián)結(jié)符并列搜索 |
| (一)、多字段并列搜索:有“字符串”與“數(shù)組”兩種傳遞方式 |
| 1、字符串傳遞為例子: |
| <input type="hidden" name="hh" value="LK"> <input type="hidden" name="show" value="title,writer"> <input type="hidden" name="keyboard" value="標題,作者"> (說明:上面為模糊查詢title字段包含“標題”字符或者writer字段包含“作者”的信息) |
| 2、數(shù)組傳遞為例子: |
| <input type="hidden" name="hh" value="LK"> <input type="hidden" name="show[]" value="title"> <input type="hidden" name="keyboard[]" value="標題"> <input type="hidden" name="show[]" value="writer"> <input type="hidden" name="keyboard[]" value="作者"> (說明:上面為模糊查詢title字段包含“標題”字符或者writer字段包含“作者”的信息) |
| (二)、多邏輯運算聯(lián)結(jié)符并列搜索 |
| 1、字符串傳遞為例子: |
| <input type="hidden" name="hh" value="LK,EQ"> <input type="hidden" name="show" value="title,writer"> <input type="hidden" name="keyboard" value="標題,作者"> (說明:上面為模糊查詢title字段包含“標題”字符或者writer字段等于“作者”的信息) |
| 2、字符串傳遞為例子: |
| <input type="hidden" name="show[]" value="title"> <input type="hidden" name="hh[]" value="LK"> <input type="hidden" name="keyboard[]" value="標題"> <input type="hidden" name="show[]" value="writer"> <input type="hidden" name="hh[]" value="EQ"> <input type="hidden" name="keyboard[]" value="作者"> (說明:上面為模糊查詢title字段包含“標題”字符或者writer字段等于“作者”的信息) |
新聞熱點
疑難解答