$this->id, "from"=> UserApi::getByUuid($this->from), "to"=> UserApi::getByUuid($this->to), "url"=> $this->url, "content"=> $this->content, "content_type"=> $this->content_type, "res_type"=> $this->res_type, "res_id"=> $this->res_id, "status"=> $this->status, "created_at"=> $this->created_at, "updated_at"=> $this->updated_at, ]; switch ($this->res_type) { case 'suggestion': $prData = SentPr::where('uid',$this->res_id)->first(); if($prData){ $link = config('app.url')."/pcd/article/para/{$prData->book_id}-{$prData->paragraph}"; $link .= "?book={$prData->book_id}&par={$prData->paragraph}&channel={$prData->channel_uid}"; $link .= "&mode=edit&pr=".$this->res_id; $data['url'] = $link; } break; default: # code... break; } return $data; } }