File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ public function isNew()
9999 */
100100 public function scopeActive ($ query )
101101 {
102- $ query = $ query ->whereNull ( ' completed_at ' );
102+ $ query = $ query ->notComplete ( );
103103
104104 if (is_null (auth ()->user ()) or \PanicHDMember::find (auth ()->user ()->id )->currentLevel () < 2 ) {
105105 return $ query ;
@@ -118,14 +118,24 @@ public function scopeComplete($query)
118118 return $ query ->whereNotNull ('completed_at ' );
119119 }
120120
121+ /**
122+ * List of NOT completed tickets.
123+ *
124+ * @return Collection
125+ */
126+ public function scopeNotComplete ($ query )
127+ {
128+ return $ query ->whereNull ('completed_at ' );
129+ }
130+
121131 /**
122132 * List of new tickets (active with status "new").
123133 *
124134 * @return Collection
125135 */
126136 public function scopeNewest ($ query )
127137 {
128- return $ query ->whereNull ( ' completed_at ' )->where ('status_id ' , Setting::grab ('default_status_id ' ));
138+ return $ query ->notComplete ( )->where ('status_id ' , Setting::grab ('default_status_id ' ));
129139 }
130140
131141 /**
You can’t perform that action at this time.
0 commit comments