| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 | <?php/** * Device.php UTF-8 * * * @date    : 2018/5/31 20:03 * * @license 这不是一个自由软件,未经授权不许任何使用和传播。 * @author  : wuyonghong <wyh@huosdk.com> * @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;    }}
 |