{"id":59941,"date":"2025-04-24T08:32:52","date_gmt":"2025-04-24T00:32:52","guid":{"rendered":"https:\/\/fwq.ai\/blog\/59941\/"},"modified":"2025-04-24T08:32:52","modified_gmt":"2025-04-24T00:32:52","slug":"ecshop%e5%a6%82%e4%bd%95%e5%9c%a8%e5%95%86%e5%93%81%e5%88%86%e7%b1%bb%e9%a1%b5%ef%bc%88category-dwt%ef%bc%89%e8%b0%83%e5%8f%96%e5%95%86%e5%93%81%e5%88%86-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/59941\/","title":{"rendered":"ecshop\u5982\u4f55\u5728\u5546\u54c1\u5206\u7c7b\u9875\uff08category.dwt\uff09\u8c03\u53d6\u5546\u54c1\u5206"},"content":{"rendered":"<p>1\u3001\u4fee\u6539category.php \u7684get_cat_info()\u51fd\u6570\u90e8\u5206\uff0c\u5728SQL\u8bed\u53e5\u4e2d\u52a0\u5165 cat_name\u5b57\u6bb5<br \/> \u5373\uff1a<\/p>\n<p>function get_cat_info($cat_id)<br \/> {<br \/> return $GLOBALS[&#8216;db&#8217;]-&gt;getRow(&#8216;SELECT cat_name,keywords, cat_desc, style, grade, filter_attr, parent_id FROM &#8216; . $GLOBALS[&#8216;ecs&#8217;]-&gt;table(&#8216;category&#8217;) .<br \/> &#8221; WHERE cat_id = &#8216;$cat_id'&#8221;);<br \/> }<\/p>\n<p>2\u3001\u5e76\u589e\u52a0\u4e0b\u9762\u4ee3\u7801<\/p>\n<p>$smarty-&gt;assign(&#8216;cat_name&#8217;,&nbsp; &nbsp;$cat[&#8216;cat_name&#8217;]);<\/p>\n<p> 3\u3001\u7136\u540e\u5728category.dwt\u4e2d\u8c03\u7528{$cat_name}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\u3001\u4fee\u6539category.php \u7684get_cat_info()\u51fd\u6570\u90e8\u5206\uff0c\u5728SQL\u8bed\u53e5\u4e2d\u52a0\u5165 cat_name\u5b57\u6bb5 \u5373\uff1a function get_cat_info($cat_id) { return $GLOBALS[&#8216;db&#8217;]-&gt;getRow(&#8216;SELECT cat_name,keywords, cat_desc, style, grade, filter_attr, parent_id FROM &#8216; . $GLOBALS[&#8216;ecs&#8217;]-&gt;table(&#8216;category&#8217;) . &#8221; WHERE cat_id = &#8216;$cat_id&#8217;&#8221;); } 2\u3001\u5e76\u589e\u52a0\u4e0b\u9762\u4ee3\u7801 $smarty-&gt;assign(&#8216;cat_name&#8217;,&nbsp; &nbsp;$cat[&#8216;cat_name&#8217;]); 3\u3001\u7136\u540e\u5728category.dwt\u4e2d\u8c03\u7528{$cat_name}<\/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-59941","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/59941","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=59941"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/59941\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=59941"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=59941"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=59941"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}