-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVoip.php
More file actions
36 lines (29 loc) · 948 Bytes
/
Voip.php
File metadata and controls
36 lines (29 loc) · 948 Bytes
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
<?php
namespace App\Models\Setting;
use Illuminate\Database\Eloquent\Model;
class Voip extends Model
{
const STATUS_INIT = 'INIT';
const STATUS_CHECKING = 'CHECKING';
const STATUS_SUCCESS = 'SUCCESS';
protected $table = 'setting_voip';
protected $fillable = ['team_id', 'status', 'number', 'bind_number', 'worktime',
'offworkweekday', 'offworkdate', 'offworkprompt', 'display_number', 'display_number_status', 'display_number_files'];
protected $casts = [
'id' => 'integer',
'team_id' => 'integer'
];
public function team()
{
return $this->belongsTo(\App\Models\Team::class);
}
public function getDisplayNumberFilesAttribute($json)
{
$arr = json_decode($json, true);
return $arr ? $arr : [];
}
public function setDisplayNumberFilesAttribute($array)
{
$this->attributes['display_number_files'] = json_encode($array);
}
}