比较相同一个表中两个字段值

 直接看代码:
  1. $where['status'] = array('eq',2);  
  2.         $Bills = D("order");  
  3.         $list = $Bills->where($where)->where('months>donemonth')->select();  

  需要注意的是:下面这样写是错误的:$where['months'] = array('gt',"donemonth");  thinkphp会直接把donemonth当成一个已知的值!

原文地址:https://www.cnblogs.com/crazytata/p/8427864.html