{"id":59320,"date":"2025-04-23T10:40:20","date_gmt":"2025-04-23T02:40:20","guid":{"rendered":"https:\/\/fwq.ai\/blog\/59320\/"},"modified":"2025-04-23T10:40:20","modified_gmt":"2025-04-23T02:40:20","slug":"ecshop%e6%90%9c%e7%b4%a2%e5%87%ba%e7%8e%b0%e7%9b%b8%e5%85%b3%e5%95%86%e5%93%81%e7%9a%84%e6%95%88%e6%9e%9c%e6%bb%91%e5%8a%a8%e4%b8%8b%e6%8b%89%e6%95%88%e6%9e%9c","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/59320\/","title":{"rendered":"ecshop\u641c\u7d22\u51fa\u73b0\u76f8\u5173\u5546\u54c1\u7684\u6548\u679c\u6ed1\u52a8\u4e0b\u62c9\u6548\u679c"},"content":{"rendered":"<p><span style=\"font-family: Verdana, Arial, Tahoma;font-size: 14px;line-height: 25px\">ecshop\u641c\u7d22\u680f<span style=\"padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;margin-left: 0px;font-family: Verdana, Helvetica, Arial, sans-serif\">\u6548\u679c\u5982\u4e0b<\/span><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/111001\/1_111001163940_1.jpg\" style=\"cursor:pointer\" class=\"aligncenter\" title=\"ecshop\u641c\u7d22\u51fa\u73b0\u76f8\u5173\u5546\u54c1\u7684\u6548\u679c\u6ed1\u52a8\u4e0b\u62c9\u6548\u679c\u63d2\u56fe\" alt=\"ecshop\u641c\u7d22\u51fa\u73b0\u76f8\u5173\u5546\u54c1\u7684\u6548\u679c\u6ed1\u52a8\u4e0b\u62c9\u6548\u679c\u63d2\u56fe\" \/>  <\/p>\n<p>&nbsp;<span style=\"font-family: Verdana, Arial, Tahoma;font-size: 14px;line-height: 25px\"><span style=\"font-family: Verdana, Helvetica, Arial, sans-serif\">\u6240\u9700\u8981\u7684\u6837\u5f0f\u6211\u4eec\u53ef\u4ee5\u590d\u5236\u5230style.css\u91cc\uff1a<\/span> <\/span><\/p>\n<p style=\"padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;margin-left: 0px\">&nbsp;<\/p>\n<ol>\n<li>&nbsp;<\/li>\n<li>\/*<span style=\"padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;margin-left: 0px;line-height: normal;cursor: pointer;border-bottom-width: 1px;border-bottom-style: solid\">\u641c\u7d22<\/span>\u6ed1\u52a8\u6548\u679c*\/<\/li>\n<li>.Menu {<\/li>\n<li>position:absolute;<\/li>\n<li>top:30px;<\/li>\n<li>left:7px;<\/li>\n<li>width:150px;<\/li>\n<li>height:auto;<\/li>\n<li>z-index:1;<\/li>\n<li>background:#FFF;<\/li>\n<li>border:1px solid #000;<\/li>\n<li>display:none;<\/li>\n<li>}<\/li>\n<li>.Menu2 {<\/li>\n<li>position: absolute;<\/li>\n<li>left:0;<\/li>\n<li>top:0;<\/li>\n<li>width:100%;<\/li>\n<li>height:auto;<\/li>\n<li>overflow:hidden;<\/li>\n<li>z-index:1;<\/li>\n<li>}<\/li>\n<li>.Menu2 ul{margin:0;padding:0}<\/li>\n<li>.Menu2 ul li{width:100%;height:25px;line-height:25px;text-indent:15px;<\/li>\n<li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; border-bottom:1px dashed #ccc;color:#666;cursor:pointer;background:#FFF;<\/li>\n<li>&nbsp; &nbsp; change:expression(<\/li>\n<li>&nbsp; &nbsp;&nbsp;&nbsp;this.onmouseover=function(){<\/li>\n<li>&nbsp; &nbsp;&nbsp; &nbsp; this.style.background=&#8221;#F2F5EF&#8221;;<\/li>\n<li>&nbsp; &nbsp;&nbsp;&nbsp;},<\/li>\n<li>&nbsp; &nbsp;&nbsp;&nbsp;this.onmouseout=function(){<\/li>\n<li>&nbsp; &nbsp;&nbsp; &nbsp; this.style.background=&#8221;&#8221;;<\/li>\n<li>&nbsp; &nbsp;&nbsp;&nbsp;}<\/li>\n<li>&nbsp; &nbsp; )<\/li>\n<li>&nbsp; &nbsp;}<\/li>\n<li>input{width:200px}<\/li>\n<li>.form{width:200px;height:auto;}<\/li>\n<li>.form div{position:relative;top:0;left:0;margin-bottom:5px}<\/li>\n<\/ol>\n<p><em>\u590d\u5236<span style=\"padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;margin-left: 0px;line-height: normal;cursor: pointer;border-bottom-width: 1px;border-bottom-style: solid\">\u4ee3\u7801<\/span><\/em>  <\/p>\n<p style=\"padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;margin-left: 0px\">\n<p> \u4ee5\u4e0b\u4ee3\u7801\u9700\u8981\u52a0\u5230\u8f93\u5165\u6846\u666e\u904d \u6bd4\u5982page_header.lbi<\/p>\n<ol>\n<li>&nbsp;<\/li>\n<li>&lt;script type=&#8221;text\/javascript&#8221;&gt;<\/li>\n<li>&nbsp;&nbsp;function showAndHide(obj,types,text){<\/li>\n<li>&nbsp; &nbsp; var Layer=window.document.getElementById(obj);<\/li>\n<li>&nbsp; &nbsp; switch(types){<\/li>\n<li>&nbsp; &nbsp;case &#8220;show&#8221;:<\/li>\n<li>&nbsp; &nbsp;&nbsp;&nbsp;if(text!=&#8221;)<\/li>\n<li>&nbsp;&nbsp;{<\/li>\n<li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; Layer.style.display=&#8221;block&#8221;;<\/li>\n<li>&nbsp; &nbsp; Ajax.call(&#8216;search_div.php&#8217;, &#8216;act=search&amp;text=&#8217; + text, changesumResp**e, &#8216;GET&#8217;, &#8216;JSON&#8217;);&nbsp;<\/li>\n<li>&nbsp;&nbsp;}<\/li>\n<li>&nbsp; &nbsp;break;<\/li>\n<li>&nbsp; &nbsp;case &#8220;hide&#8221;:<\/li>\n<li>&nbsp; &nbsp;&nbsp;&nbsp;Layer.style.display=&#8221;none&#8221;;<\/li>\n<li>}<\/li>\n<li>&nbsp;&nbsp;}<\/li>\n<li>&nbsp;&nbsp;function getValue(obj,str){<\/li>\n<li>&nbsp; &nbsp; var input=window.document.getElementById(obj);<\/li>\n<li>input.value=str;<\/li>\n<li>&nbsp;&nbsp;}<\/li>\n<li>&nbsp;<\/li>\n<li>function changesumResp**e(res)<\/li>\n<li>{<\/li>\n<li>&nbsp; &nbsp; var a=&#8221;;<\/li>\n<li>&nbsp; &nbsp;&nbsp; &nbsp;for (var i = 0; i &lt; res.content.length; i++)<\/li>\n<li>&nbsp; &nbsp;&nbsp; &nbsp;{<\/li>\n<li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;a += &#8220;&lt;li onmousedown=getValue(&#8216;keyword&#8217;,'&#8221; + res.content[i].goods_name + &#8220;&#8216;)&gt;&#8221; + res.content[i].goods_name + &#8220;&lt;\/li&gt;&#8221;;<\/li>\n<li>&nbsp; &nbsp;}<\/li>\n<li>&nbsp;&nbsp;\/\/ alert(a);<\/li>\n<li>&nbsp; &nbsp;document.getElementById(&#8216;show_stock&#8217;).innerHTML = a;<\/li>\n<li>}&nbsp;<\/li>\n<li>&nbsp;&nbsp;<\/li>\n<li>&lt;\/script&gt;<\/li>\n<\/ol>\n<p><em>\u590d\u5236\u4ee3\u7801<\/em>  <\/p>\n<p style=\"padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;margin-left: 0px\">\n<p> \u6211\u4eec\u8f93\u5165\u6846\u7684\u4ee3\u7801<\/p>\n<ol>\n<li>&lt;input name=&#8221;keywords&#8221; onkeyup=&#8221;showAndHide(&#8216;List1&#8242;,&#8217;show&#8217;,this.value);&#8221; onblur=&#8221;showAndHide(&#8216;List1&#8242;,&#8217;hide&#8217;);&#8221; type=&#8221;text&#8221; id=&#8221;keyword&#8221; value=&#8221;{$search_keywords|escape}&#8221; style=&#8221; border:0; margin-left:15px;margin-top:5px; width:130px; height:15px;&#8221;\/&gt;<\/li>\n<li>&lt;div class=&#8221;Menu&#8221; id=&#8221;List1&#8243;&gt;<\/li>\n<li>&lt;div class=&#8221;Menu2&#8243;&gt;<\/li>\n<li>&lt;ul style=&#8221;padding:0px; margin:0px;&#8221; id=&#8221;show_stock&#8221;&gt;<\/li>\n<li>&lt;\/ul&gt;<\/li>\n<li>&lt;\/div&gt;<\/li>\n<li>&lt;\/div&gt;<\/li>\n<\/ol>\n<p><em>\u590d\u5236\u4ee3\u7801<\/em>  <\/p>\n<p style=\"padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;margin-left: 0px\">\n<p> ajax\u8bf7\u6c42php\u7684\u4ee3\u7801<\/p>\n<p> search_div.php<\/p>\n<ol>\n<li>&nbsp;<\/li>\n<li>&lt;?php<\/li>\n<li>define(&#8216;IN_ECS&#8217;, true);<\/li>\n<li>require(dirname(__FILE__) . &#8216;\/includes\/init.php&#8217;);<\/li>\n<li>require(dirname(__FILE__) . &#8216;\/admin\/includes\/lib_main.php&#8217;);<\/li>\n<li>if($_REQUEST[&#8216;act&#8217;] == &#8216;search&#8217;){<\/li>\n<li>&nbsp;&nbsp;$keywords = json_str_iconv(trim($_GET[&#8216;text&#8217;]));<\/li>\n<li>&nbsp;&nbsp;$sql = &#8220;SELECT goods_name,goods_id FROM &#8221; . $GLOBALS[&#8216;ecs&#8217;]-&gt;table(&#8216;goods&#8217;).&#8221; where goods_name like &#8216;%$keywords%'&#8221;;<\/li>\n<li>&nbsp;&nbsp;$brand_array = $GLOBALS[&#8216;db&#8217;]-&gt;getall($sql);<\/li>\n<li>&nbsp;&nbsp;foreach($brand_array as $ids =&gt;$value)<\/li>\n<li>&nbsp;&nbsp;{<\/li>\n<li>&nbsp; &nbsp;$brand_array[$ids][&#8216;goods_name&#8217;] = sub_str_xaphp($brand_array[$ids][&#8216;goods_name&#8217;],5);<\/li>\n<li>&nbsp;&nbsp;<\/li>\n<li>&nbsp;&nbsp;}<\/li>\n<li>&nbsp;&nbsp;make_json_result($brand_array);<\/li>\n<li>}<\/li>\n<li>function sub_str_xaphp($str, $length = 0, $append = true)<\/li>\n<li>{<\/li>\n<li>&nbsp; &nbsp; $str = trim($str);<\/li>\n<li>&nbsp; &nbsp; $strlength = strlen($str);<\/li>\n<li>&nbsp; &nbsp; if ($length == 0 || $length &gt;= $strlength)<\/li>\n<li>&nbsp; &nbsp; {<\/li>\n<li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;return $str;<\/li>\n<li>&nbsp; &nbsp; }<\/li>\n<li>&nbsp; &nbsp; elseif ($length &lt; 0)<\/li>\n<li>&nbsp; &nbsp; {<\/li>\n<li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$length = $strlength + $length;<\/li>\n<li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if ($length &lt; 0)<\/li>\n<li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;{<\/li>\n<li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;$length = $strlength;<\/li>\n<li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<\/li>\n<li>&nbsp; &nbsp; }<\/li>\n<li>&nbsp; &nbsp; if (function_exists(&#8216;mb_substr&#8217;))<\/li>\n<li>&nbsp; &nbsp; {<\/li>\n<li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$newstr = mb_substr($str, 0, $length, EC_CHARSET);<\/li>\n<li>&nbsp; &nbsp; }<\/li>\n<li>&nbsp; &nbsp; elseif (function_exists(&#8216;iconv_substr&#8217;))<\/li>\n<li>&nbsp; &nbsp; {<\/li>\n<li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$newstr = iconv_substr($str, 0, $length, EC_CHARSET);<\/li>\n<li>&nbsp; &nbsp; }<\/li>\n<li>&nbsp; &nbsp; else<\/li>\n<li>&nbsp; &nbsp; {<\/li>\n<li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;\/\/$newstr = trim_right(substr($str, 0, $length));<\/li>\n<li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$newstr = substr($str, 0, $length);<\/li>\n<li>&nbsp; &nbsp; }<\/li>\n<li>&nbsp; &nbsp; if ($append &amp;&amp; $str != $newstr)<\/li>\n<li>&nbsp; &nbsp; {<\/li>\n<li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$newstr .= &#8221;;<\/li>\n<li>&nbsp; &nbsp; }<\/li>\n<li>&nbsp; &nbsp; return $newstr;<\/li>\n<li>}<\/li>\n<li>?&gt;<\/li>\n<\/ol>\n<p><em>\u590d\u5236\u4ee3\u7801<\/em>  <\/p>\n<p style=\"padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;margin-left: 0px\">\n<p> \u5728<span style=\"padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;margin-left: 0px;line-height: normal;cursor: pointer;border-bottom-width: 1px;border-bottom-style: solid\">\u5546\u54c1<\/span>\u5c11\u7684\u60c5\u51b5\u4e0b \u6211\u4eec\u4e4b\u95f4\u67e5\u8be2 \u5982\u679c\u591a\u4e86\uff0c\u597d\u6a21\u677f\u5efa\u8bae\u4fee\u6539<span style=\"padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;margin-left: 0px;line-height: normal;cursor: pointer;border-bottom-width: 1px;border-bottom-style: solid\">\u7a0b\u5e8f<\/span><\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>ecshop\u641c\u7d22\u680f\u6548\u679c\u5982\u4e0b &nbsp; &nbsp;\u6240\u9700\u8981\u7684\u6837\u5f0f\u6211\u4eec\u53ef\u4ee5\u590d\u5236\u5230style.css\u91cc\uff1a &nbsp; &nbsp; \/*\u641c\u7d22\u6ed1\u52a8\u6548\u679c*\/ .Menu { position:absolute; top:30px; left:7px; width:150px; height:auto; z-index:1; background:#FFF; border:1px solid #000; display:none; } .Menu2 { position: absolute; left:0; top:0; width:100%; height:auto; overflow:hidden; z-index:1; } .Menu2 ul{margin:0;padding:0} .Menu2 ul li{width:100%;height:25px;line-height:25px;text-indent:15px; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; border-bottom:1px dashed #ccc;color:#666;cursor:pointer;background:#FFF; &nbsp; &nbsp; change:expression( &nbsp; &nbsp;&nbsp;&nbsp;this.onmouseover=function(){ &nbsp; &nbsp;&nbsp; &nbsp; this.style.background=&#8221;#F2F5EF&#8221;; &nbsp; &nbsp;&nbsp;&nbsp;}, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-59320","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/59320","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=59320"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/59320\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=59320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=59320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=59320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}