1.如果要写某个字段不为空,mysql的表达式应为:
假设字段为:door_open_api_key,
那么:door_open_api_key is not null AND door_open_api_key != ""
2. thinkphp中应写为
$Reserve_system = M('Reserve_system'); $where = array(); $where['door_open_api_key'] = array('exp',' is not null AND door_open_api_key != ""'); $reserve_systems = $Reserve_system->where($where)->select();