{"id":199590,"date":"2025-05-03T12:25:34","date_gmt":"2025-05-03T04:25:34","guid":{"rendered":"https:\/\/server.hk\/cnblog\/199590\/"},"modified":"2025-05-03T12:25:34","modified_gmt":"2025-05-03T04:25:34","slug":"ecshop%e5%95%86%e5%93%81%e5%ad%97%e6%ae%b5%e5%a2%9e%e5%8a%a0%e6%96%b0%e5%ad%97%e6%ae%b5%e7%9a%84%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/199590\/","title":{"rendered":"ecshop\u5546\u54c1\u5b57\u6bb5\u589e\u52a0\u65b0\u5b57\u6bb5\u7684\u65b9\u6cd5"},"content":{"rendered":"<p> \u7ed3\u5408ecshop\u540e\u53f0\u201c\u5546\u54c1\u7f16\u8f91\u201d\u3001\u201c\u5546\u54c1\u5f55\u5165\u201d\u6765\u8c08\u8c08\u5982\u4f55\u7ed9ecshop\u5546\u54c1\u589e\u52a0\u4e00\u4e2a\u65b0\u5b57\u6bb5\uff0c\u5047\u8bbe\u6211\u4eec\u5c06\u8fd9\u4e2a\u65b0\u5b57\u6bb5\u547d\u540d\u4e3a new_add<\/p>\n<p> 1\u3001\u9996\u5148\u8981\u4fee\u6539\u6570\u636e\u8868\u7ed3\u6784\uff0c\u7ed9\u8868 ecs_goods \u589e\u52a0\u65b0\u5b57\u6bb5\uff1anew_add\uff0c<br \/> \u8fdb\u5165ECSHOP\u540e\u53f0 \u300b\u6570\u636e\u5e93\u7ba1\u7406 \u300bSQL\u67e5\u8be2\uff0c\u8f93\u5165\u4e0b\u9762SQL\u8bed\u53e5\uff0c\u63d0\u4ea4\u3002\u6ce8\u610f\u5982\u679c\u4f60\u7684\u6570\u636e\u8868\u524d\u7f00\u4e0d\u662fecs_ \u8bf7\u81ea\u884c\u4fee\u6539\u4e4b<\/p>\n<p> alter table ecs_goods add column new_add varchar(64);<\/p>\n<p> 2\u3001\u5728ecshop\u540e\u53f0\u7684admin\\templates\\goods_info.htm\u4e2d\u589e\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff0e<\/p>\n<p> &lt;tr&gt;<br \/> &lt;td class=&#8221;label&#8221;&gt;\u81ea\u5b9a\u4e49\u5b57\u6bb5&lt;\/td&gt;<br \/> &lt;td&gt;&lt;input type=&#8221;text&#8221; name=&#8221;new_add&#8221; value=&#8221;{$goods.new_add}&#8221; size=&#8221;20&#8243;\/&gt;<br \/> &lt;\/td&gt;<br \/> &lt;\/tr&gt;<\/p>\n<p> 3\u3001\u5728admin\/goods.php\u7684elseif ($_REQUEST[&#8216;act&#8217;] == &#8216;insert&#8217; || $_REQUEST[&#8216;act&#8217;] == &#8216;update&#8217;)\u91cc\u9762\u589e\u52a0\u4ee5\u4e0b\u7a0b\u5e8f<\/p>\n<p> \/\/\u65b0\u6570\u636e<br \/> $sql = &#8220;INSERT INTO &#8221; . $ecs-&gt;table(&#8216;goods&#8217;) . &#8221; (goods_name, goods_name_style, goods_sn, &#8221; .<br \/> &#8220;cat_id, brand_id, shop_price, market_price, is_promote, promote_price, &#8221; .<br \/> &#8220;promote_start_date, promote_end_date, goods_img, goods_thumb, original_img, keywords, goods_brief, &#8221; .<br \/> &#8220;seller_note, goods_weight, goods_number, warn_number, integral, give_integral, is_best, is_new, is_hot, &#8221; .<br \/> &#8220;is_on_sale, is_alone_sale, is_shipping, goods_desc, add_time, last_update, goods_type, rank_integral, suppliers_id,new_add)&#8221; .<br \/> &#8220;VALUES (&#8216;$_POST[goods_name]&#8217;, &#8216;$goods_name_style&#8217;, &#8216;$goods_sn&#8217;, &#8216;$catgory_id&#8217;, &#8221; .<br \/> &#8220;&#8216;$brand_id&#8217;, &#8216;$shop_price&#8217;, &#8216;$market_price&#8217;, &#8216;$is_promote&#8217;,&#8217;$promote_price&#8217;, &#8220;.<br \/> &#8220;&#8216;$promote_start_date&#8217;, &#8216;$promote_end_date&#8217;, &#8216;$goods_img&#8217;, &#8216;$goods_thumb&#8217;, &#8216;$original_img&#8217;, &#8220;.<br \/> &#8220;&#8216;$_POST[keywords]&#8217;, &#8216;$_POST[goods_brief]&#8217;, &#8216;$_POST[seller_note]&#8217;, &#8216;$goods_weight&#8217;, &#8216;$goods_number&#8217;,&#8221;.<br \/> &#8221; &#8216;$warn_number&#8217;, &#8216;$_POST[integral]&#8217;, &#8216;$give_integral&#8217;, &#8216;$is_best&#8217;, &#8216;$is_new&#8217;, &#8216;$is_hot&#8217;, &#8216;$is_on_sale&#8217;, &#8216;$is_alone_sale&#8217;, $is_shipping, &#8220;.<br \/> &#8221; &#8216;$_POST[goods_desc]&#8217;, &#8216;&#8221; . gmtime() . &#8220;&#8216;, &#8216;&#8221;. gmtime() .&#8221;&#8216;, &#8216;$goods_type&#8217;, &#8216;$rank_integral&#8217;, &#8216;$suppliers_id&#8217;,&#8217;$_POST[new_add]&#8217;)&#8221;;<\/p>\n<p> \/\/\u4e0b\u9762\u8fd9\u4e2a\u4e3a\u66f4\u65b0\uff0c\u5728\uff1a<\/p>\n<p> $sql = &#8220;UPDATE &#8221; . $ecs-&gt;table(&#8216;goods&#8217;) . &#8221; SET &#8221; .<br \/> &#8220;goods_name = &#8216;$_POST[goods_name]&#8217;, &#8221; .<br \/> &#8220;goods_name_style = &#8216;$goods_name_style&#8217;, &#8221; .<\/p>\n<p> \u4e0b\u9762\u52a0<\/p>\n<p> &#8221; new_add = &#8216;$_POST[new_add]&#8217;, &#8221; .<\/p>\n<p> \u8fd9\u6837\u6211\u4eec\u5c31\u5b8c\u6210\u4e86\u5728ECSHOP\u540e\u53f0\u5f55\u5165\u548c\u4fee\u6539\u65b0\u5b57\u6bb5\u7684\u529f\u80fd\u4e86\u3002<\/p>\n<p> \u4e0b\u9762\u518d\u6765\u8bf4\u4e00\u4e0b\u524d\u53f0\u8c03\u7528\u7684\u65b9\u6cd5\uff1a<\/p>\n<p> \u8c03\u7528\u4e5f\u5f88\u7b80\u5355\uff0c\u76f4\u63a5\u5728\u6a21\u677f\u6587\u4ef6\u6216\u8005 lbi\u6587\u4ef6\u91cc \u8fd9\u4e48\u8c03\u7528\u5373\u53ef&nbsp;{$goods.new_add}<\/p>\n<p> &nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7ed3\u5408ecshop\u540e\u53f0\u201c\u5546\u54c1\u7f16\u8f91\u201d&#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-199590","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199590","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=199590"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199590\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=199590"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=199590"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=199590"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}