Untitled

mail@pastecode.io avatar
unknown
php_laravel_blade
2 years ago
2.4 kB
2
Indexable
Never
            $data = Item::when($vnum, function($query, $vnum){
                $query->where('vnum', $vnum);
            })
            ->when($count, function($query, $count){
                $query->where('count', $count);
            })
            ->when($attrtype0, function($query, $attrtype0){
                $query->where('attrtype0', $attrtype0);
            })
            ->when($attrvalue0, function($query, $attrvalue0){
                $query->where('attrvalue0', $attrvalue0);
            })
            ->when($attrtype1, function($query, $attrtype1){
                $query->where('attrtype1', $attrtype1);
            })
            ->when($attrvalue1, function($query, $attrvalue1){
                $query->where('attrvalue1', $attrvalue1);
            })
            ->when($attrtype2, function($query, $attrtype2){
                $query->where('attrtype2', $attrtype2);
            })
            ->when($attrvalue2, function($query, $attrvalue2){
                $query->where('attrvalue2', $attrvalue2);
            })
            ->when($attrtype3, function($query, $attrtype3){
                $query->where('attrtype3', $attrtype3);
            })
            ->when($attrvalue3, function($query, $attrvalue3){
                $query->where('attrvalue3', $attrvalue3);
            })
            ->when($attrtype4, function($query, $attrtype4){
                $query->where('attrtype4', $attrtype4);
            })
            ->when($attrvalue4, function($query, $attrvalue4){
                $query->where('attrvalue4', $attrvalue4);
            })
            ->when($attrtype5, function($query, $attrtype5){
                $query->where('attrtype5', $attrtype5);
            })
            ->when($attrvalue5, function($query, $attrvalue5){
                $query->where('attrvalue5', $attrvalue5);
            })
            ->when($attrtype6, function($query, $attrtype6){
                $query->where('attrtype6', $attrtype6);
            })
            ->when($attrvalue6, function($query, $attrvalue6){
                $query->where('attrvalue6', $attrvalue6);
            })
            ->join('account.account', 'item.owner_id', '=', 'account.id')
            ->join('player.player', 'item.owner_id', '=', 'player.id')
            ->select('player.name as pname', 'account.login as acclogin', 'item.*')
            ->limit(100)
            ->get();