<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/9/20
 * Time: 13:37
 */

namespace app\common\model;
use app\common\model\Tags as TagsModel;

class Guide extends BaseModel
{
    protected $table = 'mr_guides';

    //标签处理
    public function getTagsAttr($value)
    {
        $tags = explode(',',$value);
        return TagsModel::where('id','in',$tags)
            ->order('sort','desc')
            ->column('name');
    }
}