200], [['city_name'], 'required','message'=>'城市名称不能为空'], [['city_name'], 'unique','message'=>'城市不能重复'], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'ip' => 'Ip', 'city_name' => '城市名称', ]; } /** * 返回ip数组 * 返回ip数组 * @param 参数 * @return 返回类型 * @author liukangle * */ static public function getIpArray(){ $list = self::find() ->where('status = 1') ->orderBy('id ASC') ->all(); $array = ArrayHelper::getColumn($list,'ip'); return $array; } }