@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Dingo\Api\Http; |
| 6 | 6 | use Dingo\Api\Routing\Helpers; |
| 7 | -use App\User; |
|
| 8 | 7 | use App\Notification; |
| 9 | 8 | use App\NotificationAttrib; |
| 10 | 9 | use Illuminate\Http\Request; |
@@ -27,11 +27,11 @@ |
||
| 27 | 27 | if ($type === 'archive') |
| 28 | 28 | { |
| 29 | 29 | //$notifications = Notification::read([$request->user()->user_id])->limit()->get(); |
| 30 | - $notifications = Notification::select('notifications.*','key')->leftJoin('notifications_attribs', 'notifications.notifications_id', '=', 'notifications_attribs.notifications_id')->where('user_id', $user_id)->where(['key'=>'read', 'value'=> 1]); |
|
| 30 | + $notifications = Notification::select('notifications.*', 'key')->leftJoin('notifications_attribs', 'notifications.notifications_id', '=', 'notifications_attribs.notifications_id')->where('user_id', $user_id)->where(['key'=>'read', 'value'=> 1]); |
|
| 31 | 31 | } |
| 32 | 32 | else { |
| 33 | 33 | //$notifications = Notification::unread()->limit()->get(); |
| 34 | - $notifications = Notification::select('notifications.*','key')->leftJoin('notifications_attribs', 'notifications.notifications_id', '=', 'notifications_attribs.notifications_id')->whereNull('user_id')->orWhere(['key'=>'sticky', 'value'=> 1])->get(); |
|
| 34 | + $notifications = Notification::select('notifications.*', 'key')->leftJoin('notifications_attribs', 'notifications.notifications_id', '=', 'notifications_attribs.notifications_id')->whereNull('user_id')->orWhere(['key'=>'sticky', 'value'=> 1])->get(); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | if ($request->query('displayFormat') == 'human') { |
@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use Dingo\Api\Http; |
| 6 | 6 | use Dingo\Api\Routing\Helpers; |
| 7 | 7 | use Illuminate\Http\Request; |
| 8 | -use JavaScript; |
|
| 9 | 8 | |
| 10 | 9 | class NotificationController extends Controller |
| 11 | 10 | { |