第一种: $res =Db::name('channel')->where('(fenlei=15 AND add_time > '.strtotime("-5 min").')')->fetchSql()->select(); 第二种: $where = [ [ ['status','=',2], ['fenlei','=',15], ['account','=',$results[$k]['account']], ], [ ['status','=',3], ['fenlei','=',15], ['account','=',$results[$k]['account']], ], ]; $m = Db::name('channel')->fieldRaw('SUM(money)')->whereOr($where)->find();
标签:account,15,技巧,fenlei,results,查询,mysql,where From: https://www.cnblogs.com/kevin-yang123/p/17097628.html