ecshop搜尋新增「品牌名」搜尋:
第一步:在根目錄下的search.php找到:
$keywords .= "(goods_name like '%$val%' or goods_sn like '%$val%' or keywords like '%$val%' $sc_dsad)";
更改為:
$keywords .= "(goods_name like '%$val%' or goods_sn like '%$val%' or brand_name like '%$val%' or keywords like '%$val%' $sc_dsad)";
第二步:找到:
/* 獲得符合條件的商品總數 */
$sql = "select count(*) from " .$ecs->table('goods'). " as g ".
"where g.is_delete = 0 and g.is_on_sale = 1 and g.is_alone_sale = 1 $attr_in ".
"and (( 1 " . $categories . $keywords . $brand . $min_price . $max_price . $intro . $outstock ." ) ".$tag_where." )";
$count = $db->getone($sql);
更改為:
/* 獲得符合條件的商品總數 */
$sql = "select count(*) from " .$ecs->table('goods'). " as g ".
"left join " . $globals['ecs']->table('brand') . " as b on b.brand_id =g.brand_id ".
"where g.is_delete = 0 and g.is_on_sale = 1 and g.is_alone_sale = 1 $attr_in ".
"and (( 1 " . $categories . $keywords . $brand . $min_price . $max_price . $intro . $outstock ." ) ".$tag_where." )";
$count = $db->getone($sql);
第三步:找到:
/* 查詢商品 */
$sql = "select g.goods_id, g.goods_name, g.market_price, g.is_new, g.is_best, g.is_hot, g.shop_price as org_price, ".
"ifnull(mp.user_price, g.shop_price * '$_session[discount]') as shop_price, ".
"g.promote_price, g.promote_start_date, g.promote_end_date, g.goods_thumb, g.goods_img, g.original_img, g.goods_brief, g.goods_type ".
"from " .$ecs->table('goods'). " as g ".
"left join " . $globals['ecs']->table('member_price') . " as mp ".
"on mp.goods_id = g.goods_id and mp.user_rank = '$_session[user_rank]' ".
"where g.is_delete = 0 and g.is_on_sale = 1 and g.is_alone_sale = 1 $attr_in ".
"and (( 1 " . $categories . $keywords . $brand . $min_price . $max_price . $intro . $outstock . " ) ".$tag_where." ) " .
"order by $sort $order";
$res = $db->selectlimit($sql, $size, ($page - 1) * $size);
更改為:
/* 查詢商品 */
$sql = "select g.goods_id, g.goods_name, g.market_price, g.is_new, g.is_best, g.is_hot, g.shop_price as org_price, ".
"ifnull(mp.user_price, g.shop_price * '$_session[discount]') as shop_price, ".
"g.promote_price, g.promote_start_date, g.promote_end_date, g.goods_thumb, g.goods_img, g.original_img, g.goods_brief, g.goods_type ".
"from " .$ecs->table('goods'). " as g ".
"left join " . $globals['ecs']->table('member_price') . " as mp ".
"on mp.goods_id = g.goods_id and mp.user_rank = '$_session[user_rank]' ".
'left join ' . $globals['ecs']->table('brand') . ' as b on b.brand_id = g.brand_id '.
"where g.is_delete = 0 and g.is_on_sale = 1 and g.is_alone_sale = 1 $attr_in ".
"and (( 1 " . $categories . $keywords . $brand . $min_price . $max_price . $intro . $outstock . " ) ".$tag_where." ) " .
"order by $sort $order";
$res = $db->selectlimit($sql, $size, ($page - 1) * $size);
至此,完成增加品牌搜尋功能。
android LinearLayout新增分隔線
linearlayout支援直接顯示分隔線。設定標籤的 android showdividers屬性可以再linearlayout的相應位置顯示分隔線。如果有多個linearlayout,顯示效果和在 linearlayout之間加分隔線是一樣的。android showdividers屬性可以設定...
prometheus grafana監控新增新節點
已部署好prometheus grafana,並能正常執行 在client端先部署好已經編寫好的node exporter 編寫指令碼並執行 bin bash wget http ip node.tar.gz 獲取編寫好的node tar zxvf node.tar.gz c usr local 解...
FZYZOJ 2148 小添添的灰機貓
時間限制 1000ms 記憶體限制 131072kb 成功從wtm晉公升為acm的小添添越來越sxbk了,開始將魔爪伸向了自己的灰h機j貓。事情是這樣的,小添添有k只貓,分別是0 k 1。他先用rand k隨機出了n個數,告訴你他需要臨幸的灰機貓的編號,如果乙隻貓多次出現,也只算一次。因為小添添一開...