// +---------------------------------------------------------------------- namespace App\Models; /** * 友链管理-模型 * @author laravel开发员 * @since 2020/11/11 * Class LinkModel * @package App\Models */ class LinkModel extends BaseModel { // 设置数据表 protected $table = 'link'; /** * 获取记录信息 * @param int $id 记录ID * @return array|string * @author laravel开发员 * @since 2020/11/11 */ public function getInfo($id) { $info = parent::getInfo($id); // TODO: Change the autogenerated stub if ($info) { // 友链图片 if ($info['image']) { $info['image'] = get_image_url($info['image']); } // 获取栏目名称 if ($info['cate_id']) { $itemCateModel = new ItemCateModel(); $itemCateName = $itemCateModel->getCateName($info['cate_id'], ">>"); $info['item_cate_name'] = $itemCateName; } } return $info; } }