Total Complexity | 4 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | class Followup extends Model |
||
10 | { |
||
11 | protected $table = 'trn_enquiry_followups'; |
||
12 | |||
13 | protected $fillable = [ |
||
14 | 'enquiry_id', |
||
15 | 'followup_by', |
||
16 | 'due_date', |
||
17 | 'status', |
||
18 | 'outcome', |
||
19 | 'created_by', |
||
20 | 'updated_by', |
||
21 | ]; |
||
22 | |||
23 | protected $dates = ['created_at', 'updated_at', 'due_date']; |
||
24 | |||
25 | public function Enquiry() |
||
28 | } |
||
29 | |||
30 | public function scopeReminders($query) |
||
31 | { |
||
32 | return $query->leftJoin('mst_enquiries','trn_enquiry_followups.enquiry_id','=','mst_enquiries.id') |
||
33 | ->select('trn_enquiry_followups.*','mst_enquiries.status') |
||
34 | ->where('trn_enquiry_followups.due_date','<=',Carbon::today()) |
||
35 | ->where('trn_enquiry_followups.status','=',\constFollowUpStatus::Pending) |
||
36 | ->where('mst_enquiries.status','=',\constEnquiryStatus::Lead); |
||
37 | } |
||
38 | |||
39 | public function createdBy() |
||
40 | { |
||
41 | return $this->belongsTo('App\User','created_by'); |
||
42 | } |
||
43 | |||
44 | public function updatedBy() |
||
47 | } |
||
48 | } |