Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @{$c->stash->{users}} = $c -> model('VpnDB::Users')->search({user => { like => "$params->{user}%"}},{join => 'packets' <- ???? })->all;
- Users.pm
- use strict;
- use warnings;
- use base 'DBIx::Class';
- __PACKAGE__->load_components("InflateColumn::DateTime", "Core");
- __PACKAGE__->table("users");
- __PACKAGE__->add_columns(
- "user",
- { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 64 },
- "password",
- { data_type => "VARCHAR", default_value => "*", is_nullable => 0, size => 254 },
- "crypt_method",
- { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 1 },
- "uid",
- { data_type => "BIGINT", default_value => undef, is_nullable => 0, size => 15 },
- "gid",
- { data_type => "BIGINT", default_value => 1, is_nullable => 0, size => 15 },
- "company",
- "modul",
- { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 3 },
- );
- __PACKAGE__->set_primary_key("uid");
- __PACKAGE__->has_one( 'packet' => 'Billing::Schema::VpnDB::Result::Packets', 'uid');
- Packets.pm
- use strict;
- use warnings;
- use base 'DBIx::Class';
- __PACKAGE__->load_components("InflateColumn::DateTime", "Core");
- __PACKAGE__->table("packets");
- __PACKAGE__->add_columns(
- "num",
- { data_type => "BIGINT", default_value => 0, is_nullable => 0, size => 15 },
- "packet",
- { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 128 },
- "prefix",
- { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 4 },
- "gid",
- { data_type => "BIGINT", default_value => undef, is_nullable => 0, size => 15 },
- "deposit",
- {
- data_type => "DOUBLE",
- default_value => "0.000000",
- is_nullable => 0,
- size => 64,
- },
- "credit",
- {
- data_type => "DOUBLE",
- default_value => "0.000000",
- is_nullable => 0,
- size => 64,
- },
- "tos",
- { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 1 },
- "do_with_tos",
- { data_type => "TINYINT", default_value => 1, is_nullable => 0, size => 1 },
- "direction",
- { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 1 },
- "fixed",
- { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 1 },
- "fixed_cost",
- {
- data_type => "DOUBLE",
- default_value => "0.000000",
- is_nullable => 0,
- size => 64,
- },
- "activated",
- { data_type => "TINYINT", default_value => 1, is_nullable => 0, size => 1 },
- "activation_time",
- { data_type => "INT", default_value => 2678400, is_nullable => 0, size => 10 },
- "blocked",
- { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 1 },
- "total_time_limit",
- { data_type => "BIGINT", default_value => 0, is_nullable => 0, size => 15 },
- "month_time_limit",
- { data_type => "BIGINT", default_value => 0, is_nullable => 0, size => 15 },
- "week_time_limit",
- { data_type => "BIGINT", default_value => 0, is_nullable => 0, size => 15 },
- "day_time_limit",
- { data_type => "BIGINT", default_value => 0, is_nullable => 0, size => 15 },
- "total_traffic_limit",
- { data_type => "BIGINT", default_value => 0, is_nullable => 0, size => 15 },
- "month_traffic_limit",
- { data_type => "BIGINT", default_value => 0, is_nullable => 0, size => 15 },
- "week_traffic_limit",
- { data_type => "BIGINT", default_value => 0, is_nullable => 0, size => 15 },
- "day_traffic_limit",
- { data_type => "BIGINT", default_value => 0, is_nullable => 0, size => 15 },
- "total_money_limit",
- {
- data_type => "DOUBLE",
- default_value => "0.000000",
- is_nullable => 0,
- size => 64,
- },
- "month_money_limit",
- {
- data_type => "DOUBLE",
- default_value => "0.000000",
- is_nullable => 0,
- size => 64,
- },
- "week_money_limit",
- {
- data_type => "DOUBLE",
- default_value => "0.000000",
- is_nullable => 0,
- size => 64,
- },
- "day_money_limit",
- {
- data_type => "DOUBLE",
- default_value => "0.000000",
- is_nullable => 0,
- size => 64,
- },
- "login_time",
- { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 254 },
- "pool_phone",
- { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 50 },
- "huntgroup_name",
- { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 64 },
- "simultaneous_use",
- { data_type => "SMALLINT", default_value => 0, is_nullable => 0, size => 5 },
- "port_limit",
- { data_type => "SMALLINT", default_value => 0, is_nullable => 0, size => 5 },
- "session_timeout",
- { data_type => "BIGINT", default_value => 0, is_nullable => 0, size => 15 },
- "idle_timeout",
- { data_type => "BIGINT", default_value => 0, is_nullable => 0, size => 15 },
- "allowed_prefixes",
- { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 64 },
- "framed_ip",
- { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 16 },
- "framed_mask",
- { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 16 },
- "no_pass",
- { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 1 },
- "no_acct",
- { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 1 },
- "allow_callback",
- { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 1 },
- "other_params",
- {
- data_type => "VARCHAR",
- default_value => "Acct-Interim-Interval = 60, Service-Type = Framed-User, Framed-Protocol = PPP, Framed-Compression = Van-Jacobson-TCP-IP",
- is_nullable => 0,
- size => 254,
- },
- "allowed_servers",
- {
- data_type => "VARCHAR",
- default_value => undef,
- is_nullable => 1,
- size => 254,
- },
- "uid",
- { data_type => "BIGINT", default_value => 0, is_nullable => 1, size => 15 },
- "create_system_user",
- { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 4 },
- "modul",
- { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 3 },
- );
- __PACKAGE__->set_primary_key("gid");
- __PACKAGE__->add_unique_constraint("packet", ["packet"]);
- __PACKAGE__->belongs_to( 'user' => 'Billing::Schema::VpnDB::Result::Users', 'uid');
Add Comment
Please, Sign In to add comment