尊龙凯时人生就是博

ÔõôʹÓÃThinkPHP5¾ÙÐÐÊý¾Ý¿âÅÌÎÊÅÅÐò

ÔÚ¾ÙÐÐÊý¾Ý¿âÅÌÎÊʱ £¬ÅÅÐòÊÇÒ»¸ö³£¼ûµÄÐèÇó¡£Êý¾ÝÅÅÐò¿ÉÒÔʹÎÒÃÇÔ½·¢Àû±ãµØÃ÷È·Êý¾ÝµÄ¼ÄÒå £¬²¢¾ÙÐÐÆÊÎö¡£¹ØÓÚThinkPHP5 £¬¿ÉÒÔͨ¹ýŲÓÃorder()ÒªÁì¶ÔÅÌÎÊЧ¹û¾ÙÐÐÅÅÐò¡£

Ê×ÏÈ £¬ÎÒÃÇÐèÒªÃ÷È·order()ÒªÁìµÄ»ù±¾Óï·¨¡£ order()ÒªÁìʹÓÃÒÔÏÂÐÎʽ£º

->order('×Ö¶Î1 DESC,×Ö¶Î2 ASC')

µÇ¼ºó¸´ÖÆ

ÆäÖÐ £¬DESCÌåÏÖ½µÐòÅÅÁÐ £¬ASCÌåÏÖÉýÐòÅÅÁС£

ʾÀý£º

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

$data = Db::table('user')->where('age', '>', 18)->order('age DESC,name ASC')->select();

µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ

ÔÚÉÏÃæµÄʾÀýÖÐ £¬ÎÒÃÇ´Ó user Êý¾Ý±íÖÐÑ¡ÔñÄêËê´óÓÚ18ËêµÄÓû§ £¬²¢°´ÄêËê¾ÙÐнµÐòÅÅÁÐ £¬°´ÐÕÃû¾ÙÐÐÉýÐòÅÅÁС£

ÎÒÃÇÒ²¿ÉÒÔ¼òÆÓµØת´ïÐèÒªÅÅÐòµÄ×Ö¶ÎÃû£º

$data = Db::table('user')->where('age', '>', 18)->order('age DESC')->select();

µÇ¼ºó¸´ÖÆ

ÈôÊÇÏëÔÚ¶à¸ö×Ö¶ÎÖ®¼äת´ï £¬Ê¹ÓöººÅÀë¸ô£º

$data = Db::table('user')->where('age', '>', 18)->order('age DESC,name ASC')->select();

µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ

ÎÒÃÇ»¹¿ÉÒÔÏñÕâÑù¶ÔЧ¹û¾ÙÐзÖÒ³£º

$data = Db::table('user')->where('age', '>', 18)->order('age DESC')->paginate(10);

µÇ¼ºó¸´ÖÆ

ÉÏÃæµÄʾÀýÖÐ £¬ÎÒÃǽ«Ð§¹û·ÖΪÿҳ10Ìõ¼Í¼ £¬ÒÔ±ã¸üºÃµØ´¦Àí´óÐÍÊý¾Ý¼¯¡£

ÒÔÉϾÍÊÇÔõôʹÓÃThinkPHP5¾ÙÐÐÊý¾Ý¿âÅÌÎÊÅÅÐòµÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

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

18523999891

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

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

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