where([ ['partner_id', $partner_id], ['uid', $uid] ])->exists() ) { return 100; } $listModel = new BuyInviteListModel(); $list = $listModel->where([ ['uid', $uid], ['partner_id', $partner_id] ])->first(); if (collect($list)->isEmpty()) { return 0; } else { $cnt = $this->where([ ['invite_id', $list->id], ['state', 0] ])->sum('dis_score'); return $cnt; } } }