admin/app/common/model/release/ReleaseProjectTag.php
New file
@@ -0,0 +1,47 @@
<?php
namespace app\common\model\plus\release;
use app\common\model\BaseModel;
/**
 * 图片模型
 */
class ReleaseProjectTag extends BaseModel
{
    protected $name = 'release_project_tag';
    protected $pk = 'id';
    protected $updateTime = false;
    /**
     * 关联
     */
    public function tag()
    {
        return $this->belongsTo('app\\common\\model\\plus\\release\\Tag', 'tag_id', 'tag_id')
            ->bind(['name']);
    }
    public static function getTagId($project_id)
    {
        $model = new static;
        return $model
            ->where('project_id', '=', $project_id)
            ->column("tag_id");
    }
    public static function getTagName($project_id)
    {
        $model = new static;
        return $model->with('tag')
            ->where('project_id', '=', $project_id)
            ->select();
    }
    public static function getTagList($project_id)
    {
        $model = new static;
        return $model->with(['tag'])
            ->where('project_id', '=', $project_id)
            ->select();
    }
}