dataRange() ->catchSearch() ->append(['school_name', 'building_name', 'floor_name', 'push_text', 'throttling_text', 'orientation_text','command']) ->order($this->aliasField($field), $order) ->paginate(); return $res; } /** * 获取所有基站数据(no limit) */ public function getRangeData(){ $res = $this->dataRange() ->catchSearch() ->append(['area_id','province_name','city_name','district_name','school_name','access_name','building_name','floor_name','push_text','throttling_text','orientation_text']) ->order($this->aliasField('id'), 'desc') ->select(); return $res; } /** * 检测基站MAC格式是否正确 */ public function checkStationMacFormat($mac) { $mac = strtoupper(trim($mac)); $regex = "/^([A-F0-9]{12})$/"; if (!preg_match($regex, $mac)) { return false; } return true; } /** * 检测设备mac是否重复 */ public function isStationMacDuplicate($mac, $id = '') { $cond = [['station_mac', '=', strtoupper(trim($mac))]]; if ($id) { $cond[] = ['id', '<>', $id]; } return $this->where($cond)->count(); } /** * 导出基站列表 * */ public function getExportList() { $res = $this->dataRange() ->catchSearch() ->append(['area_id', 'province_name', 'city_name', 'district_name', 'school_name', 'access_name', 'building_name', 'floor_name', 'push_text', 'throttling_text', 'orientation_text']) ->order($this->aliasField('id'), 'desc') ->select(); return $res; } }