{"id":199101,"date":"2025-05-03T11:27:48","date_gmt":"2025-05-03T03:27:48","guid":{"rendered":"https:\/\/server.hk\/cnblog\/199101\/"},"modified":"2025-05-03T11:27:48","modified_gmt":"2025-05-03T03:27:48","slug":"ecshop%e5%95%86%e5%93%81%e8%af%a6%e6%83%85%e9%a1%b5%e6%b7%bb%e5%8a%a0%e4%bb%bb%e6%84%8f%e5%ad%97%e6%ae%b5%e7%9a%84%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/199101\/","title":{"rendered":"ecshop\u5546\u54c1\u8be6\u60c5\u9875\u6dfb\u52a0\u4efb\u610f\u5b57\u6bb5\u7684\u65b9\u6cd5"},"content":{"rendered":"<p>&nbsp;\u4e00\u3001\u5728<span>\u6570\u636e\u5e93<\/span>\u6dfb\u52a0\u5b57\u6bb5\uff0c\u4f1a\u624b\u5199\u7684\u5c31<span>\u540e\u53f0<\/span>\u6dfb\u52a0\uff0c\u4e0d\u4f1a\u5c31\u8fdb\u5165phpmyadmin\u9ed8\u8ba4\u7684\u5c31\u884c\u3002<br \/> &nbsp; &nbsp;&nbsp; &nbsp;\u8fd9\u662f\u901a\u7528\u7684\u5199\u6cd5<\/p>\n<ol>\n<li>ALTER TABLE `ecs_goods` ADD `goods_sz` VARCHAR( 32 ) NOT NULL AFTER `goods_weight` ;<\/li>\n<\/ol>\n<p><em>\u590d\u5236<span>\u4ee3\u7801<\/span><\/em>  <\/p>\n<p>\u8868\u540d\u505a\u4e0b\u4fee\u6539\u5373\u53ef\u3002<br \/> \u4e8c\u3001\u4fee\u6539admin\/good.php<br \/> &nbsp; &nbsp;&nbsp; &nbsp;\u627e\u5230<br \/> &nbsp; &nbsp;<\/p>\n<ol>\n<li>\/* \u5904\u7406\u5546\u54c1<span>\u6570\u636e<\/span> *\/<\/li>\n<li>$shop_price = !empty($_POST[&#8216;shop_price&#8217;]) ? $_POST[&#8216;shop_price&#8217;] : 0;<\/li>\n<\/ol>\n<p><em>\u590d\u5236\u4ee3\u7801<\/em>  <\/p>\n<p> &nbsp; &nbsp;&nbsp; &nbsp; \u540e\u9762\u4f9d\u846b\u82a6\u753b\u74e2\u6dfb\u52a0\u8fd1\u81ea\u5df1\u5b57\u6bb5\u3002<br \/> &nbsp; &nbsp;&nbsp; &nbsp;\u627e\u5230<\/p>\n<ol>\n<li>\/* \u5165\u5e93 *\/<\/li>\n<li>if ($is_insert)<\/li>\n<li>{<\/li>\n<li>if ($code == &#8221;)<\/li>\n<\/ol>\n<p><em>\u590d\u5236\u4ee3\u7801<\/em>  <\/p>\n<p> &nbsp; &nbsp;&nbsp; &nbsp;\u540c\u6837\u4f9d\u846b\u82a6\u753b\u74e2\u6dfb\u52a0\u8fd1\u81ea\u5df1\u5b57\u6bb5\uff0c<br \/> &nbsp; &nbsp;&nbsp;&nbsp;\u627e\u5230<\/p>\n<ol>\n<li>&#8220;goods_weight = &#8216;$goods_weight&#8217;,&#8221; .<\/li>\n<\/ol>\n<p><em>\u590d\u5236\u4ee3\u7801<\/em>  <\/p>\n<p>\u540c\u6837\u4f9d\u846b\u82a6\u753b\u74e2\u6dfb\u52a0\u8fd1\u81ea\u5df1\u5b57\u6bb5\u3002<br \/> \u4e09\u3001\u4fee\u6539admin\/templates\/goods_info.htm<br \/> &nbsp; &nbsp;&nbsp;&nbsp;\u5728\u5408\u9002\u7684\u5730\u65b9\u6dfb\u52a0\uff0c\u5982\u679c\u60f3\u5728\u7f16\u8f91\u5546\u54c1\u2014\u5176\u4ed6\u4fe1\u606f\u5904\u6dfb\u52a0\uff0c\u627e\u5230<\/p>\n<ol>\n<li>{if $code eq &#8221;}<\/li>\n<li>&lt;tr&gt;<\/li>\n<li>&lt;td class=&#8221;label&#8221;&gt;{$lang.lab_goods_weight}&lt;\/td&gt;<\/li>\n<li>&lt;td&gt;&lt;input type=&#8221;text&#8221; name=&#8221;goods_weight&#8221; value=&#8221;{$goods.goods_weight_by_unit}&#8221; size=&#8221;20&#8243; \/&gt; &lt;select name=&#8221;weight_unit&#8221;&gt;{html_options options=$unit_list selected=$weight_unit}&lt;\/select&gt;&lt;\/td&gt;<\/li>\n<li>&lt;\/tr&gt; <\/li>\n<li>{\/if}<\/li>\n<\/ol>\n<p><em>\u590d\u5236\u4ee3\u7801<\/em>  <\/p>\n<p>\u6dfb\u52a0<\/p>\n<ol>\n<li>&lt;tr&gt;<\/li>\n<li>&lt;td class=&#8221;label&#8221;&gt;{$lang.lab_goods_sz}&lt;\/td&gt;<\/li>\n<li>&lt;td&gt;&lt;input type=&#8221;text&#8221; name=&#8221;goods_sz&#8221; value=&#8221;{$goods.goods_sz}&#8221; size=&#8221;20&#8243; \/&gt; &lt;\/td&gt;<\/li>\n<li>&lt;\/tr&gt;<\/li>\n<\/ol>\n<p><em>\u590d\u5236\u4ee3\u7801<\/em>  <\/p>\n<p> \u56db\u3001\u4fee\u6539<span>\u6a21\u677f<\/span>\u5728\u5408\u9002\u7684\u5730\u65b9\u6dfb\u52a0\uff1a\u5982\u679c\u60f3\u5728\u5546\u54c1\u91cd\u91cf\u4e0b\u6dfb\u52a0\u67e5\u627e<\/p>\n<ol>\n<li>{$goods.goods_weight}<\/li>\n<\/ol>\n<p><em>\u590d\u5236\u4ee3\u7801<\/em>  <\/p>\n<p>\u5728\u4e0b\u9762\u6dfb\u52a0<\/p>\n<ol>\n<li>{$lang.goods_sz}{$goods.goods_sz}<\/li>\n<\/ol>\n<p><em>\u590d\u5236\u4ee3\u7801<\/em>  <\/p>\n<p>\u81ea\u5df1\u4fee\u6539\u76f8\u5e94\u5b57\u6bb5\u3002<br \/> \u4e94\u3001\u57fa\u672c\u5230\u4f4d\uff0c\u4e0b\u9762\u5c31\u662f\u4fee\u6539\u4e0b\u8bed\u8a00\u9879\uff0c\u4e0d\u60f3\u4fee\u6539\u4e5f\u53ef\u4ee5\uff0c\u5c06{$lang.goods_sz}\u3001{$lang.lab_goods_sz}\u6539\u6210\u81ea\u5df1\u9700\u8981\u7684\u4e2a\u6c49\u5b57\u5373\u53ef\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;\u4e00\u3001\u5728\u6570\u636e\u5e93\u6dfb\u52a0\u5b57\u6bb5&#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-199101","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199101","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=199101"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199101\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=199101"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=199101"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=199101"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}