{"id":198996,"date":"2025-05-03T11:14:47","date_gmt":"2025-05-03T03:14:47","guid":{"rendered":"https:\/\/server.hk\/cnblog\/198996\/"},"modified":"2025-05-03T11:14:47","modified_gmt":"2025-05-03T03:14:47","slug":"%e5%9c%a8ecshop%e9%a6%96%e9%a1%b5%e5%a2%9e%e5%8a%a0%e4%b8%80%e4%b8%aa%e6%b5%8f%e8%a7%88%e6%8e%92%e8%a1%8c","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/198996\/","title":{"rendered":"\u5728ECSHOP\u9996\u9875\u589e\u52a0\u4e00\u4e2a\u6d4f\u89c8\u6392\u884c"},"content":{"rendered":"<p>\u6700\u8fd1\u6709\u770b\u5230\u670b\u53cb\u5728ECSHOP\u8bba\u575b\u91cc\u63d0\u95ee\uff1a <strong>\u5982\u4f55\u5728\u9996\u9875\u589e\u52a0\u4e00\u4e2a\u7c7b\u4f3c\u4e8e\u201c\u9500\u552e\u6392\u884c\u699c\u201d\u7684\u201c\u6d4f\u89c8\u6392\u884c\u699c\u201d\uff0c\u5e76\u4e14\u53ef\u4ee5\u5728\u540e\u53f0\u7684\u201c\u6a21\u677f\u8bbe\u7f6e\u201d\u91cc\u8fdb\u884c\u63a7\u5236\u3002<\/p>\n<p> <\/strong>\u7531\u4e8e\u7cfb\u7edf\u9ed8\u8ba4\u662f\u6ca1\u6709\u8bfb\u53d6\u6d4f\u89c8\u6392\u884c\u7684\uff0c\u6240\u4ee5\u8fd9\u90e8\u5206\u529f\u80fd\u65e2\u5f97\u589e\u52a0\u7a0b\u5e8f\uff0c\u53c8\u5f97\u589e\u52a0\u6a21\u677f\u3002<br \/> \u672c\u6559\u7a0b\u662f\u4ee5 ecshop2.7.2 \u5b98\u65b9\u9ed8\u8ba4\u6a21\u677f \u4e3a\u4f8b\u8fdb\u884c\u8bb2\u89e3\u7684\u3002<\/p>\n<p> \u6548\u679c\u56fe\u5982\u4e0b\uff1a<br \/> <img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/c101102\/12XDX534620-112E.jpg\" class=\"aligncenter\"><\/p>\n<p> 1\uff09\u3001\u5c06\u4e0b\u9762\u4ee3\u7801\u590d\u5236\u5e76\u4fdd\u5b58\u5230&nbsp;\u4e00\u4e2a\u65b0\u6587\u4ef6\u4e2d\uff0c\u6587\u4ef6\u8def\u5f84\u4e3a\uff1a \/themes\/default\/library\/top10_click.lbi <\/p>\n<table cellspacing=\"0\" cellpadding=\"5\" style=\"border-right: #cccccc 1px solid;border-top: #cccccc 1px solid;background: #f7f7f7;border-left: #cccccc 1px solid;width: 90%;border-bottom: #cccccc 1px solid\">\n<tbody>\n<tr>\n<td><font>&lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text\/html; charset=utf-8&#8243;&gt;<br \/> &lt;div class=&#8221;box&#8221;&gt;<br \/> &nbsp;&lt;div class=&#8221;box_2&#8243;&gt;<br \/> &nbsp;&nbsp; &lt;h3&gt;&lt;span&gt;\u6d4f\u89c8\u6392\u884c&lt;\/span&gt;&lt;\/h3&gt;<br \/> &nbsp; &lt;div class=&#8221;top10List clearfix&#8221;&gt;<br \/> &nbsp; &lt;!&#8211; {foreach name=top_goods from=$top_goods_click item=goods}&#8211;&gt;<br \/> &nbsp; &lt;ul class=&#8221;clearfix&#8221;&gt;<br \/> &nbsp;&lt;img src=&#8221;..\/images\/top_{$smarty.foreach.top_goods.iteration}.gif&#8221; class=&#8221;iteration&#8221; \/&gt;<br \/> &nbsp;&lt;!&#8211; {if $smarty.foreach.top_goods.iteration&lt;4}&#8211;&gt;<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;li class=&#8221;topimg&#8221;&gt;<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;a href=&#8221;{$goods.url}&#8221;&gt;&lt;img src=&#8221;{$goods.thumb}&#8221; alt=&#8221;{$goods.name|escape:html}&#8221; class=&#8221;samllimg&#8221; \/&gt;&lt;\/a&gt;<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/li&gt;<br \/> &nbsp;&lt;!&#8211; {\/if} &#8211;&gt;&nbsp;&nbsp;<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;li {if $smarty.foreach.top_goods.iteration&lt;4}class=&#8221;iteration1&#8243;{\/if}&gt;<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;a href=&#8221;{$goods.url}&#8221; title=&#8221;{$goods.name|escape:html}&#8221;&gt;{$goods.short_name}&lt;\/a&gt;&lt;br \/&gt;<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {$lang.shop_price}&lt;font class=&#8221;f1&#8243;&gt;{$goods.price}&lt;\/font&gt;&lt;br \/&gt;<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/li&gt;<br \/> &nbsp;&nbsp;&nbsp; &lt;\/ul&gt;<br \/> &nbsp; &lt;!&#8211; {\/foreach} &#8211;&gt;<br \/> &nbsp; &lt;\/div&gt;<br \/> &nbsp;&lt;\/div&gt;<br \/> &lt;\/div&gt;<br \/> &lt;div class=&#8221;blank5&#8243;&gt;&lt;\/div&gt;<\/font><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> 2\uff09\u3001\u4fee\u6539 \/includes\/lib_goods.php \u6587\u4ef6<br \/>\n<br \/> \u5728\u6700\u4e0b\u9762\u589e\u52a0\u4e00\u4e2a\u51fd\u6570<br \/>\n <\/p>\n<table cellspacing=\"0\" cellpadding=\"5\" style=\"border-right: #cccccc 1px solid;border-top: #cccccc 1px solid;background: #f7f7f7;border-left: #cccccc 1px solid;width: 90%;border-bottom: #cccccc 1px solid\">\n<tbody>\n<tr>\n<td><font>\/**<br \/> &nbsp;* \u8c03\u7528\u6d4f\u89c8\u6392\u884c\u699c<br \/> &nbsp;*<br \/> &nbsp;* @access&nbsp; public<br \/> &nbsp;* @return&nbsp; array<br \/> &nbsp;*\/<br \/> function get_top10_click()<br \/> {<br \/> &nbsp;$sql=&#8221;SELECT goods_id, goods_name, shop_price, goods_thumb &#8221; .<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8216;FROM &#8216; . $GLOBALS[&#8216;ecs&#8217;]-&gt;table(&#8216;goods&#8217;).&#8221; where is_on_sale = 1 AND is_alone_sale = 1 AND is_delete = 0 order by click_count desc limit 10&#8243;;<br \/> &nbsp;$arr = $GLOBALS[&#8216;db&#8217;]-&gt;getAll($sql);<br \/> &nbsp;&nbsp;&nbsp; for ($i = 0, $count = count($arr); $i &lt; $count; $i++)<br \/> &nbsp;&nbsp;&nbsp; {<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $arr[$i][&#8216;short_name&#8217;] = $GLOBALS[&#8216;_CFG&#8217;][&#8216;goods_name_length&#8217;] &gt; 0 ?<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sub_str($arr[$i][&#8216;goods_name&#8217;], $GLOBALS[&#8216;_CFG&#8217;][&#8216;goods_name_length&#8217;]) : $arr[$i][&#8216;goods_name&#8217;];<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $arr[$i][&#8216;url&#8217;]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = build_uri(&#8216;goods&#8217;, array(&#8216;gid&#8217; =&gt; $arr[$i][&#8216;goods_id&#8217;]), $arr[$i][&#8216;goods_name&#8217;]);<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $arr[$i][&#8216;thumb&#8217;] = get_image_path($arr[$i][&#8216;goods_id&#8217;], $arr[$i][&#8216;goods_thumb&#8217;],true);<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $arr[$i][&#8216;price&#8217;] = price_format($arr[$i][&#8216;shop_price&#8217;]);<br \/> &nbsp;&nbsp;&nbsp; }<br \/> &nbsp;return $arr;<br \/> }<\/font><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> 3\uff09\u3001\u4fee\u6539 \/index.php \u6587\u4ef6<br \/>\n<br \/> \u5728 <\/p>\n<table cellspacing=\"0\" cellpadding=\"5\" style=\"border-right: #cccccc 1px solid;border-top: #cccccc 1px solid;background: #f7f7f7;border-left: #cccccc 1px solid;width: 90%;border-bottom: #cccccc 1px solid\">\n<tbody>\n<tr>\n<td><font>$smarty-&gt;assign(&#8216;top_goods&#8217;,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; get_top10());&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/ \u9500\u552e\u6392\u884c<\/font><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> \u4e0b\u9762\u53e6\u8d77\u4e00\u884c\u589e\u52a0 <\/p>\n<table cellspacing=\"0\" cellpadding=\"5\" style=\"border-right: #cccccc 1px solid;border-top: #cccccc 1px solid;background: #f7f7f7;border-left: #cccccc 1px solid;width: 90%;border-bottom: #cccccc 1px solid\">\n<tbody>\n<tr>\n<td><font>$smarty-&gt;assign(&#8216;top_goods_click&#8217;,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; get_top10_click());&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/ \u6d4f\u89c8\u6392\u884c<\/font><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> \u4fee\u6539\u6a21\u677f\u6587\u4ef6 \/themes\/default\/index.dwt<br \/>\n<br \/> \u627e\u5230<br \/>\n <\/p>\n<table cellspacing=\"0\" cellpadding=\"5\" style=\"border-right: #cccccc 1px solid;border-top: #cccccc 1px solid;background: #f7f7f7;border-left: #cccccc 1px solid;width: 90%;border-bottom: #cccccc 1px solid\">\n<tbody>\n<tr>\n<td><font>&lt;!&#8211; #BeginLibraryItem &#8220;\/library\/promotion_info.lbi&#8221; &#8211;&gt;<\/font><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> \u5728\u5b83\u7684\u524d\u9762\u589e\u52a0<br \/>\n <\/p>\n<table cellspacing=\"0\" cellpadding=\"5\" style=\"border-right: #cccccc 1px solid;border-top: #cccccc 1px solid;background: #f7f7f7;border-left: #cccccc 1px solid;width: 90%;border-bottom: #cccccc 1px solid\">\n<tbody>\n<tr>\n<td><font>&lt;!&#8211; #BeginLibraryItem &#8220;\/library\/top10_click.lbi&#8221; &#8211;&gt;&lt;!&#8211; #EndLibraryItem &#8211;&gt;<\/font><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> 4\uff09\u3001\u4fee\u6539 \/admin\/includes\/lib_template.php&nbsp;\u6587\u4ef6<\/p>\n<p> \u5728 <\/p>\n<table cellspacing=\"0\" cellpadding=\"5\" style=\"border-right: #cccccc 1px solid;border-top: #cccccc 1px solid;background: #f7f7f7;border-left: #cccccc 1px solid;width: 90%;border-bottom: #cccccc 1px solid\">\n<tbody>\n<tr>\n<td><font>&#8216;\/library\/invoice_query.lbi&#8217; =&gt; 0,<\/font><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> \u4e0a\u8fb9\u589e\u52a0\u4e00\u884c\u4ee3\u7801<br \/>\n <\/p>\n<table cellspacing=\"0\" cellpadding=\"5\" style=\"border-right: #cccccc 1px solid;border-top: #cccccc 1px solid;background: #f7f7f7;border-left: #cccccc 1px solid;width: 90%;border-bottom: #cccccc 1px solid\">\n<tbody>\n<tr>\n<td><font>&#8216;\/library\/top10_click.lbi&#8217; =&gt; 0,<\/font><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> 5\uff09\u3001\u7ee7\u7eed\u4fee\u6539\u8bed\u8a00\u5305\u6587\u4ef6&nbsp;&nbsp;\/languages\/zh_cn\/admin\/template.php&nbsp;<br \/>\n<br \/> \u5728 <\/p>\n<table cellspacing=\"0\" cellpadding=\"5\" style=\"border-right: #cccccc 1px solid;border-top: #cccccc 1px solid;background: #f7f7f7;border-left: #cccccc 1px solid;width: 90%;border-bottom: #cccccc 1px solid\">\n<tbody>\n<tr>\n<td><font>$_LANG[&#8216;template_libs&#8217;][&#8216;top10&#8217;] = &#8216;\u9500\u552e\u6392\u884c&#8217;;<\/font><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> \u4e0b\u8fb9\u589e\u52a0\u4e00\u884c\u4ee3\u7801<br \/>\n <\/p>\n<table cellspacing=\"0\" cellpadding=\"5\" style=\"border-right: #cccccc 1px solid;border-top: #cccccc 1px solid;background: #f7f7f7;border-left: #cccccc 1px solid;width: 90%;border-bottom: #cccccc 1px solid\">\n<tbody>\n<tr>\n<td><font>$_LANG[&#8216;template_libs&#8217;][&#8216;top10_click&#8217;] = &#8216;\u6d4f\u89c8\u6392\u884c&#8217;;<\/font><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> 6\uff09\u3001\u4fee\u6539&nbsp;&nbsp;\/themes\/default\/lib.xml&nbsp;\u6587\u4ef6<\/p>\n<p> \u627e\u5230 <\/p>\n<table cellspacing=\"0\" cellpadding=\"5\" style=\"border-right: #cccccc 1px solid;border-top: #cccccc 1px solid;background: #f7f7f7;border-left: #cccccc 1px solid;width: 90%;border-bottom: #cccccc 1px solid\">\n<tbody>\n<tr>\n<td><font>&lt;lib&gt;top10&lt;\/lib&gt;<\/font><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> \u5e76\u4e14\u5728\u5b83\u4e0b\u9762\u53e6\u8d77\u4e00\u884c\uff0c\u589e\u52a0 <\/p>\n<table cellspacing=\"0\" cellpadding=\"5\" style=\"border-right: #cccccc 1px solid;border-top: #cccccc 1px solid;background: #f7f7f7;border-left: #cccccc 1px solid;width: 90%;border-bottom: #cccccc 1px solid\">\n<tbody>\n<tr>\n<td><font>&lt;lib&gt;top10_click&lt;\/lib&gt;<\/font><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> &nbsp;7\uff09\u3001\u6700\u540e\u8fdb\u5165 \u540e\u53f0 \u300b\u6a21\u677f\u7ba1\u7406 \u300b\u8bbe\u7f6e\u6a21\u677f\uff0c \u662f\u4e0d\u662f\u770b\u5230\u4e86\u671f\u5f85\u5df2\u4e45\u7684\u201c\u6d4f\u89c8\u6392\u884c\u201d\uff0c\u8bbe\u7f6e\u4e00\u4e0b\uff0c\u5e76\u6e05\u9664\u7f13\u5b58\uff0c\u5c31OK\u4e86<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u6709\u770b\u5230\u670b\u53cb\u5728ECSHOP\u8bba\u575b&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-198996","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/198996","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=198996"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/198996\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=198996"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=198996"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=198996"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}