{"id":60339,"date":"2025-04-24T10:08:43","date_gmt":"2025-04-24T02:08:43","guid":{"rendered":"https:\/\/fwq.ai\/blog\/60339\/"},"modified":"2025-04-24T10:08:43","modified_gmt":"2025-04-24T02:08:43","slug":"ecshop%e5%88%86%e7%b1%bb%e9%a1%b5%e6%98%be%e7%a4%ba%e5%bd%93%e5%89%8d%e5%95%86%e5%93%81%e5%a4%9a%e5%9b%be%e7%9b%b8%e5%86%8c-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/60339\/","title":{"rendered":"ecshop\u5206\u7c7b\u9875\u663e\u793a\u5f53\u524d\u5546\u54c1\u591a\u56fe\u76f8\u518c"},"content":{"rendered":"<p> ecshop\u5206\u7c7b\u9875\u663e\u793a\u5f53\u524d\u5546\u54c1\u591a\u56fe\uff0c\u4fee\u6539\u8fc7\u540e\u7684\u6548\u679c\u56fe\uff1a<\/p>\n<p> <img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/150505\/09211aU7-0.jpg\" class=\"aligncenter\" title=\"ecshop\u5206\u7c7b\u9875\u663e\u793a\u5f53\u524d\u5546\u54c1\u591a\u56fe\u76f8\u518c\u63d2\u56fe\" alt=\"ecshop\u5206\u7c7b\u9875\u663e\u793a\u5f53\u524d\u5546\u54c1\u591a\u56fe\u76f8\u518c\u63d2\u56fe\" \/><\/p>\n<p> &nbsp;<br \/> \u7b2c1\u6b65\uff1a\u627e\u5230\u6839\u76ee\u5f55\u7684category.php\u6587\u4ef6\uff0c\u67e5\u627e\u7ea6\uff1a486\u884c\u5de6\u53f3\uff08\u6ce8\u610f\u8fd9\u4e0d\u662f\u51c6\u786e\u4f4d\u7f6e\uff0c\u770b\u5b9e\u9645\u7684\u54e6\uff09\uff0c\u627e\u5230\u8fd9\u4e2a\u51fd\u6570\uff1a<br \/> &nbsp;<br \/> \/**<br \/> &nbsp;* \u83b7\u5f97\u5206\u7c7b\u4e0b\u7684\u5546\u54c1<br \/> &nbsp;*<br \/> &nbsp;* @access&nbsp; public<br \/> &nbsp;* @param&nbsp;&nbsp; string&nbsp; $children<br \/> &nbsp;* @return&nbsp; array<br \/> &nbsp;*\/<br \/> function category_get_goods($children, $brand, $min, $max, $ext, $size, $page, $sort, $order)<br \/> \u2026\u2026\u4ee5\u4e0b\u4ee3\u7801\u7701\u7565\u3002<br \/> &nbsp;<br \/> \u7136\u540e\u5728\u8fd9\u4e2a\u51fd\u6570\u91cc\u7684\uff1a<br \/> &nbsp;<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($watermark_img != &#8221;)<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $arr[$row[&#8216;goods_id&#8217;]][&#8216;watermark_img&#8217;] =&nbsp; $watermark_img;<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br \/> &nbsp;<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $arr[$row[&#8216;goods_id&#8217;]][&#8216;goods_id&#8217;]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = $row[&#8216;goods_id&#8217;];<br \/> &nbsp;<br \/> \u4e0b\u9762\u4e00\u884c\u589e\u52a0\u4e00\u6bb5\u4ee3\u7801\uff1a<br \/> &nbsp;<br \/> \/\/\u8c03\u7528\u7f29\u7565\u56fe 2014-05-26 11:24:12<br \/> $gid =&nbsp; $row[&#8216;goods_id&#8217;];<br \/> $sqlg = &#8220;SELECT img_url,thumb_url FROM &#8221; . $GLOBALS[&#8216;ecs&#8217;]-&gt;table(&#8216;goods_gallery&#8217;) .&#8221; WHERE goods_id = &#8220;.$gid;<br \/> $ggres2 = $GLOBALS[&#8216;db&#8217;]-&gt;getAll($sqlg);<br \/> \/\/print_r($ggres2);<br \/> &nbsp;<br \/> \u610f\u601d\u5c31\u662f\uff1a\u901a\u8fc7\u5217\u8868\u7684\u5546\u54c1ID\u53f7\uff0c\u67e5\u627e\u5bf9\u5e94\u7684\u5546\u54c1\u76f8\u518c\u91cc\u7684\u7f29\u7565\u56fe\u96c6\uff0c\u8fd4\u56de\u7684\u5e94\u8be5\u662f\u4e00\u4e2a\u56fe\u7247\u5730\u5740\u6570\u7ec4\uff01<br \/> &nbsp;<br \/> \u627e\u5230\uff1a<br \/> &nbsp;<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $arr[$row[&#8216;goods_id&#8217;]][&#8216;goods_img&#8217;]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = get_image_path($row[&#8216;goods_id&#8217;], $row[&#8216;goods_img&#8217;]);<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $arr[$row[&#8216;goods_id&#8217;]][&#8216;url&#8217;]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = build_uri(&#8216;goods&#8217;, array(&#8216;gid&#8217;=&gt;$row[&#8216;goods_id&#8217;]), $row[&#8216;goods_name&#8217;]);<br \/> &nbsp;<br \/> \u7d27\u8ddf\u7740\u52a0\u4e0a\u4e00\u53e5\u4ee3\u7801\uff1a<br \/> &nbsp;<br \/> &nbsp;&nbsp; $arr[$row[&#8216;goods_id&#8217;]][&#8216;gpic&#8217;]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = $ggres2;<br \/> &nbsp;<br \/> \u5269\u4e0b\u7684\u5c31\u662f\u6a21\u677f\u91cc\u8c03\u7528\u3002<br \/> &nbsp;<br \/> \u7b2c2\u6b65\uff1a\u4fee\u6539\u5e93\u6587\u4ef6 library\/goods_list.lbi\u3002<br \/> &nbsp;<br \/> \u5728\u8fd9\u4e2a\u6587\u4ef6\u91cc\uff0c\u627e\u5230\u9700\u8981\u8c03\u7528\u5546\u54c1\u76f8\u518c\u5c0f\u56fe\u7247\u7684\u4f4d\u7f6e\uff0c\u8fd9\u6837\u8c03\u7528\u5373\u53ef\uff1a<br \/> &nbsp;<br \/> &lt;!&#8211; {foreach from=$goods.gpic item=picture name=no}&#8211;&gt;&nbsp;<br \/> &lt;!&#8211; {if $smarty.foreach.no.iteration &lt; 5}&nbsp; &#8211;&gt;<br \/> &lt;img src=&#8221;{if $picture.thumb_url}{$picture.thumb_url}{else}{$picture.img_url}{\/if}&#8221; width=&#8221;30&#8243; alt=&#8221;{$goods.goods_name}&#8221; data-s=&#8221;{if $picture.thumb_url}{$picture.thumb_url}{else}{$picture.img_url}{\/if}&#8221; \/&gt;<br \/> &lt;!&#8211;{\/if}&#8211;&gt;&nbsp;&nbsp;<br \/> &lt;!&#8211;{\/foreach}&#8211;&gt;&nbsp;<br \/> &nbsp;<br \/> \u8fd9\u91cc\u7528\u201c{if $smarty.foreach.no.iteration &lt; 5}\u201d\u6765\u9650\u5b9a\u4e86\u8c03\u7528\u6570\u91cf\u6700\u591a\u662f4\u4e2a\uff0c\u9700\u8981\u7684\u670b\u53cb\u53ef\u4fee\u6539\u8fd9\u4e2a\u6570\u5b57\u5373\u53ef\u3002<br \/> &nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ecshop\u5206\u7c7b\u9875\u663e\u793a\u5f53\u524d\u5546\u54c1\u591a\u56fe\uff0c\u4fee\u6539\u8fc7\u540e\u7684\u6548\u679c\u56fe\uff1a &nbsp; \u7b2c1\u6b65\uff1a\u627e\u5230\u6839\u76ee\u5f55\u7684category.php\u6587\u4ef6\uff0c\u67e5\u627e\u7ea6\uff1a486\u884c\u5de6\u53f3\uff08\u6ce8\u610f\u8fd9\u4e0d\u662f\u51c6\u786e\u4f4d\u7f6e\uff0c\u770b\u5b9e\u9645\u7684\u54e6\uff09\uff0c\u627e\u5230\u8fd9\u4e2a\u51fd\u6570\uff1a &nbsp; \/** &nbsp;* \u83b7\u5f97\u5206\u7c7b\u4e0b\u7684\u5546\u54c1 &nbsp;* &nbsp;* @access&nbsp; public &nbsp;* @param&nbsp;&nbsp; string&nbsp; $children &nbsp;* @return&nbsp; array &nbsp;*\/ function category_get_goods($children, $brand, $min, $max, $ext, $size, $page, $sort, $order) \u2026\u2026\u4ee5\u4e0b\u4ee3\u7801\u7701\u7565\u3002 &nbsp; \u7136\u540e\u5728\u8fd9\u4e2a\u51fd\u6570\u91cc\u7684\uff1a &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($watermark_img != &#8221;) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $arr[$row[&#8216;goods_id&#8217;]][&#8216;watermark_img&#8217;] =&nbsp; $watermark_img; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $arr[$row[&#8216;goods_id&#8217;]][&#8216;goods_id&#8217;]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = $row[&#8216;goods_id&#8217;]; &nbsp; \u4e0b\u9762\u4e00\u884c\u589e\u52a0\u4e00\u6bb5\u4ee3\u7801\uff1a &nbsp; \/\/\u8c03\u7528\u7f29\u7565\u56fe [&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-60339","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/60339","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=60339"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/60339\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=60339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=60339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=60339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}