fix check quyền user admin ở page ticket and tracking
This commit is contained in:
		
							parent
							
								
									b9ecfa5da2
								
							
						
					
					
						commit
						ebe031afac
					
				| 
						 | 
				
			
			@ -223,7 +223,6 @@ class TicketController extends Controller
 | 
			
		|||
        $formattedEndDate = Carbon::createFromFormat('Y-m-d', $endDate)->format('d/m/Y');
 | 
			
		||||
        
 | 
			
		||||
        $user = auth('admins')->user();
 | 
			
		||||
 | 
			
		||||
        $ticket = Ticket::create([
 | 
			
		||||
            'start_date' => Carbon::create($startDate)->setTimezone(env('TIME_ZONE')),
 | 
			
		||||
            'start_period' => $startPeriod,
 | 
			
		||||
| 
						 | 
				
			
			@ -236,7 +235,7 @@ class TicketController extends Controller
 | 
			
		|||
        ]);
 | 
			
		||||
 | 
			
		||||
        // Send notification email to admin (list)
 | 
			
		||||
        $admins = Admin::where('permission', 'admin')->get();
 | 
			
		||||
        $admins = Admin::where('permission', 'like', '%admin%')->get();
 | 
			
		||||
        foreach ($admins as $key => $value) {
 | 
			
		||||
            $data = array(
 | 
			
		||||
                "email_template" => "email.notification_tickets",
 | 
			
		||||
| 
						 | 
				
			
			@ -379,7 +378,6 @@ class TicketController extends Controller
 | 
			
		|||
 | 
			
		||||
            $this->createOrUpdateRecordForCurrentMonth($month, $year);
 | 
			
		||||
 | 
			
		||||
            // $admins = Admin::where('permission', 'admin')->get();
 | 
			
		||||
            // Send notification email to users
 | 
			
		||||
            $data = array(
 | 
			
		||||
                "email_template" => "email.notification_tickets_user",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -67,7 +67,8 @@ class TrackingController extends Controller
 | 
			
		|||
            ['status' => true]
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $users = Admin::where('permission', '!=', 'admin')->get();
 | 
			
		||||
        // $users = Admin::where('permission', '!=', 'admin')->get();
 | 
			
		||||
        $users = Admin::where('permission', 'not like', '%admin%')->get();
 | 
			
		||||
        $responseData['users'] = $users;
 | 
			
		||||
        return response()->json($responseData);
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue