TicketProject.php
1.3 KB
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
48
49
50
51
52
53
54
55
56
<?php
namespace App\Models\WorkOrder;
use App\Models\Base;
use App\Models\Manage\Manage;
use App\Models\Project\Project;
use App\Models\ProjectAssociation\ProjectAssociation;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class TicketProject extends Base
{
use HasFactory;
protected $table = 'gl_ticket_projects';
public function projectV6()
{
return $this->hasOne(Project::class, 'id', 'table_id')
->where('version', 6);
}
//售后服务经理
public function assm()
{
return $this->hasOne(Manage::class, 'id', 'assm_id')
->select(['id', 'name']);
}
// 优化师
public function seom()
{
return $this->hasOne(Manage::class, 'id', 'seom_id')
->select(['id', 'name']);
}
/**
* 第一负责人
*/
public function first_engineer()
{
return $this->hasOne(Manage::class, 'id', 'engineer_id')
->select(['id', 'name']);
}
/**
* 绑定的企微群
*/
public function association()
{
return $this->hasOne(ProjectAssociation::class, 'project_id', 'table_id')
->where('status', 1)
->where('binding_app', ProjectAssociation::ENTERPRISE_WECHAT)
->select(['id', 'project_id', 'friend_id', 'binding_app']);
}
}