|
@@ -42,7 +42,7 @@ class UserTableSeeder extends Seeder {
|
42
|
42
|
$first_name = strtoupper(trim($data[1]));
|
43
|
43
|
$surnames = strtoupper(trim($data[2]));
|
44
|
44
|
$email = strtolower(trim($data[3]));
|
45
|
|
- // $emp_number = strtolower(trim($data[5]));
|
|
45
|
+ $emp_number = strtolower(trim($data[4]));
|
46
|
46
|
|
47
|
47
|
// Program unavailable.For the moment, I'm setting it to null, but it should eventually be the commented line below
|
48
|
48
|
// $program_id = trim($data[4]);
|
|
@@ -77,6 +77,7 @@ class UserTableSeeder extends Seeder {
|
77
|
77
|
'first_name' => $first_name,
|
78
|
78
|
'surnames' => $surnames,
|
79
|
79
|
'email' => $email,
|
|
80
|
+ 'number' => $emp_number,
|
80
|
81
|
// 'program_id' => $program_id, //should change when I know how this info will be given
|
81
|
82
|
'has_access' => 1,
|
82
|
83
|
'updated_at' => date("Y-m-d H:i:s", time()),
|
|
@@ -85,16 +86,16 @@ class UserTableSeeder extends Seeder {
|
85
|
86
|
$this->command->info('Updated (via ssn): '.$email.': '.$surnames.', '.$first_name);
|
86
|
87
|
$updated++;
|
87
|
88
|
}
|
88
|
|
-
|
89
|
|
- // If user exists by name and last names, update information and add to updated
|
90
|
|
- elseif(User::where('first_name', $first_name)->where('surnames', $surnames)->count())
|
|
89
|
+ // If user exists by employee number, update information and add to updated
|
|
90
|
+ elseif(User::where('number', $emp_number)->count())
|
91
|
91
|
{
|
92
|
92
|
DB::table('users')
|
93
|
|
- ->where('first_name', ($first_name))
|
94
|
|
- ->where('surnames', ($surnames))
|
|
93
|
+ ->where('number', ($emp_number))
|
95
|
94
|
->update(array(
|
96
|
95
|
'ssn' => $ssn,
|
97
|
96
|
'email' => $email,
|
|
97
|
+ 'first_name' => $first_name,
|
|
98
|
+ 'surnames' => $surnames,
|
98
|
99
|
// 'program_id' => $program_id, //should change when I know how this info will be given
|
99
|
100
|
'has_access' => 1,
|
100
|
101
|
'updated_at' => date("Y-m-d H:i:s", time()),
|
|
@@ -112,6 +113,7 @@ class UserTableSeeder extends Seeder {
|
112
|
113
|
'ssn' => $ssn,
|
113
|
114
|
'first_name' => $first_name,
|
114
|
115
|
'surnames' => $surnames,
|
|
116
|
+ 'number' => $emp_number,
|
115
|
117
|
// 'program_id' => $program_id, //should change when I know how this info will be given
|
116
|
118
|
'has_access' => 1,
|
117
|
119
|
'updated_at' => date("Y-m-d H:i:s", time()),
|
|
@@ -120,7 +122,6 @@ class UserTableSeeder extends Seeder {
|
120
|
122
|
$this->command->info('Updated (via email): '.$email.': '.$surnames.', '.$first_name);
|
121
|
123
|
$updated++;
|
122
|
124
|
}
|
123
|
|
-
|
124
|
125
|
// Otherwise, create user and add to added
|
125
|
126
|
else
|
126
|
127
|
{
|
|
@@ -130,6 +131,7 @@ class UserTableSeeder extends Seeder {
|
130
|
131
|
'first_name' => $first_name,
|
131
|
132
|
'surnames' => $surnames,
|
132
|
133
|
'email' => $email,
|
|
134
|
+ 'number' => $emp_number,
|
133
|
135
|
'has_access' => 1,
|
134
|
136
|
'role' => 4,
|
135
|
137
|
// 'program_id' => $program_id, //should change when I know how this info will be given
|