$item->id, 'title' => $item->title, 'link' => $item->link, 'desc' => $item->desc, 'time_delay' => $item->time_delay, 'user_type' => $item->user_type, 'chapter_name' => $this->getLabel($item->chapter_name), 'book_name' => $this->getLabel($item->book_name), 'type' => $item->link_type, 'uv' => isset($item->uv) ? $item->uv : 0, 'pv' => isset($item->pv) ? $item->pv : 0, 'pay_user_num' => isset($item->pay_user_num) ? $item->pay_user_num : 0, 'charge_amount' => isset($item->charge_amount) ? $item->charge_amount : 0, ]; } public function getLabel(string $str) { $obj = json_decode($str); return isset($obj->label) ? $obj->label : ""; } }