tp5.1 高级查询之 表里2字段比较大小

$map = [
'status' => 1,
'is_show' => 1,
];

$result = Db::name('coupon')
->where($map)
->where('total_number','exp',Db::raw('>`send_number`'))
->whereTime('end_time','>=',time())
->limit('2')
->select();
原文地址:https://www.cnblogs.com/pansidong/p/9626776.html