ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
~~~ public function _filter(&$map) { if (!in_array(session('uid'), C('ADMINISTRATOR'))) { } if (isset($_REQUEST['status']) && $_REQUEST['status'] != '') { $map['status'] = array('EQ', urldecode(I('status'))); } if (isset($_REQUEST['store']) && $_REQUEST['store'] != '') { $map['store'] = array('EQ', urldecode(I('store'))); } if (isset($_REQUEST['gid']) && $_REQUEST['gid'] != '') { $map['gid'] = array('EQ', urldecode(I('gid'))); } if (isset($_REQUEST['id']) && $_REQUEST['id'] != '') { $map['gid'] = array('EQ', I('id')); } if (isset($_REQUEST['barcode']) && $_REQUEST['barcode'] != '') { $map['barcode'] = array('EQ', I('barcode')); } } ~~~ ~~~ public function _filter(&$map){ if (!empty($map['code'])) $map['code'] = array('like', '%'.$map['code'].'%'); if (!empty($map['name'])) $map['name'] = array('like', '%'.$map['name'].'%'); } ~~~ 时间查询 ~~~ <input type='text' data-toggle='datepicker' value='{$_REQUEST['time1']}' name='time1' class='form-control' size='10' placeholder="起始时间"/> - <input type='text' data-toggle='datepicker' value='{$_REQUEST['time2']}' name='time2' class='form-control' size='10' placeholder="结束时间"/> &nbsp; ~~~ ~~~ if (isset($_REQUEST['time1']) && $_REQUEST['time1'] != '' && isset($_REQUEST['time2']) && $_REQUEST['time2'] != '') {$map['addtime'] = array(array('egt', I('time1') . ' 00:00:00'), array('elt', I('time2') . ' 59:59:59'));} ~~~