尊龙凯时人生就是博

ÔõÑùÓÃthinkphp mÒªÁìʵÏÖ¶à±íÅÌÎÊ

Ò»¡¢Ê²Ã´ÊǶà±íÅÌÎÊ

ÔÚÊý¾Ý¿âÖÐ £¬ÓÐʱÎÒÃÇÐèÒªÅÌÎʶà¸öÊý¾Ý±íÖ®¼äµÄÊý¾Ý¹Øϵ £¬Õâ¾ÍÐèҪʹÓöà±íÅÌÎÊ¡£Ò»Ñùƽ³£ÇéÐÎÏ £¬ÎÒÃÇ¿ÉÒÔʹÓöà¸öSELECTÓï¾äÀ´ÊµÏÖ¶à±íÅÌÎÊ £¬µ«ÕâÖÖ·½·¨ÔÚ´¦Àí´ó×ÚÊý¾Ýʱ»áºÜÂý £¬Òò´ËÎÒÃÇÐèҪʹÓøü¸ßЧµÄ·½·¨¾ÙÐжà±íÅÌÎÊ¡£

¶þ¡¢thinkphp MÒªÁì¶à±íÅÌÎʵÄʵÏÖ

ÔÚthinkphpÖÐ £¬ÎÒÃÇ¿ÉÒÔʹÓÃMÒªÁìÀ´ÊµÏÖ¶à±íÅÌÎÊ¡£MÒªÁìÊÇÒ»ÖÖ¸ßЧµÄORM£¨¹¤¾ß¹ØϵӳÉ䣩·½·¨ £¬Ëü¿ÉÒÔ×ÊÖúÎÒÃÇ·â×°SQLÓï¾ä £¬´Ó¶ø¸üÀû±ãµØ¾ÙÐÐÊý¾Ý´¦Àí¡£

1.»ù´¡Ê¹ÓÃÒªÁ죺

ʹÓÃMÒªÁì¾ÙÐжà±íÅÌÎÊÊ®·Ö¼òÆÓ £¬ÎÒÃÇÖ»ÐèÒªÔÚʹÓÃMÒªÁìʱ´«Èë¶à¸ö±íÃû £¬¾Í¿ÉÒÔʵÏÖ¶à±íÅÌÎÊ¡£

ÀýÈçÎÒÃÇÓÐÁ½¸öÊý¾Ý±í£ºuserºÍorder £¬ÏÖÔÚÎÒÃÇÐèÒªÅÌÎÊuser±íºÍorder±íÖеÄÊý¾Ý¹Øϵ £¬ÎÒÃÇ¿ÉÒÔÕâÑù×ö£º

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

$user_order = M('User')->table(array('user'=>'u','order'=>'o'))->where('u.id = o.user_id')->select();

µÇ¼ºó¸´ÖÆ

ÉÏÊö´úÂëÖÐ £¬ÎÒÃÇʹÓÃÁËtableÒªÁì²¢´«ÈëÁ˶à¸ö±íÃû £¬Í¨¹ýwhereÒªÁìÀ´Ö¸¶¨Á½¸öÊý¾Ý±íÖ®¼äµÄ¹Øϵ £¬×îºóʹÓÃselectÒªÁìÀ´»ñÈ¡ÅÌÎÊЧ¹û¡£

2.¶àÌõ¼þÅÌÎÊ£º

ÔÚ¾ÙÐжà±íÅÌÎÊʱ £¬ÎÒÃÇͨ³£ÐèÒªÖ¸¶¨¶à¸öÅÌÎÊÌõ¼þ £¬ÎÒÃÇ¿ÉÒÔʹÓÃÆ´½Ó×Ö·û´®µÄ·½·¨À´ÊµÏÖ¶àÌõ¼þÅÌÎÊ £¬Ò²¿ÉÒÔʹÓÃÊý×éµÄ·½·¨À´ÊµÏÖ¶àÌõ¼þÅÌÎÊ¡£

ÀýÈçÎÒÃÇÐèÒªÅÌÎÊuser±íÖÐÐÔ±ðΪÄÐÐÔ£¨gender=1£©µÄÓû§ºÍuser±íÖеĶ©µ¥ÐÅÏ¢ £¬ÎÒÃÇ¿ÉÒÔÕâÑù×ö£º

$user_order = M('User')->table(array('user'=>'u','order'=>'o'))->where(array('u.gender'=>1,'u.id=o.user_id'))->select();

µÇ¼ºó¸´ÖÆ

ÉÏÊö´úÂëÖÐ £¬ÎÒÃÇʹÓÃÁËwhereÒªÁì²¢´«ÈëÁËÅÌÎÊÌõ¼þÊý×é £¬¸ÃÊý×éÖаüÀ¨ÁËÁ½¸öÅÌÎÊÌõ¼þ £¬ÆäÖÐÒ»¸öÊÇÅÌÎÊÐÔ±ðΪÄÐÐÔµÄÓû§ £¬ÁíÒ»¸öÊÇÅÌÎʶ©µ¥ÐÅÏ¢¡£

3.¶à±íÅÅÐò£º

ÔÚ¾ÙÐжà±íÅÌÎÊʱ £¬ÎÒÃÇÓÐʱÐèÒª¶ÔÅÌÎÊЧ¹û¾ÙÐÐÅÅÐò £¬ÎÒÃÇ¿ÉÒÔʹÓÃorderÒªÁìÀ´¾ÙÐжà±íÅÅÐò¡£

ÀýÈçÎÒÃÇÐèÒªÅÌÎÊuser±íÖеÄÓû§ºÍorder±íÖеĶ©µ¥ £¬²¢Æ¾Ö¤¶©µ¥½ð¶î¾ÙÐÐÅÅÐò £¬ÎÒÃÇ¿ÉÒÔÕâÑù×ö£º

$user_order = M('User')->table(array('user'=>'u','order'=>'o'))->where('u.id=o.user_id')->order('o.amount desc')->select();

µÇ¼ºó¸´ÖÆ

ÉÏÊö´úÂëÖÐ £¬ÎÒÃÇʹÓÃÁËorderÒªÁì²¢´«ÈëÁËÅÅÐòÌõ¼þ £¬¸ÃÌõ¼þÊÇƾ֤¶©µ¥½ð¶î¾ÙÐÐÅÅÐòµÄ¡£

ÒÔÉϾÍÊÇÔõÑùÓÃthinkphp mÒªÁìʵÏÖ¶à±íÅÌÎʵÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

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

13452372176

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

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

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