因為需要在網上搜索了一下找到此修改方法:
首先 是新建模型:商標信息 模型;附加表為dede_shangbiao ,附加字段先添加了2個,sbID(商標ID)和chuangyi(創意說明)
然后 打開需要搜索的模板,我用的是通用的模板,head.htm 稍后有圖說明,
<form action="{dede:global.cfg_cmsurl /}/plus/advancedsearch.php" method="post">
<input type="hidden" name="mid" value="100" /> //100是模型的ID號
<input type="hidden" name="dopost" value="search" />
<input name="keyword" type="text" class="search-keyword" id="search-keyword" />
{dede:php}
$tl = new TypeLink(100);
$typeOpti***** = $tl->GetOptionArray(0,0,100);
echo "<select name='typeid' style='width:200'>\r\n";
echo "<option value='0' selected>--不限欄目--</option>\r\n";
echo $typeOpti*****;
echo "</select>";
{/dede:php}
<select name="serachvalue" class="search-option">
<option value="q" selected='1'>商標名稱</option>
<option value="sbid">商標ID</option>
<option value="chuangyi">創意說明</option>
</select>
<button type="submit" class="search-submit">Search Now</button>
</form>
最后是修改plus/advancedsearch.php 文件
找到$q = stripslashes($q); 大概在43行左右在其上面添加
if($_POST["serachvalue"] == "q"){$q=$keyword;}
elseif($_POST["serachvalue"] == "sbid"){$sbid=$keyword;}
elseif($_POST["serachvalue"] == "chuangyi"){$chuangyi=$keyword;}
判斷是根據神馬搜索的,
找到if($q != ''){$where .= " and main.title like '%$q%' ";}修改為
if($q != ''){$where .= " and main.title like '%$q%' ";}
elseif($sbid != ''){$where.=" and addon.sbID='$sbid'";}
elseif($chuangyi != ''){$where .="and addon.chuangyi like '%$chuangyi%'";}
如果是搜索標題的話查詢的是主表,如是搜索商標ID和創意說明的 則是搜索的附加表
就這樣就完成了。哈哈,簡單吧!
然后 打開需要搜索的模板,我用的是通用的模板,head.htm 稍后有圖說明,
<form action="{dede:global.cfg_cmsurl /}/plus/advancedsearch.php" method="post">
<input type="hidden" name="mid" value="100" /> //100是模型的ID號
<input type="hidden" name="dopost" value="search" />
<input name="keyword" type="text" class="search-keyword" id="search-keyword" />
{dede:php}
$tl = new TypeLink(100);
$typeOpti***** = $tl->GetOptionArray(0,0,100);
echo "<select name='typeid' style='width:200'>\r\n";
echo "<option value='0' selected>--不限欄目--</option>\r\n";
echo $typeOpti*****;
echo "</select>";
{/dede:php}
<select name="serachvalue" class="search-option">
<option value="q" selected='1'>商標名稱</option>
<option value="sbid">商標ID</option>
<option value="chuangyi">創意說明</option>
</select>
<button type="submit" class="search-submit">Search Now</button>
</form>
最后是修改plus/advancedsearch.php 文件
找到$q = stripslashes($q); 大概在43行左右在其上面添加
if($_POST["serachvalue"] == "q"){$q=$keyword;}
elseif($_POST["serachvalue"] == "sbid"){$sbid=$keyword;}
elseif($_POST["serachvalue"] == "chuangyi"){$chuangyi=$keyword;}
判斷是根據神馬搜索的,
找到if($q != ''){$where .= " and main.title like '%$q%' ";}修改為
if($q != ''){$where .= " and main.title like '%$q%' ";}
elseif($sbid != ''){$where.=" and addon.sbID='$sbid'";}
elseif($chuangyi != ''){$where .="and addon.chuangyi like '%$chuangyi%'";}
如果是搜索標題的話查詢的是主表,如是搜索商標ID和創意說明的 則是搜索的附加表
就這樣就完成了。哈哈,簡單吧!

http://www.xunyangie.com/dedecms/wenzhang/xunyang210.html