<?php
/**
 * Created by PhpStorm.
 * User: 30868
 * Date: 2018/9/13
 * Time: 23:24
 */

namespace app\common\model;

use app\common\model\BaseModel;
use traits\model\SoftDelete;
use app\common\model\Project as ProjectModel;

class Tags extends BaseModel
{
    use SoftDelete;
    // 设置当前模型对应的完整数据表名称
    protected $table = 'mr_tags';

    public function getUsedAttr($value,$data){
      return ProjectModel::where('tags','like',"%".'|'.$data['id'].'|'."%")->count();
    }

}
