{"id":199158,"date":"2025-05-03T13:16:17","date_gmt":"2025-05-03T05:16:17","guid":{"rendered":"https:\/\/server.hk\/cnblog\/199158\/"},"modified":"2025-05-03T13:16:17","modified_gmt":"2025-05-03T05:16:17","slug":"%e5%a6%82%e4%bd%95%e5%88%a0%e9%99%a4ecshop%e5%90%8e%e5%8f%b0%e5%8d%87%e7%ba%a7%e6%9c%89%e6%96%87%e4%bb%b6%e6%9c%aa%e5%88%a0%e9%99%a4%e7%ad%89%e7%9a%84%e6%8f%90%e7%a4%ba","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/199158\/","title":{"rendered":"\u5982\u4f55\u5220\u9664ecshop\u540e\u53f0\u5347\u7ea7,\u6709\u6587\u4ef6\u672a\u5220\u9664\u7b49\u7684\u63d0\u793a"},"content":{"rendered":"<p>\u6709\u5ba2\u6237\u95ee\u5230\u60f3\u53bb\u6389ecshop\u540e\u53f0\u5347\u7ea7\u7684\u63d0\u793a\uff0c\u56e0\u4e3a\u4e0a\u534a\u5e74\u5347\u7ea7\u63d0\u793a\u592a\u9891\u7e41\u4e86\uff0c\u89c9\u5f97\u4e0d\u9700\u8981\u8fd9\u4e2a\uff0c\u8fd9\u91cc\u597d\u6a21\u677f\u544a\u8bc9\u5927\u5bb6\u4fee\u6539\u65b9\u6cd5\uff0c<\/p>\n<p>\u627e\u5230admin\/index.php&nbsp; \u4ee3\u7801\uff1a<\/p>\n<p>\u5927\u6982486\u884c\uff1a<\/p>\n<p>elseif ($_REQUEST[&#8216;act&#8217;] == &#8216;main_api&#8217;)<br \/> {<br \/> &nbsp;&nbsp;&nbsp; require_once(ROOT_PATH . &#8216;\/includes\/lib_base.php&#8217;);<br \/> &nbsp;&nbsp;&nbsp; $data = read_static_cache(&#8216;api_str&#8217;);<\/p>\n<p>&nbsp;&nbsp;&nbsp; if($data === false || API_TIME &lt; date(&#8216;Y-m-d H:i:s&#8217;,time()-43200))<br \/> &nbsp;&nbsp;&nbsp; {<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; include_once(ROOT_PATH . &#8216;includes\/cls_transport.php&#8217;);<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ecs_version = VERSION;<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ecs_lang = $_CFG[&#8216;lang&#8217;];<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ecs_release = RELEASE;<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $php_ver = PHP_VERSION;<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $mysql_ver = $db-&gt;version();<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $order[&#8216;stats&#8217;] = $db-&gt;getRow(&#8216;SELECT COUNT(*) AS oCount, IFNULL(SUM(order_amount), 0) AS oAmount&#8217; .<br \/> &nbsp;&nbsp;&nbsp; &#8216; FROM &#8216; .$ecs-&gt;table(&#8216;order_info&#8217;));<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ocount = $order[&#8216;stats&#8217;][&#8216;oCount&#8217;];<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $oamount = $order[&#8216;stats&#8217;][&#8216;oAmount&#8217;];<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $goods[&#8216;total&#8217;]&nbsp;&nbsp; = $db-&gt;GetOne(&#8216;SELECT COUNT(*) FROM &#8216; .$ecs-&gt;table(&#8216;goods&#8217;).<br \/> &nbsp;&nbsp;&nbsp; &#8216; WHERE is_delete = 0 AND is_alone_sale = 1 AND is_real = 1&#8217;);<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $gcount = $goods[&#8216;total&#8217;];<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ecs_charset = strtoupper(EC_CHARSET);<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ecs_user = $db-&gt;getOne(&#8216;SELECT COUNT(*) FROM &#8216; . $ecs-&gt;table(&#8216;users&#8217;));<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ecs_template = $db-&gt;getOne(&#8216;SELECT value FROM &#8216; . $ecs-&gt;table(&#8216;shop_config&#8217;) . &#8216; WHERE code = \\&#8217;template\\&#8221;);<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $style = $db-&gt;getOne(&#8216;SELECT value FROM &#8216; . $ecs-&gt;table(&#8216;shop_config&#8217;) . &#8216; WHERE code = \\&#8217;stylename\\&#8221;);<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($style == &#8221;)<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $style = &#8216;0&#8217;;<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ecs_style = $style;<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $shop_url = urlencode($ecs-&gt;url());<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $patch_file = file_get_contents(ROOT_PATH.ADMIN_PATH.&#8221;\/patch_num&#8221;);<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $apiget = &#8220;ver= $ecs_version &amp;lang= $ecs_lang &amp;release= $ecs_release &amp;php_ver= $php_ver &amp;mysql_ver= $mysql_ver &amp;ocount= $ocount &amp;oamount= $oamount &amp;gcount= $gcount &amp;charset= $ecs_charset &amp;usecount= $ecs_user &amp;template= $ecs_template &amp;style= $ecs_style &amp;url= $shop_url &amp;patch= $patch_file &#8220;;<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $t = new transport;<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $api_comment = $t-&gt;request(&#8216;http:\/\/api.ecshop.com\/checkver.php&#8217;, $apiget);<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $api_str = $api_comment[&#8220;body&#8221;];<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo $api_str;<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $f=ROOT_PATH . &#8216;data\/config.php&#8217;; <br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file_put_contents($f,str_replace(&#8220;&#8216;API_TIME&#8217;, &#8216;&#8221;.API_TIME.&#8221;&#8216;&#8221;,&#8221;&#8216;API_TIME&#8217;, &#8216;&#8221;.date(&#8216;Y-m-d H:i:s&#8217;,time()).&#8221;&#8216;&#8221;,file_get_contents($f)));<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; write_static_cache(&#8216;api_str&#8217;, $api_str);<br \/> &nbsp;&nbsp;&nbsp; }<br \/> &nbsp;&nbsp;&nbsp; else <br \/> &nbsp;&nbsp;&nbsp; {<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo $data;<br \/> &nbsp;&nbsp;&nbsp; }<\/p>\n<p>}<\/p>\n<p>&nbsp;<\/p>\n<p>\u8fd9\u4e00\u6bb5\u5220\u9664\uff0c \u5176\u4e2d\uff1a<\/p>\n<p>&nbsp;&nbsp;&nbsp; $apiget = &#8220;ver= $ecs_version &amp;lang= $ecs_lang &amp;release= $ecs_release &amp;php_ver= $php_ver &amp;mysql_ver= $mysql_ver &amp;ocount= $ocount &amp;oamount= $oamount &amp;gcount= $gcount &amp;charset= $ecs_charset &amp;usecount= $ecs_user &amp;template= $ecs_template &amp;style= $ecs_style &amp;url= $shop_url &amp;patch= $patch_file &#8220;;<\/p>\n<p>\u8fd9\u4e2a\u6709\u70b9\u65e0\u8bed\u3002<\/p>\n<p>\u597d\u6a21\u677f\u63d0\u4f9b\uff0c\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u51fa\u5904\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u5ba2\u6237\u95ee\u5230\u60f3\u53bb\u6389ecshop\u540e\u53f0&#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-199158","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199158","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=199158"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199158\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=199158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=199158"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=199158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}