{"id":776,"date":"2016-04-06T13:20:43","date_gmt":"2016-04-06T05:20:43","guid":{"rendered":"http:\/\/www.baishitou.cn\/?p=776"},"modified":"2016-04-06T13:25:06","modified_gmt":"2016-04-06T05:25:06","slug":"dedecms%e9%a6%96%e9%a1%b5%e8%b0%83%e7%94%a8%e6%a0%8f%e7%9b%ae%e5%86%85%e5%ae%b9%e5%92%8c%e5%8d%95%e9%a1%b5%e5%86%85%e5%ae%b9","status":"publish","type":"post","link":"https:\/\/www.baishitou.cn\/776.html","title":{"rendered":"dedecms\u9996\u9875\u8c03\u7528\u680f\u76ee\u5185\u5bb9\u548c\u5355\u9875\u5185\u5bb9"},"content":{"rendered":"

\u5982\u4f55\u5c06\u5df2\u7ecf\u505a\u6210\u5355\u9875\u7684\u680f\u76ee\u5185\u5bb9\u8c03\u7528\u5230\u9996\u9875\u6765\u3002<\/p>\n

\u3000\u3000\u5e38\u7528\u7684\u9700\u8981\u8c03\u5230\u9996\u9875\u6765\u7684\u5355\u9875\u5185\u5bb9\uff0c\u6bd4\u5982\u4f01\u4e1a\u7b80\u4ecb\u3001\u8054\u7cfb\u6211\u4eec\u7b49\u7b49\u5185\u5bb9\uff0c\u6211\u4eec\u5728\u9996\u9875\u53ef\u80fd\u90fd\u8981\u8fdb\u884c\u4f53\u73b0\u3002\u901a\u8fc7\u5e38\u89c4\u7684\u65b9\u5f0f\uff0c\u5305\u62ec\u67e5\u9605dede\u5b98\u65b9\u8bba\u575b\u8d44\u6599\uff0c\u90fd\u627e\u4e0d\u5230\u6bd4\u8f83\u5408\u9002\u7684\u7b54\u6848\u3002\u4eca\u5929\u6211\u4eec\u5c31\u63d0\u4f9b\u4e24\u79cd\u65b9\u5f0f\u8fdb\u884c\u8c03\u7528\u3002<\/p>\n

\u3000\u3000\u6211\u4eec\u77e5\u9053\uff0c\u5355\u9875\u5185\u5bb9\u7684\u6a21\u677f\u8c03\u7528\u6807\u7b7e\u662f {dede:field.content\/} \uff0c\u7ecf\u8fc7\u8bd5\u9a8c\uff0c\u5728\u9996\u9875\u4f7f\u7528<\/p>\n

\r\n{dede:channelartlist }\r\n{dede:field.content\/}\r\n{\/dede:channelartlist }\r\n<\/pre>\n

\u3000\u3000\u8fdb\u884c\u8c03\u7528\uff0c\u5373\u53ef\u987a\u5229\u7684\u8c03\u51fa\u76f8\u5173\u7684\u6570\u636e\u3002<\/p>\n

\u3000\u3000\u4f46\u662f\u6211\u4eec\u53d1\u73b0\uff0c\u8fd9\u79cd\u8c03\u7528\u53ea\u80fd\u7528\u4e8e\u53ea\u6709\u4e00\u4e2a\u5355\u9875\u7684\u60c5\u51b5\uff0c\u5982\u679c\u4e24\u4e2a\u6216\u8005\u4e24\u4e2a\u4ee5\u4e0a\u5355\u9875\uff0c\u8be5\u8c03\u7528\u4f1a\u5c06\u6240\u6709\u7684\u5355\u9875\u5185\u5bb9\u5806\u53e0\u663e\u793a\u51fa\u6765\u3002\u5373\u4f7f\u52a0type\u7684ID\u8fdb\u884c\u9650\u5b9a\u4e5f\u6ca1\u6709\u4ec0\u4e48\u4f5c\u7528\u3002\u96be\u9053\u53ea\u80fd\u8fd9\u6837\u88ab\u52a8\u5417\uff1f\u5f53\u7136\u4e0d\u5fc5\u3002<\/p>\n

\u3000\u3000\u6211\u4eec\u8fd8\u53ef\u4ee5\u4f7f\u7528SQL\u8fdb\u884c\u8c03\u7528\uff0c\u8fd9\u6837\u4ee5\u6765\u7075\u6d3b\u6027\u5927\u5927\u63d0\u9ad8\u4e86\uff0c\u53ef\u4ee5\u8c03\u7528\u4efb\u610f\u4e00\u4e2aID\u7684content\u5185\u5bb9\u4e86\u3002<\/p>\n

\r\n{dede:sql sql='Select content from dede_arctype where id=1'}\r\n[field:content\/]\r\n{\/dede:sql}\r\n<\/pre>\n

\u3000\u3000\u60f3\u8c03\u7528\u90a3\u4e2a\u680f\u76ee\uff0c\u53ea\u9700\u8981\u4fee\u6539\u680f\u76ee\u7684ID \u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n

\u3000\u3000dede\u7ad9\u600e\u4e48\u5728\u9996\u9875\u8c03\u7528\u5355\u9875\u7684\u5185\u5bb9\uff1f<\/p>\n

\r\n{dede:sql sql=\"SELECT aid,typeid,body FROM `dede_addonarticle` where typeid=2 ORDER BY `aid` DESC LIMIT 0 , 1\"}\r\n[field:body \/]\r\n{\/dede:sql}\r\n<\/pre>\n

\u3000\u3000\u8bf4\u660e\uff1a\u5176\u4e2dtypeid=2\uff0c\u680f\u76eeID\u53f7\uff0c\u8868\u793a\u8c03\u7528\u6b64ID\u680f\u76ee\u5185\u7684\u6587\u7ae0\uff0c\u6362\u6210aid=1\u5219\u8868\u793a\u8c03\u7528\u7684aid\u4e3a1\u7684\u6587\u7ae0\uff08\u5177\u4f53\u54ea\u7bc7\u6587\u7ae0aid\u662f\u591a\u5c11\uff0c\u8981\u8fdb\u6570\u636e\u5e93\u770b\uff0c\u4ece\u540e\u53f0\u770b\u4e5f\u53ef\u4ee5\uff09\uff0cDESC\u8868\u793a\u6392\u5e8f\uff0c\u6309\u4ece\u5927\u5230\u5c0f\u6392\uff0c\u6362\u6210ASC\u5219\u6309\u4ece\u5c0f\u5230\u5927\u6392\u5e8f\uff0cLIMIT 0 , 1\u8868\u793a\u8c03\u7528\u6570\u91cf\uff0c\u4e5f\u53ef\u4ee5\u5199\u6210\u6570\u91cfLIMIT 1\uff0c\u8fd9\u4e2a1\u4ee3\u8868\u8c03\u7528\u7684\u6570\u91cf\u3002<\/p>\n

\u3000\u3000\u9700\u8981\u5728\u9996\u9875\u52a0\u5165\u680f\u76ee\u505a\u6210\u5355\u9875\u7684\u5185\u5bb9\uff0c\u5728\u8bba\u575b\u627e\u4e86\u597d\u591a\uff0c\u6ca1\u770b\u5230\u89e3\u51b3\u65b9\u6cd5\uff0c\u81ea\u5df1\u8bd5\u4e86\u4e00\u4e0b\uff0c\u53d1\u73b0\u7528\u5f88\u7b80\u5355\u7684\u4ee3\u7801\u5c31\u53ef\u4ee5\u89e3\u51b3\u4e86\u3002<\/p>\n

\u3000\u3000\u5728\u9996\u9875\u4efb\u4f55\u4f4d\u7f6e\u52a0\u5165\u4e0b\u5217\u4ee3\u7801\u5c31\u6210\uff01<\/p>\n

\r\n{dede:channelartlist type=\"1\"}\r\n{dede:field.content\/}\r\n{\/dede:channelartlist}\r\n<\/pre>\n

\u3000\u3000type\u503c\u6539\u6210\u81ea\u5df1\u9700\u8981\u63d0\u51fa\u5185\u5bb9\u680f\u76ee\u7684\u503c\u3002<\/p>\n

\u3000\u3000\u66f4\u6b63\uff0c\u4ee5\u4e0a\u4ee3\u7801\u53ea\u9002\u7528\u4e8e\u5355\u4e2a\u5355\u9875\u6709\u5185\u5bb9\u7684\u60c5\u51b5\u4e0b\uff0c<\/p>\n

\u3000\u3000\u5982\u679c\u6709\u4e00\u4e2a\u4ee5\u4e0a\u7684\u5355\u9875\u6709\u5185\u5bb9\uff0c\u4e0a\u9762\u7684\u4ee3\u7801\u4f1a\u628a\u6240\u6709\u680f\u76ee\u7684content\u91cc\u7684\u5185\u5bb9\u90fd\u663e\u793a\u51fa\u6765\u3002<\/p>\n

\u3000\u3000\u7528sql\u4ee3\u7801\u5219\u662f\u4e07\u80fd\u7684\uff1a<\/p>\n

\r\n{dede:sql sql='Select content from dede_arctype where id=1'}\r\n[field:content\/]\r\n{\/dede:sql}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"

\u5982\u4f55\u5c06\u5df2\u7ecf\u505a\u6210\u5355\u9875\u7684\u680f\u76ee\u5185\u5bb9\u8c03\u7528\u5230\u9996\u9875\u6765\u3002 \u3000\u3000\u5e38\u7528\u7684\u9700\u8981\u8c03\u5230\u9996\u9875\u6765\u7684\u5355\u9875\u5185\u5bb9\uff0c\u6bd4\u5982\u4f01\u4e1a\u7b80\u4ecb\u3001\u8054\u7cfb\u6211\u4eec\u7b49\u7b49\u5185\u5bb9 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[43,223],"class_list":["post-776","post","type-post","status-publish","format-standard","hentry","category-web","tag-dedecms","tag-223"],"_links":{"self":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/776","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/comments?post=776"}],"version-history":[{"count":0,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/776\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/media?parent=776"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/categories?post=776"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/tags?post=776"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}