CRMCallArchive.php
1.28 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
<?php namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Auth;
class CRMCallArchive extends Model{
protected $table = 'crmcalls_archive';
//protected $fillable = array('status','data','log','group');
public function getRecFilePath()
{
$file="";
$data=json_decode($this->data,true);
if(isset($data['recFolder']))
{
$file=storage_path("app/".$data['recFolder'])."/".$this->id.".".$data['recExt'];
}
return $file;
}
public function getRecFileExt()
{
$ext="";
$data=json_decode($this->data,true);
if(isset($data['recExt']))
{
$ext=$data['recExt'];
}
return $ext;
}
public function saveRecFileSize()
{
$fsize=0;
$data=json_decode($this->data,true);
if(isset($data['recFolder']))
{
$fpath=storage_path("app/".$data['recFolder'])."/".$this->id.".".$data['recExt'];
if(file_exists($fpath))$fsize=filesize($fpath);
}
$this->recsize=$fsize;
}
}