function subscribeList() { $this->beforeLogin(); $subscribes = \App\Model\Subscribe::whereUser($_SESSION['user']['name'])->whereStatus(0)->get(); $sourceIds = []; foreach ($subscribes as $v) { $sourceIds[] = $v->source; } $sourceList = \App\Model\Source::orderBy('id', 'desc')->get(); return view('subscribe/list', ['sourceList' => $sourceList, 'sourceIds' => $sourceIds]); }
/** * @param bool $shade * @return string */ public function getColor($shade = false) { return Color::GetRandomColor(Source::$colors[$this->source->getId()], $shade); }