quanwei
2 days ago 04102f7237efefa744090ed7c25f7b5d0807b679
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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();
    }
 
}