尊龙凯时人生就是搏

ÔõÑùʹÓÃThinkPHP6¾ÙÐÐÎïÁ÷×·×Ù²Ù×÷ £¿

Ëæ×ŵç×ÓÉÌÎñÐËÆ𠣬ȫÇòÎïÊ¢ÐÐÒµÈç»ðÈçݱ¡£¹ØÓÚÏûºÄÕ߶øÑÔ £¬Äܹ»ÊµÊ±ÏàʶÎïÁ÷ÐÅÏ¢ÏԵøñÍâÖ÷Òª £¬¶ø¹ØÓÚµçÉÌÆóÒµ £¬ÔòÐèÒªÒ»¸öÓÅÒìµÄÎïÁ÷×·×Ùϵͳ £¬ÒÔ±ã¸üºÃµØÖÎÀíÀ¿ÊÕ¡¢ÔËËͺͽ»¸¶µÈ»·½Ú¡£±¾ÎĽ«ÏÈÈÝÔõÑùʹÓÃthinkphp6¾ÙÐÐÎïÁ÷×·×Ù²Ù×÷¡£

Ò»¡¢ThinkPHP6¼ò½é

ThinkPHPÊÇÒ»¿îÖÜÈ«ÇÒ¸ßЧµÄPHP¿ò¼Ü £¬ÒѾ­±»ÆÕ±éʹÓúÍÈÏ¿É¡£ThinkPHP6ÊÇ×îаæ £¬¾ßÓÐÄ £¿é»¯¡¢×¢½â·ÓÉ¡¢ÒÀÀµ×¢ÈëµÈ¶àÏîÓŵã £¬Äܹ»×ÊÖú¿ª·¢Õß¿ìËÙ¹¹½¨WebÓ¦ÓóÌÐò¡£

¶þ¡¢ÎïÁ÷×·×ÙϵͳÉè¼Æ

1.Ä £¿éÉè¼Æ

Á¬Ã¦Ñ§Ï°¡°PHPÃâ·ÑѧϰÌõ¼Ç£¨ÉîÈ룩¡±£»

ƾ֤ÎïÁ÷×·×ÙµÄÓªÒµÁ÷³Ì £¬¿É½«ÎïÁ÷×·×Ùϵͳ·ÖΪÈçÏÂÄ £¿é£º

Óû§Ä £¿é£º×¢²á¡¢µÇ¼¡¢ÐÞ¸ÄÃÜÂëµÈ¹¦Ð§¡£

ÎïÁ÷Ä £¿é£º°üÀ¨ÎïÁ÷¹«Ë¾ÐÅÏ¢¡¢Ô˵¥ÐÅÏ¢µÈ¡£

ÔË·ÑÄ £¿é£ºÆ¾Ö¤»õÎïÖØÁ¿¡¢ÖÖÀà¡¢¾àÀëµÈ²ÎÊýÅÌËãÔË·Ñ¡£

¶©µ¥Ä £¿é£º°üÀ¨Ïµ¥¡¢Ö§¸¶¡¢×÷·Ï¡¢ÅÌÎʵȹ¦Ð§¡£

ͶËßÄ £¿é£º´¦ÀíÓû§¹ØÓÚÎïÁ÷ЧÀ͵ÄͶËß¡£

ÖÎÀíﱀ £¿é£ºÅÌÎʶ©µ¥¡¢ÎïÁ÷ÐÅÏ¢¡¢´¦ÀíͶËߵȹ¦Ð§¡£

2.ÊÖÒÕÑ¡ÐÍ

¿ò¼Ü£ºThinkPHP6

Êý¾Ý¿â£ºMySQL

»º´æ£ºRedis

ÐÂÎÅÐÐÁУºRabbitMQ

Èý¡¢ÎïÁ÷×·×ÙϵͳµÄÏêϸʵÏÖ

1.×°ÖÃThinkPHP6

ÔÚÍâµØ»òЧÀÍÆ÷ÉÏ×°ÖÃThinkPHP6 £¬Ïêϸ°ì·¨¿É²Î¿¼ThinkPHP¹Ù·½Îĵµ¡£

2.½¨ÉèÊý¾Ý¿âºÍÊý¾Ý±í

½¨ÉèÒ»¸ö°üÀ¨Óû§¡¢ÎïÁ÷¡¢¶©µ¥µÈÊý¾Ý±íµÄÊý¾Ý¿â £¬²¢»®·ÖÉè¼Æ±í½á¹¹¡£ÔÚThinkPHP6ÖÐ £¬¿ÉʹÓÃÊý¾Ý¿âǨá㹤¾ßMigrateÀ´½¨ÉèºÍÖÎÀíÊý¾Ý¿â±í £¬ÔÚTerminalÖÐʹÓÃÒÔÏÂÏÂÁîÆôÓÃMigrate£º

php think migrate:run

µÇ¼ºó¸´ÖÆ

3.±àдģ×Ó

Ä£×Ó£¨Model£©ÊÇÊý¾Ý¿â²Ù×÷µÄ½¹µã £¬ÔÚThinkPHP6ÖеÄÄ£×Ó¼ÌÐø×ÔBaseModelÀà £¬¿ÉÒÔ¼ò»¯Êý¾Ý±íµÄÔöɾ¸Ä²é²Ù×÷¡£ÀýÈç £¬ÒÔÏÂÊǶ©µ¥Ä£×ÓÉè¼ÆµÄÊ÷Ä£´úÂ룺

namespace appcommonmodel;

use thinkModel;

class Order extends Model
{
    protected $table = 'order';

    // ¹ØÁªÓû§Ä£×Ó
    public function user()
    {
        return $this->belongsTo('User');
    }

