Sspd.php
907 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
37
38
39
40
41
42
43
<?php
/**
* @Author: irul
* @Date: 2019-09-20 22:59:14
* @Last Modified by: irul
* @Last Modified time: 2019-10-01 23:43:21
*/
namespace Integrasi\Reklame\Base\Models;
use \Illuminate\Database\Capsule\Manager as DB;
class Sspd extends AbstractModel
{
protected $table = 'pad_sspd';
public $timestamps = false;
// == ACCESSORS == //
public function getSspdnoAttribute($value)
{
$qry = "select get_sspdno(?) as sspdno";
$row = DB::select(DB::raw($qry), array($this->attributes['spt_id']));
return $row[0]->sspdno;
}
public function getSspdtglAttribute()
{
return date('Y-m-d H:i:s', strtotime($this->attributes['sspdtgl']));
}
public function getCreateDateAttribute()
{
return date('Y-m-d H:i:s', strtotime($this->attributes['create_date']));
}
public function getWriteDateAttribute()
{
return date('Y-m-d H:i:s', strtotime($this->attributes['write_date']));
}
}