{"id":59287,"date":"2025-04-23T14:17:50","date_gmt":"2025-04-23T06:17:50","guid":{"rendered":"https:\/\/fwq.ai\/blog\/59287\/"},"modified":"2025-04-23T14:17:50","modified_gmt":"2025-04-23T06:17:50","slug":"shopex%e8%bd%ac%e5%88%b0ecshop%e5%90%8e%ef%bc%8c%e5%95%86%e5%93%81%e7%9b%b8%e5%86%8c%e5%9b%be%e7%89%87%e6%95%b0%e6%8d%ae%e9%87%8d%e5%a4%8d%e7%9a%84%e8%a7%a3%e5%86%b3","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/59287\/","title":{"rendered":"Shopex\u8f6c\u5230Ecshop\u540e\uff0c\u5546\u54c1\u76f8\u518c\u56fe\u7247\u6570\u636e\u91cd\u590d\u7684\u89e3\u51b3"},"content":{"rendered":"<p>&nbsp;<span style=\"font-family: verdana, \ufffd\ufffd\ufffd\ufffd, Arial;font-size: 14px;line-height: 21px\">&lt;?php<\/span><\/p>\n<p style=\"margin-top: 5px;margin-right: auto;margin-bottom: 5px;margin-left: auto;padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px;text-indent: 0px;font-family: verdana, \ufffd\ufffd\ufffd\ufffd, Arial;font-size: 14px;line-height: 21px\">define(&#8216;IN_ECS&#8217;, true);<\/p>\n<p style=\"margin-top: 5px;margin-right: auto;margin-bottom: 5px;margin-left: auto;padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px;text-indent: 0px;font-family: verdana, \ufffd\ufffd\ufffd\ufffd, Arial;font-size: 14px;line-height: 21px\">require(dirname(__FILE__) . &#8216;\/includes\/init.php&#8217;);<br \/> &nbsp;$q = $db-&gt;getAll(&#8220;SELECT DISTINCT `img_url` FROM &#8220;. $ecs-&gt;table(&#8216;goods_gallery&#8217;));<br \/> &nbsp;foreach($q as $key =&gt; $val){<br \/> &nbsp;&nbsp;$c = intval($db-&gt;getOne(&#8220;SELECT count(0) FROM &#8220;. $ecs-&gt;table(&#8216;goods_gallery&#8217;) .&#8221; WHERE img_url='&#8221;. $val[&#8216;img_url&#8217;] .&#8221;&#8216;&#8221;));<br \/> &nbsp;&nbsp;if($c&gt;1){<br \/> &nbsp;&nbsp;&nbsp;$c = intval($db-&gt;getOne(&#8220;SELECT img_id FROM &#8220;. $ecs-&gt;table(&#8216;goods_gallery&#8217;) .&#8221; WHERE img_url='&#8221;. $val[&#8216;img_url&#8217;] .&#8221;&#8216; ORDER BY img_id LIMIT 0,1&#8243;));<br \/> &nbsp;&nbsp;&nbsp;if($c&gt;0){<br \/> &nbsp;&nbsp;&nbsp;&nbsp;$sql = &#8220;DELETE FROM &#8221; . $ecs-&gt;table(&#8216;goods_gallery&#8217;) . &#8221; WHERE img_id &lt;&gt; &#8220;. $c .&#8221; and img_url='&#8221;. $val[&#8216;img_url&#8217;] .&#8221;&#8216;&#8221;;<br \/> &nbsp;&nbsp;&nbsp;&nbsp;$db-&gt;query($sql);<br \/> &nbsp;&nbsp;&nbsp;}<br \/> &nbsp;&nbsp;}<br \/> &nbsp;}<br \/> ?&gt;<\/p>\n<p style=\"margin-top: 5px;margin-right: auto;margin-bottom: 5px;margin-left: auto;padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px;text-indent: 0px;font-family: verdana, \ufffd\ufffd\ufffd\ufffd, Arial;font-size: 14px;line-height: 21px\">\u5c06\u4ee5\u4e0a\u5185\u5bb9\u4fdd\u5b58\u6210\u4e3a\u4e00\u4e2aphp\u6587\u4ef6 \u8fd0\u884c\u5373\u53ef<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;&lt;?php define(&#8216;IN_ECS&#8217;, true); require(dirname(__FILE__) . &#8216;\/includes\/init.php&#8217;); &nbsp;$q = $db-&gt;getAll(&#8220;SELECT DISTINCT `img_url` FROM &#8220;. $ecs-&gt;table(&#8216;goods_gallery&#8217;)); &nbsp;foreach($q as $key =&gt; $val){ &nbsp;&nbsp;$c = intval($db-&gt;getOne(&#8220;SELECT count(0) FROM &#8220;. $ecs-&gt;table(&#8216;goods_gallery&#8217;) .&#8221; WHERE img_url=&#8217;&#8221;. $val[&#8216;img_url&#8217;] .&#8221;&#8216;&#8221;)); &nbsp;&nbsp;if($c&gt;1){ &nbsp;&nbsp;&nbsp;$c = intval($db-&gt;getOne(&#8220;SELECT img_id FROM &#8220;. $ecs-&gt;table(&#8216;goods_gallery&#8217;) .&#8221; WHERE img_url=&#8217;&#8221;. $val[&#8216;img_url&#8217;] .&#8221;&#8216; ORDER BY img_id LIMIT 0,1&#8243;)); &nbsp;&nbsp;&nbsp;if($c&gt;0){ &nbsp;&nbsp;&nbsp;&nbsp;$sql = &#8220;DELETE FROM &#8221; [&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-59287","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/59287","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=59287"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/59287\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=59287"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=59287"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=59287"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}