$where['_string'] = '`has_number` < `number`';//~~~注意:这里`不能丢了; $coupon_flag = $coupon->where($where)->order('id desc')->field('id,name,type,conditions,price,number,has_number')->select(); 生成的sql语句: `id`,`name`,`type`,`conditions`,`price`,`number`,`has_number` FROM `tf_coupon` WHERE ( `has_number` < `number` ) ORDER BY id desc