{"id":60749,"date":"2025-04-26T10:19:23","date_gmt":"2025-04-26T02:19:23","guid":{"rendered":"https:\/\/fwq.ai\/blog\/60749\/"},"modified":"2025-04-26T10:19:23","modified_gmt":"2025-04-26T02:19:23","slug":"%e8%87%aa%e5%ae%9a%e4%b9%89zencart%e8%ae%a2%e5%8d%95%e5%8f%b7%e7%a0%81","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/60749\/","title":{"rendered":"\u81ea\u5b9a\u4e49zencart\u8ba2\u5355\u53f7\u7801"},"content":{"rendered":"<p>\u4fee\u6b63zencart\u8ba2\u5355\u53f7\u7801\u6709\u4e24\u79cd\u65b9\u6cd5\uff0c\u699c\u9996\u4e2a\u662f\u4f7f\u7528\u540e\u53f0store manger\u53bb\u8bbe\u7f6e\uff0c\u7b2c\u4e8c\u4e2a\u662f\u4fee\u6b63\u6587\u4ef6includes\/classes\/order.php\u30022\u79cd\u65b9\u6cd5\u7686\u6709\u7528\uff0c\u4e0b\u9762\u6765\u8bb2\u8bb2\u600e\u4e48\u8bbe\u7f6e\uff1a   \u9996\u8981\u699c\u9996\u79cd\u65b9\u6cd5\uff1a\u8fdb\u5165\u540e\u53f0&#8212;Tools&#8212;Store Manager&#8212;Set next order number \u8fd9\u4e2a\u5f53\u5730\u6709\u4e00\u4e2a\u6587\u672c\u6846\uff0c\u91cc\u8fb9\u586b\u4e0a\u4f60\u4e0b\u4e00\u4e2a\u8ba2\u5355\u53f7\u7684\u53f7\u7801\u5c31\u53ef\u4ee5\uff0c\u4f46\u662f\u4e00\u5b9a\u8981\u9075\u4ece\u53f7\u7801\u7684\u89c4\u77e9\uff0c\u6bd4\u5982\uff1a\u4f60\u5f53\u65f6\u6700\u7ec8\u4e00\u4e2a\u8ba2\u5355\u7684\u53f7\u7801\u662f3\uff0c\u90a3\u4e48\u4e0b\u4e00\u4e2a\u8ba2\u5355\u53f7\u7801\u5c31\u53ef\u4ee5\u8bbe\u7f6e\u4e3a20130004\uff0c\u70b9\u51fbreset\u5c31\u53ef\u4ee5\u8bbe\u7f6e\u6210\u529f\uff0c\u53bb\u524d\u53f0\u53bb\u4e0b\u5355\u4e00\u4e2a\u4ea7\u54c1\u5c31\u53ef\u4ee5\u770b\u5230\u4f5c\u7528\u3002   \u7b2c\u4e8c\u79cd\u65b9\u6cd5\uff1a\u4fee\u6b63\u6587\u4ef6 &nbsp;includes\/classes\/order.php \uff08\u8fd9\u4e2a\u65b9\u6cd5\u7684\u957f\u5904\u662f\u53ef\u4ee5\u83b7\u53d6\u4e0b\u5355\u7684\u65e5\u671f\uff09   \u200b\u641c\u7d22\uff1a   &nbsp;   function create($zf_ot_modules, $zf_mode = 2) { &nbsp;&nbsp;   &nbsp; &nbsp; global $db; &nbsp;   \u5728\u5176\u4e0b\u9762\u63d2\u5165\uff1a   &nbsp;   $t1 = date(&#8220;Ymd&#8221;); &nbsp;&nbsp;   &nbsp; &nbsp; srand ((float) microtime() * 10000000); &nbsp;&nbsp;   &nbsp; &nbsp; $input = array (&#8220;1&#8221;, &#8220;2&#8221;, &#8220;3&#8221;, &#8220;4&#8221;, &#8220;5&#8221;, &#8220;6&#8221;, &#8220;7&#8221;, &#8220;8&#8221;, &#8220;9&#8221;, &#8220;0&#8221;); &nbsp;&nbsp;   &nbsp; &nbsp; $rand_keys = array_rand ($input, 2); &nbsp;&nbsp;   &nbsp; &nbsp; \/\/$t1 = $input[$rand_keys[0]]; &nbsp;&nbsp;   &nbsp; &nbsp; $t2 = $input[$rand_keys[1]]; &nbsp;&nbsp;   &nbsp; &nbsp; $t3 = rand(0,9); &nbsp;&nbsp;   &nbsp; &nbsp; $ordernum = $t1.$t2.$t3; &nbsp;   \u63a5\u7740\u627e\u5230\uff1a   &nbsp;   $sql_data_array = array(&#8216;customers_id&#8217; =&gt; $_SESSION[&#8216;customer_id&#8217;], &nbsp;   \u5728\u5176\u4e0b\u9762\u63d2\u5165\u4e00\u884c\uff1a   &nbsp;   &#8216;orders_id&#8217; =&gt; $ordernum, &nbsp;   &nbsp;   &nbsp;   &nbsp;   \u7136\u540e\u627e\u5230   &nbsp;   zen_db_perform(TABLE_ORDERS, $sql_data_array); &nbsp;   &nbsp;   &nbsp;   \u5c06\u5176\u4e0b\u9762\u4e00\u884c\u7684\u4ee3\u7801\u4fee\u6539\u4e3a   &nbsp;   $insert_id = $ordernum; &nbsp;&nbsp;   &nbsp;   &nbsp;   \u6700\u540e\uff0c\u53bb\u7f51\u7ad9\u524d\u53f0\u4e0b\u5355\u5c31\u53ef\u4ee5\u770b\u5230\u6548\u679c\u3002  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4fee\u6b63zencart\u8ba2\u5355\u53f7\u7801\u6709\u4e24\u79cd\u65b9\u6cd5\uff0c\u699c\u9996\u4e2a\u662f\u4f7f\u7528\u540e\u53f0store manger\u53bb\u8bbe\u7f6e\uff0c\u7b2c\u4e8c\u4e2a\u662f\u4fee\u6b63\u6587\u4ef6includes\/classes\/order.php\u30022\u79cd\u65b9\u6cd5\u7686\u6709\u7528\uff0c\u4e0b\u9762\u6765\u8bb2\u8bb2\u600e\u4e48\u8bbe\u7f6e\uff1a \u9996\u8981\u699c\u9996\u79cd\u65b9\u6cd5\uff1a\u8fdb\u5165\u540e\u53f0&#8212;Tools&#8212;Store Manager&#8212;Set next order number \u8fd9\u4e2a\u5f53\u5730\u6709\u4e00\u4e2a\u6587\u672c\u6846\uff0c\u91cc\u8fb9\u586b\u4e0a\u4f60\u4e0b\u4e00\u4e2a\u8ba2\u5355\u53f7\u7684\u53f7\u7801\u5c31\u53ef\u4ee5\uff0c\u4f46\u662f\u4e00\u5b9a\u8981\u9075\u4ece\u53f7\u7801\u7684\u89c4\u77e9\uff0c\u6bd4\u5982\uff1a\u4f60\u5f53\u65f6\u6700\u7ec8\u4e00\u4e2a\u8ba2\u5355\u7684\u53f7\u7801\u662f3\uff0c\u90a3\u4e48\u4e0b\u4e00\u4e2a\u8ba2\u5355\u53f7\u7801\u5c31\u53ef\u4ee5\u8bbe\u7f6e\u4e3a20130004\uff0c\u70b9\u51fbreset\u5c31\u53ef\u4ee5\u8bbe\u7f6e\u6210\u529f\uff0c\u53bb\u524d\u53f0\u53bb\u4e0b\u5355\u4e00\u4e2a\u4ea7\u54c1\u5c31\u53ef\u4ee5\u770b\u5230\u4f5c\u7528\u3002 \u7b2c\u4e8c\u79cd\u65b9\u6cd5\uff1a\u4fee\u6b63\u6587\u4ef6 &nbsp;includes\/classes\/order.php \uff08\u8fd9\u4e2a\u65b9\u6cd5\u7684\u957f\u5904\u662f\u53ef\u4ee5\u83b7\u53d6\u4e0b\u5355\u7684\u65e5\u671f\uff09 \u200b\u641c\u7d22\uff1a &nbsp; function create($zf_ot_modules, $zf_mode = 2) { &nbsp;&nbsp; &nbsp; &nbsp; global $db; &nbsp; \u5728\u5176\u4e0b\u9762\u63d2\u5165\uff1a &nbsp; $t1 = date(&#8220;Ymd&#8221;); &nbsp;&nbsp; &nbsp; &nbsp; srand ((float) microtime() * 10000000); &nbsp;&nbsp; &nbsp; &nbsp; $input = array (&#8220;1&#8221;, &#8220;2&#8221;, &#8220;3&#8221;, &#8220;4&#8221;, &#8220;5&#8221;, &#8220;6&#8221;, &#8220;7&#8221;, &#8220;8&#8221;, &#8220;9&#8221;, &#8220;0&#8221;); &nbsp;&nbsp; [&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-60749","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/60749","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=60749"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/60749\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=60749"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=60749"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=60749"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}