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

 直接看代码:
  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当成一个已知的值!

posted @ 2018-02-07 18:03  tatasix  阅读(230)  评论(0编辑  收藏  举报