thinkphp where 查询比较相同一个表中两个字段值

时间:2022-04-08 15:08:42
$where['status'] = array('eq',2);
		$Bills = D("order");
		$list = $Bills->where($where)->where('months>donemonth')->select();
注意,比较一个表中的两个字段值,不可以这样写$where['months'] = array('gt',"donemonth");
这样,会把donemonth当成一个已值的值来看待.必须用thinkphp的多次调用功能.即上面的双where的直接字符串的用法