$where = [];
$where[]=[‘snno‘,‘>=‘,$data[‘start_sn‘]];
$where[]=[‘snno‘,‘<=‘,$data[‘end_sn‘]];
$res = Db::name(‘pos‘)->where($where)->field(‘id,snno‘)->select();
区间查询:
ps:数据表包含空格,会导致查询的结果与实际结果不同,注意保证数据表内数据正确。
原文:https://www.cnblogs.com/jigr/p/14857512.html