    // ¹ØÁªÎïÁ÷Ä£×Ó
    public function express()
    {
        return $this->belongsTo('Express');
    }

    // ÅÌÎʶ©µ¥Áбí
    public function getOrderList()
    {
        $orderList = $this->with(['user','express'])->paginate(5);
        return $orderList;
    }

    // ÅÌÎʶ©µ¥ÏêÇé
    public function getOrderDetail($orderId)
    {
        $orderDetail = $this->with(['user','express'])->find($orderId);
        return $orderDetail;
    }
}

µÇ¼ºó¸´ÖÆ

4.±àд¿ØÖÆÆ÷

¿ØÖÆÆ÷£¨Controller£©ÊÇWebÓ¦ÓóÌÐòµÄ½¹µã £¬ÈÏÕæÎüÊÕÇëÇóºÍŲÓÃÏìÓ¦µÄÄ£×Ó¾ÙÐд¦Àí¡£ÒÔÏÂÊǶ©µ¥¿ØÖÆÆ÷Éè¼ÆµÄÊ÷Ä£´úÂ룺

namespace appindexcontroller;

use thinkController;
use appcommonmodelOrder as OrderModel;

class Order extends Controller
{
    // ÅÌÎʶ©µ¥Áбí
    public function getOrderList()
    {
        $orderModel = new OrderModel();
        $orderList = $orderModel->getOrderList();
        return $this->fetch('order_list', ['orderList' => $orderList]);
    }

    // ÅÌÎʶ©µ¥ÏêÇé
    public function getOrderDetail($orderId)
    {
        $orderModel = new OrderModel();
        $orderDetail = $orderModel->getOrderDetail($orderId);
        return $this->fetch('order_detail', ['orderDetail' => $orderDetail]);
    }
}

µÇ¼ºó¸´ÖÆ

5.±àдÊÓͼÎļþ

ÊÓͼÎļþ£¨View£©ÊÇWebÓ¦ÓóÌÐòµÄÓû§½çÃæ £¬½ÓÄÉHTMLºÍCSSµÈÇ°¶ËÊÖÒÕ¡£ÒÔÏÂÊǶ©µ¥ÁбíÊÓͼÉè¼ÆµÄÊ÷Ä£´úÂ룺¡°

{extend name="layout"}
{block name="content"}
<h1>¶©µ¥Áбí</h1>
<table>
    <thead>
        <tr>
            <th>¶©µ¥ºÅ</th>
            <th>Óû§</th>
            <th>ÎïÁ÷¹«Ë¾</th>
            <th>Ô˵¥ºÅ</th>
            <th>²Ù×÷</th>
        </tr>
    </thead>
    <tbody>
        {foreach $orderList as $order}
        <tr>
            <td>{$order.order_no}</td>
            <td>{$order.user.username}</td>
            <td>{$order.express.express_name}</td>
            <td>{$order.waybill_no}</td>
            <td>
                <a href="{:url(/help/'Order/getOrderDetail', ['orderId' => $order.order_id])}">ÏêÇé</a>
            </td>
        </tr>
        {/foreach}
    </tbody>
</table>
{/block}

µÇ¼ºó¸´ÖÆ

ÒÔÉÏÊÓͼÎļþÖÐÉæ¼°µ½µÄlayoutºÍurlº¯ÊýÐèÒªÊÂÏȾÙÐÐÉèÖà £¬ÒÔ°ü¹ÜϵͳÕý³£ÔËÐС£

6.²âÊԺͰ²ÅÅ

±àд´úÂëºó £¬ÐèÒª¾ÙÐвâÊԺͰ²ÅÅ¡ £¿ÉÒÔʹÓÃThinkPHP6ÌṩµÄÄÚÖÃWebЧÀÍÆ÷¾ÙÐвâÊÔ £¬Ê¹ÓÃÒÔÏÂÏÂÁîÆô¶¯WebЧÀÍÆ÷£º

php think run

µÇ¼ºó¸´ÖÆ

ÈôÊÇûÓÐÎÊÌâ £¬¿É½«³ÌÐò°²Åŵ½Éú²úÇéÐÎÖС£

ËÄ¡¢×ܽá

±¾ÎÄÏÈÈÝÁËÔõÑùʹÓÃThinkPHP6¾ÙÐÐÎïÁ÷×·×Ù²Ù×÷¡£Í¨¹ý½¨ÉèÄ£×Ó¡¢¿ØÖÆÆ÷ºÍÊÓͼÎļþ £¬ÒÔ¼°¹ØÁªºÍÅÌÎʸ÷¸öÊý¾Ý±í £¬ÊµÏÖÁËÎïÁ÷×·×ÙϵͳµÄ»ù±¾¹¦Ð§¡£ËäÈ» £¬ÏÖʵµÄÎïÁ÷×·×ÙϵͳҪ±ÈÕâ¸öÖØ´óµÃ¶à £¬»¹ÐèÒªÉæ¼°¸ü¶àµÄÊÖÒÕºÍ֪ʶ¡£¿ÉÊDZ¾ÎÄÌṩµÄ˼Ð÷ºÍÒªÁì¿ÉÒÔΪʵÏÖ¸üÖØ´óµÄÎïÁ÷×·×ÙϵͳÌṩ²Î¿¼ºÍ½è¼ø¡£

ÒÔÉϾÍÊÇÔõÑùʹÓÃThinkPHP6¾ÙÐÐÎïÁ÷×·×Ù²Ù×÷ £¿µÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í尊龙凯时人生就是搏ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ尊龙凯时人生就是搏ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是搏

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
sitemap¡¢ÍøÕ¾µØͼ