{"id":23122,"date":"2024-11-21T13:05:35","date_gmt":"2024-11-21T05:05:35","guid":{"rendered":"https:\/\/fwq.ai\/blog\/23122\/"},"modified":"2024-11-21T13:05:35","modified_gmt":"2024-11-21T05:05:35","slug":"thinkphp%e8%a1%a8%e6%a0%bc%e6%80%8e%e4%b9%88%e5%90%88%e5%b9%b6","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/23122\/","title":{"rendered":"thinkphp\u8868\u683c\u600e\u4e48\u5408\u5e76"},"content":{"rendered":"<p>thinkphp\u8868\u683c\u600e\u4e48\u5408\u5e76\uff1f<\/p>\n<p>ThinkPHP\u662f\u4e00\u6b3e\u4f18\u79c0\u7684\u5f00\u6e90PHP\u5f00\u53d1\u6846\u67b6\uff0c\u5b83\u7684\u7b80\u5355\u6613\u7528\u3001\u9ad8\u6548\u7a33\u5b9a\u3001\u6269\u5c55\u6027\u5f3a\u7b49\u7279\u70b9\u5907\u53d7\u5f00\u53d1\u8005\u7684\u559c\u7231\u3002\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\uff0c\u8868\u683c\u662f\u975e\u5e38\u5e38\u7528\u7684\u529f\u80fd\uff0c\u800c\u8868\u683c\u7684\u5408\u5e76\u4e5f\u662f\u4e00\u4e2a\u5e38\u89c1\u7684\u9700\u6c42\u3002<\/p>\n<p>\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528ThinkPHP\u8fdb\u884c\u8868\u683c\u5408\u5e76\u7684\u64cd\u4f5c\u3002<\/p>\n<p>\u4e00\u3001\u5408\u5e76\u5355\u5143\u683c<\/p>\n<p>\u5728\u5408\u5e76\u5355\u5143\u683c\u4e4b\u524d\uff0c\u9700\u8981\u5148\u6784\u5efa\u4e00\u4e2a\u6570\u636e\u8868\u683c\uff0c\u5982\u4e0b\uff1a<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<pre><\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<table>\n<tbody>\n<tr>\n<th rowspan=\"2\">\u59d3\u540d<\/th>\n<th colspan=\"2\">\u8bfe\u7a0b<\/th>\n<th rowspan=\"2\">\u603b\u5206<\/th>\n<\/tr>\n<tr>\n<th>\u8bed\u6587<\/th>\n<th>\u6570\u5b66<\/th>\n<\/tr>\n<tr>\n<td>\u5f20\u4e09<\/td>\n<td>90<\/td>\n<td>80<\/td>\n<td>170<\/td>\n<\/tr>\n<tr>\n<td>\u674e\u56db<\/td>\n<td>75<\/td>\n<td>85<\/td>\n<td>160<\/td>\n<\/tr>\n<tr>\n<td>\u738b\u4e94<\/td>\n<td>80<\/td>\n<td>75<\/td>\n<td>155<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5728\u8fd9\u4e2a\u8868\u683c\u4e2d\uff0c\u9700\u8981\u5c06\u7b2c\u4e00\u5217\u548c\u7b2c\u56db\u5217\u7684\u5355\u5143\u683c\u8fdb\u884c\u5408\u5e76\u3002\u4f7f\u7528ThinkPHP\u7684\u89c6\u56fe\u6a21\u677f\uff0c\u53ef\u4ee5\u8fd9\u6837\u5199\uff1a<\/p>\n<pre><\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<table>\n<tbody>\n<tr>\n<th rowspan=\"2\">\u59d3\u540d<\/th>\n<th colspan=\"2\">\u8bfe\u7a0b<\/th>\n<th rowspan=\"2\">\u603b\u5206<\/th>\n<\/tr>\n<tr>\n<th>\u8bed\u6587<\/th>\n<th>\u6570\u5b66<\/th>\n<\/tr>\n<p> $v):?&gt; <\/p>\n<tr>\n   &lt;td rowspan=&quot;&#8221;&gt;=$v[&#8216;name&#8217;]?&gt;<\/td>\n<td>=$v[&#8216;chinese&#8217;]?&gt;<\/td>\n<td>=$v[&#8216;math&#8217;]?&gt;<\/td>\n<p>   &lt;td rowspan=&quot;&#8221;&gt;=$v[&#8216;total&#8217;]?&gt;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5728\u8fd9\u4e2a\u4ee3\u7801\u4e2d\uff0c\u4f7f\u7528\u4e86\u4e00\u4e2aforeach\u5faa\u73af\uff0c\u5c06\u6570\u636e\u6309\u7167\u884c\u7684\u65b9\u5f0f\u9010\u4e2a\u8f93\u51fa\u3002\u5982\u679c\u662f\u7b2c\u4e00\u884c\u7684\u6570\u636e\uff0c\u5219\u5c06\u7b2c\u4e00\u5217\u7684\u5355\u5143\u683c\u8bbe\u7f6e\u4e3a\u8de8\u884c\uff0c\u8de8\u8d8a\u7684\u884c\u6570\u662f\u6570\u636e\u7684\u603b\u884c\u6570\uff1b\u5982\u679c\u662f\u6700\u540e\u4e00\u884c\u7684\u6570\u636e\uff0c\u5219\u5c06\u7b2c\u56db\u5217\u7684\u5355\u5143\u683c\u8bbe\u7f6e\u4e3a\u8de8\u884c\uff0c\u8de8\u8d8a\u7684\u884c\u6570\u540c\u6837\u662f\u6570\u636e\u7684\u603b\u884c\u6570\u3002\u5176\u4ed6\u7684\u5355\u5143\u683c\u76f4\u63a5\u8f93\u51fa\u5bf9\u5e94\u7684\u6570\u636e\u5373\u53ef\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u5b9e\u73b0\u5355\u5143\u683c\u7684\u5408\u5e76\u4e86\u3002<\/p>\n<p>\u4e8c\u3001\u5408\u5e76\u8868\u683c<\/p>\n<p>\u9664\u4e86\u5355\u5143\u683c\u7684\u5408\u5e76\uff0c\u6709\u65f6\u8fd8\u9700\u8981\u5c06\u591a\u4e2a\u8868\u683c\u5408\u5e76\u6210\u4e00\u4e2a\u5927\u7684\u8868\u683c\u3002\u8fd9\u4e2a\u65f6\u5019\u53ef\u4ee5\u501f\u52a9ThinkPHP\u7684\u6a21\u677f\u5f15\u64ce\u6765\u5b9e\u73b0\u3002\u5047\u8bbe\u6709\u4e24\u4e2a\u6570\u636e\u8868\u683c\u5982\u4e0b\uff1a<\/p>\n<p>\u8868\u683c\u4e00\uff1a<\/p>\n<pre><\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<table>\n<tbody>\n<tr>\n<th>\u59d3\u540d<\/th>\n<th>\u5e74\u9f84<\/th>\n<\/tr>\n<tr>\n<td>\u5f20\u4e09<\/td>\n<td>22<\/td>\n<\/tr>\n<tr>\n<td>\u674e\u56db<\/td>\n<td>23<\/td>\n<\/tr>\n<tr>\n<td>\u738b\u4e94<\/td>\n<td>24<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8868\u683c\u4e8c\uff1a<\/p>\n<pre><\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<table>\n<tbody>\n<tr>\n<th>\u5b66\u79d1<\/th>\n<th>\u6210\u7ee9<\/th>\n<\/tr>\n<tr>\n<td>\u8bed\u6587<\/td>\n<td>90<\/td>\n<\/tr>\n<tr>\n<td>\u6570\u5b66<\/td>\n<td>80<\/td>\n<\/tr>\n<tr>\n<td>\u82f1\u8bed<\/td>\n<td>85<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8fd9\u4e24\u4e2a\u8868\u683c\u90fd\u53ef\u4ee5\u4f7f\u7528\u4e0a\u6587\u4ecb\u7ecd\u7684\u65b9\u6cd5\u8fdb\u884c\u5355\u5143\u683c\u5408\u5e76\u3002\u5982\u679c\u9700\u8981\u5c06\u8fd9\u4e24\u4e2a\u8868\u683c\u5408\u5e76\u6210\u4e00\u4e2a\u5927\u7684\u8868\u683c\uff0c\u53ef\u4ee5\u6309\u7167\u5982\u4e0b\u65b9\u5f0f\u8fdb\u884c\u7f16\u5199\uff1a<\/p>\n<pre><\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<table>\n<tbody>\n<tr>\n<th>\u59d3\u540d<\/th>\n<th>\u5e74\u9f84<\/th>\n<th colspan=\"2\">\u6210\u7ee9<\/th>\n<\/tr>\n<tr>\n<td>\u5f20\u4e09<\/td>\n<td>22<\/td>\n<td>\u8bed\u6587<\/td>\n<td>90<\/td>\n<\/tr>\n<tr>\n<td>\u674e\u56db<\/td>\n<td>23<\/td>\n<td>\u6570\u5b66<\/td>\n<td>80<\/td>\n<\/tr>\n<tr>\n<td>\u738b\u4e94<\/td>\n<td>24<\/td>\n<td>\u82f1\u8bed<\/td>\n<td>85<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8fd9\u4e2a\u4ee3\u7801\u4e2d\uff0c\u5c06\u7b2c\u4e09\u5217\u548c\u7b2c\u56db\u5217\u7684\u5355\u5143\u683c\u8fdb\u884c\u4e86\u5408\u5e76\uff0c\u6210\u4e3a\u4e00\u4e2a\u65b0\u7684\u8868\u683c\u3002\u5176\u4ed6\u7684\u5355\u5143\u683c\u6309\u7167\u539f\u6765\u7684\u987a\u5e8f\u8fdb\u884c\u8f93\u51fa\u5373\u53ef\u3002<\/p>\n<p>\u4e09\u3001\u603b\u7ed3<\/p>\n<p>\u672c\u6587\u4ecb\u7ecd\u4e86\u4f7f\u7528ThinkPHP\u5bf9\u8868\u683c\u8fdb\u884c\u5408\u5e76\u7684\u65b9\u6cd5\u3002\u901a\u8fc7\u8c03\u6574\u5355\u5143\u683c\u7684rowspan\u548ccolspan\u5c5e\u6027\uff0c\u53ef\u4ee5\u5b9e\u73b0\u5355\u5143\u683c\u7684\u5408\u5e76\uff1b\u901a\u8fc7\u6a21\u677f\u5f15\u64ce\u7684\u529f\u80fd\uff0c\u53ef\u4ee5\u5c06\u591a\u4e2a\u8868\u683c\u5408\u5e76\u6210\u4e00\u4e2a\u5927\u7684\u8868\u683c\u3002\u8fd9\u4e9b\u6280\u5de7\u5bf9\u4e8e\u5b9e\u9645\u5f00\u53d1\u4e2d\u7684\u8868\u683c\u64cd\u4f5c\u975e\u5e38\u6709\u7528\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fthinkphp\u8868\u683c\u600e\u4e48\u5408\u5e76\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>thinkphp\u8868\u683c\u600e\u4e48\u5408\u5e76\uff1f ThinkPHP\u662f\u4e00\u6b3e\u4f18\u79c0\u7684\u5f00\u6e90PHP\u5f00\u53d1\u6846\u67b6\uff0c\u5b83\u7684\u7b80\u5355\u6613\u7528\u3001\u9ad8\u6548\u7a33\u5b9a\u3001\u6269\u5c55\u6027\u5f3a\u7b49\u7279\u70b9\u5907\u53d7\u5f00\u53d1\u8005\u7684\u559c\u7231\u3002\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\uff0c\u8868\u683c\u662f\u975e\u5e38\u5e38\u7528\u7684\u529f\u80fd\uff0c\u800c\u8868\u683c\u7684\u5408\u5e76\u4e5f\u662f\u4e00\u4e2a\u5e38\u89c1\u7684\u9700\u6c42\u3002 \u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528ThinkPHP\u8fdb\u884c\u8868\u683c\u5408\u5e76\u7684\u64cd\u4f5c\u3002 \u4e00\u3001\u5408\u5e76\u5355\u5143\u683c \u5728\u5408\u5e76\u5355\u5143\u683c\u4e4b\u524d\uff0c\u9700\u8981\u5148\u6784\u5efa\u4e00\u4e2a\u6570\u636e\u8868\u683c\uff0c\u5982\u4e0b\uff1a \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u59d3\u540d \u8bfe\u7a0b \u603b\u5206 \u8bed\u6587 \u6570\u5b66 \u5f20\u4e09 90 80 170 \u674e\u56db 75 85 160 \u738b\u4e94 80 75 155 \u5728\u8fd9\u4e2a\u8868\u683c\u4e2d\uff0c\u9700\u8981\u5c06\u7b2c\u4e00\u5217\u548c\u7b2c\u56db\u5217\u7684\u5355\u5143\u683c\u8fdb\u884c\u5408\u5e76\u3002\u4f7f\u7528ThinkPHP\u7684\u89c6\u56fe\u6a21\u677f\uff0c\u53ef\u4ee5\u8fd9\u6837\u5199\uff1a \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u59d3\u540d \u8bfe\u7a0b \u603b\u5206 \u8bed\u6587 \u6570\u5b66 $v):?&gt; &lt;td rowspan=&quot;&#8221;&gt;=$v[&#8216;name&#8217;]?&gt; =$v[&#8216;chinese&#8217;]?&gt; =$v[&#8216;math&#8217;]?&gt; &lt;td rowspan=&quot;&#8221;&gt;=$v[&#8216;total&#8217;]?&gt; \u5728\u8fd9\u4e2a\u4ee3\u7801\u4e2d\uff0c\u4f7f\u7528\u4e86\u4e00\u4e2aforeach\u5faa\u73af\uff0c\u5c06\u6570\u636e\u6309\u7167\u884c\u7684\u65b9\u5f0f\u9010\u4e2a\u8f93\u51fa\u3002\u5982\u679c\u662f\u7b2c\u4e00\u884c\u7684\u6570\u636e\uff0c\u5219\u5c06\u7b2c\u4e00\u5217\u7684\u5355\u5143\u683c\u8bbe\u7f6e\u4e3a\u8de8\u884c\uff0c\u8de8\u8d8a\u7684\u884c\u6570\u662f\u6570\u636e\u7684\u603b\u884c\u6570\uff1b\u5982\u679c\u662f\u6700\u540e\u4e00\u884c\u7684\u6570\u636e\uff0c\u5219\u5c06\u7b2c\u56db\u5217\u7684\u5355\u5143\u683c\u8bbe\u7f6e\u4e3a\u8de8\u884c\uff0c\u8de8\u8d8a\u7684\u884c\u6570\u540c\u6837\u662f\u6570\u636e\u7684\u603b\u884c\u6570\u3002\u5176\u4ed6\u7684\u5355\u5143\u683c\u76f4\u63a5\u8f93\u51fa\u5bf9\u5e94\u7684\u6570\u636e\u5373\u53ef\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u5b9e\u73b0\u5355\u5143\u683c\u7684\u5408\u5e76\u4e86\u3002 \u4e8c\u3001\u5408\u5e76\u8868\u683c \u9664\u4e86\u5355\u5143\u683c\u7684\u5408\u5e76\uff0c\u6709\u65f6\u8fd8\u9700\u8981\u5c06\u591a\u4e2a\u8868\u683c\u5408\u5e76\u6210\u4e00\u4e2a\u5927\u7684\u8868\u683c\u3002\u8fd9\u4e2a\u65f6\u5019\u53ef\u4ee5\u501f\u52a9ThinkPHP\u7684\u6a21\u677f\u5f15\u64ce\u6765\u5b9e\u73b0\u3002\u5047\u8bbe\u6709\u4e24\u4e2a\u6570\u636e\u8868\u683c\u5982\u4e0b\uff1a \u8868\u683c\u4e00\uff1a \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 [&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-23122","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/23122","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=23122"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/23122\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=23122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=23122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=23122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}