{"id":199440,"date":"2025-05-03T12:12:52","date_gmt":"2025-05-03T04:12:52","guid":{"rendered":"https:\/\/server.hk\/cnblog\/199440\/"},"modified":"2025-05-03T12:12:52","modified_gmt":"2025-05-03T04:12:52","slug":"%e6%89%80%e6%9c%89ecshop%e9%a1%b5%e8%b0%83%e7%94%a8%e5%95%86%e5%93%81%e5%8e%9f%e5%9b%be%e7%9a%84%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/199440\/","title":{"rendered":"\u6240\u6709ecshop\u9875\u8c03\u7528\u5546\u54c1\u539f\u56fe\u7684\u65b9\u6cd5"},"content":{"rendered":"<p> \u9ed8\u8ba4\u7684ecshop\u5546\u54c1\u56fe\u5c55\u793a\u90fd\u662f\u7ecf\u8fc7\u7cfb\u7edf\u88c1\u526a\u7684\uff0c\u5982\u4f55\u8ba9ECSHOP\u8c03\u7528\u9ed8\u8ba4\u7684\u539f\u56fe\u6765\u663e\u793a\uff1f \u597d\u6a21\u677f\u603b\u7ed3\u5982\u4e0b\uff1a<br \/> \u4e00\u3001\u5728\u5217\u8868\u9875\u53ef\u4ee5\u7528{$goods.goods_thumb}&nbsp;&nbsp; {$goods.goods_img}\u8c03\u7528\u7f29\u7565\u56fe\u548c\u5546\u54c1\u56fe\u7247<\/p>\n<p> \u5c31\u662f\u6ca1\u6709\u8c03\u7528\u539f\u56fe\u7684\u4e0b\u9762\u662f\u4fee\u6539category.php \u603bsql\u8bed\u53e5\u5904\u66ff\u6362\u6210\u4e0b\u9762\u7684\u90e8\u5206(\u628aoriginal_img \u5b57\u6bb5\u52a0\u8fdb\u53bb)<\/p>\n<pre>\r\n $sql = 'SELECT g.goods_id, g.goods_name, g.goods_name_style, g.market_price, g.is_new, g.is_best, g.is_hot, g.shop_price AS org_price, ' .\r\n                \"IFNULL(mp.user_price, g.shop_price * '$_SESSION[discount]') AS shop_price, g.promote_price, g.goods_type, \" .\r\n                'g.promote_start_date, g.promote_end_date, g.goods_brief, g.goods_thumb ,g.original_img , g.goods_img ' .\r\n            'FROM ' . $GLOBALS['ecs']-&gt;table('goods') . ' AS g ' .\r\n            'LEFT JOIN ' . $GLOBALS['ecs']-&gt;table('member_price') . ' AS mp ' .\r\n                \"ON mp.goods_id = g.goods_id AND mp.user_rank = '$_SESSION[user_rank]' \" .\r\n            \"WHERE $where $ext ORDER BY $sort $order\";\/\/maxlwn \u6dfb\u52a0original_img\u539f\u56fe\u5c5e\u6027\u8c03\u7528<\/pre>\n<p> \u4e8c\u3001\u4fee\u6539\u4e0b\u9762\u5c06original_img\u8f93\u51fa<\/p>\n<pre>\r\n  $arr[$row['goods_id']]['name']             = $row['goods_name'];\r\n        $arr[$row['goods_id']]['goods_brief']      = $row['goods_brief'];\r\n        $arr[$row['goods_id']]['goods_style_name'] = add_style($row['goods_name'],$row['goods_name_style']);\r\n        $arr[$row['goods_id']]['market_price']     = price_format($row['market_price']);\r\n        $arr[$row['goods_id']]['shop_price']       = price_format($row['shop_price']);\r\n        $arr[$row['goods_id']]['type']             = $row['goods_type'];<span style=\"color:#ffffff\">\/\/ldhost.cn<\/span>\r\n        $arr[$row['goods_id']]['promote_price']    = ($promote_price &gt; 0) ? price_format($promote_price) : '';\r\n        $arr[$row['goods_id']]['goods_thumb']      = get_image_path($row['goods_id'], $row['goods_thumb'], true);\r\n        $arr[$row['goods_id']]['goods_img']        = get_image_path($row['goods_id'], $row['goods_img']);\r\n        $arr[$row['goods_id']]['original_img']        = get_image_path($row['goods_id'], $row['original_img']);\/\/maxlwn  \u8f93\u51fa\u5546\u54c1\u7684\u539f\u56fe\r\n        $arr[$row['goods_id']]['url']              = build_uri('goods', array('gid'=&gt;$row['goods_id']), $row['goods_name']);<\/pre>\n<p> &nbsp;<\/p>\n<p> &nbsp;\u5728\u8c03\u7528\u7684\u5730\u65b9\u4f7f\u7528{$goods.original_img}\u5c31\u53ef\u4ee5\u8c03\u7528\u539f\u56fe\u4e86,\u56fe\u7247\u662f\u4e0d\u662f\u53d8\u66f4\u6e05\u6670\u4e86\uff1f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9ed8\u8ba4\u7684ecshop\u5546\u54c1\u56fe\u5c55\u793a\u90fd\u662f&#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-199440","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199440","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=199440"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199440\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=199440"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=199440"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=199440"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}