* @version : HUOSDK 8.0 */ namespace huo\controller\common; use huolib\constant\CommonConst; class Device { public static function ins() { return new static(); } /** * 判断是否是黑名单列表 * * @param string $device * * @return bool true 为黑名单 false 为不在黑名单中 */ public static function isBlackList($device = '') { if (empty($device)) { return false; } return false; } /** * 判断在某个时间段内设备是否存在 * * @param string $device * @param string $date * * @return bool */ public static function isRepeat($device, $date = '') { if (empty($device)) { return false; } $_date = $date; if (empty($date)) { $_map['create_time'] = ['gt', 0]; } else { $_start_time = strtotime($_date); if (empty($_start_time)) { return false; } $_end_time = $_start_time + CommonConst::CONST_DAY_SECONDS; $_map['create_time'] = ['between', $_start_time, $_end_time]; } // $_map['device'] = $device; // // TODO: wuyonghong 2018/5/31 添加设备每日 与设备总表 // $_model = new CommonModel(); // $_cnt = $_model->where($_map)->count(); // if (empty($_cnt)) { // return false; // } return true; } }