{"id":199325,"date":"2025-05-03T10:50:48","date_gmt":"2025-05-03T02:50:48","guid":{"rendered":"https:\/\/server.hk\/cnblog\/199325\/"},"modified":"2025-05-03T10:50:48","modified_gmt":"2025-05-03T02:50:48","slug":"ecshop%e5%90%8e%e5%8f%b0%e8%ae%be%e7%bd%ae%e6%a8%a1%e6%9d%bf%e6%8e%92%e5%ba%8f%e8%b0%83%e7%94%a8i%e5%8f%98%e9%87%8f%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/199325\/","title":{"rendered":"ecshop\u540e\u53f0\u8bbe\u7f6e\u6a21\u677f\u6392\u5e8f\u8c03\u7528$i\u53d8\u91cf\u65b9\u6cd5"},"content":{"rendered":"<p style=\"margin: 0px 0px 15px;font-size: 14px;line-height: 25px\"> \u8bbe\u7f6e\u6a21\u677f \u6392\u5e8f\u8c03\u7528\uff0c\u4ece&nbsp;<span>1<\/span>&nbsp;\u5f00\u59cb<br \/> 1\u3001admin\\includes\\lib_template.php<br \/> <span>$i = 1;&nbsp;&nbsp; &nbsp;\/\/by zuimoban<\/span><br \/> if ($result &amp;&amp; $result &gt; 0)<br \/> {<br \/> &nbsp;&nbsp; &nbsp;foreach ($lib_matches AS $k =&gt; $v)<br \/> &nbsp;&nbsp; &nbsp;<\/p>\n<p> <img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/140807\/0039232044-0.jpg\" class=\"aligncenter\"><\/p>\n<p style=\"margin: 0px 0px 15px;font-size: 14px;line-height: 25px\"> &nbsp;<\/p>\n<p style=\"margin: 0px 0px 15px;font-size: 14px;line-height: 25px\"> 2\u3001includes\\lib_goods.php<br \/> function assign_cat_goods($cat_id, $num = 0, $from = &#8216;web&#8217;, $order_rule = &#8221;)<br \/> \u6539\u6210<br \/> function assign_cat_goods($cat_id, $num = 0, $from = &#8216;web&#8217;, $order_rule = &#8221;<span>, $sort_order = 0<\/span>)&nbsp;&nbsp; &nbsp;\/\/by zuimoban<\/p>\n<p style=\"margin: 0px 0px 15px;font-size: 14px;line-height: 25px\"> \/* \u5206\u7c7b\u4fe1\u606f *\/<br \/> $sql = &#8216;SELECT cat_name FROM &#8216; . $GLOBALS[&#8216;ecs&#8217;]-&gt;table(&#8216;category&#8217;) . &#8221; WHERE cat_id = &#8216;$cat_id'&#8221;;<br \/> $cat[&#8216;name&#8217;] = $GLOBALS[&#8216;db&#8217;]-&gt;getOne($sql);<br \/> $cat[&#8216;url&#8217;]&nbsp; = build_uri(&#8216;category&#8217;, array(&#8216;cid&#8217; =&gt; $cat_id), $cat[&#8216;name&#8217;]);<br \/> $cat[&#8216;id&#8217;]&nbsp;&nbsp; = $cat_id;<br \/> <span>$cat[&#8216;i&#8217;]&nbsp;&nbsp; = $sort_order;&nbsp;&nbsp; &nbsp;\/\/by zuimoban<\/span><\/p>\n<p style=\"margin: 0px 0px 15px;font-size: 14px;line-height: 25px\"> return $cat;<\/p>\n<p style=\"margin: 0px 0px 15px;font-size: 14px;line-height: 25px\"> 3\u3001includes\\lib_main.php<br \/> \u67e5\u627e<br \/> function assign_dynamic($tmp)<br \/> \u627e\u5230\u91cc\u9762\u7684<br \/> $sql = &#8216;SELECT id, number, type FROM<br \/> \u6539\u6210<br \/> $sql = &#8216;SELECT id, number, type<span>, sort_order<\/span>&nbsp;FROM<\/p>\n<p style=\"margin: 0px 0px 15px;font-size: 14px;line-height: 25px\"> \u7ee7\u7eed\u627e\u5230<br \/> \/* \u5206\u7c7b\u4e0b\u7684\u5546\u54c1 *\/<br \/> $GLOBALS[&#8216;smarty&#8217;]-&gt;assign(&#8216;goods_cat_&#8217; . $row[&#8216;id&#8217;], assign_cat_goods($row[&#8216;id&#8217;], $row[&#8216;number&#8217;]));<br \/> \u6539\u6210<br \/> \/* \u5206\u7c7b\u4e0b\u7684\u5546\u54c1 *\/<\/p>\n<p style=\"margin: 0px 0px 15px;font-size: 14px;line-height: 25px\"> $GLOBALS[&#8216;smarty&#8217;]-&gt;assign(&#8216;goods_cat_&#8217; . $row[&#8216;id&#8217;], assign_cat_goods($row[&#8216;id&#8217;], $row[&#8216;number&#8217;]<span>, $from = &#8216;web&#8217;, $order_rule = &#8221;, $row[&#8216;sort_order&#8217;]<\/span>));<\/p>\n<p style=\"margin: 0px 0px 15px;font-size: 14px;line-height: 25px\"> &nbsp;<\/p>\n<p style=\"margin: 0px 0px 15px;font-size: 14px;line-height: 25px\"> \u8fd9\u6837 cat_goods.lbi&nbsp;\u91cc\u9762\u80fd\u4f7f\u7528 $goods_cat.i&nbsp;\u6392\u5e8f\u4e86 \u3002<\/p>\n<p style=\"margin: 0px 0px 15px;font-size: 14px;line-height: 25px\"> &nbsp;<\/p>\n<p style=\"margin: 0px 0px 15px;font-size: 14px;line-height: 25px\"> \u6548\u679c\uff1a<\/p>\n<p> <img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/140807\/0039232093-1.jpg\" class=\"aligncenter\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8bbe\u7f6e\u6a21\u677f \u6392\u5e8f\u8c03\u7528\uff0c\u4ece&#038;nbsp&#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-199325","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199325","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=199325"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199325\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=199325"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=199325"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=199325"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}