| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function fetch() |
||
| 19 | { |
||
| 20 | $list=DB::table($this->table)->orderBy('created_at','desc')->get()->all(); |
||
| 21 | if (empty($list)) { |
||
| 22 | return []; |
||
| 23 | } |
||
| 24 | foreach ($list as &$item) { |
||
| 25 | $notice_author=DB::table("users")->where(["id"=>$item["uid"]])->first(); |
||
| 26 | $item["name"]=$notice_author["name"]; |
||
| 27 | $item["avatar"]=$notice_author["avatar"]; |
||
| 28 | $item["post_date_parsed"]=formatHumanReadableTime($item["created_at"]); |
||
| 29 | $item["content_parsed"]=clean(convertMarkdownToHtml($item["content"])); |
||
| 30 | } |
||
| 31 | return $list; |
||
| 32 | } |
||
| 34 |