PluginProbe
ShiftController Employee Shift Scheduling / trunk
ShiftController Employee Shift Scheduling vtrunk
4.9.97 4.9.96 4.9.95 4.9.74 4.9.75 4.9.76 4.9.77 4.9.78 4.9.84 4.9.85 4.9.87 4.9.91 4.9.92 trunk 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 3.2.4 All 38 releases
← All changes | sh4/app/query.php +5 -1 4.9.84trunk View file →
@@ -76,11 +76,15 @@
76 76 global $wpdb;
77 77 $sql = 'SELECT post_id AS employee_id, meta_value AS user_id FROM ' . $wpdb->postmeta . ' wpostmeta' . ' JOIN ' . $wpdb->posts . ' wposts ON wposts.ID = wpostmeta.post_id WHERE wpostmeta.meta_key="user_id" AND wposts.post_type="sh4_employee"';
78 78 $res = $wpdb->get_results( $sql, ARRAY_A );
79 79 foreach( $res as $e ){
80 + if (!isset($e['user_id'])) {
81 + continue;
82 + }
80 83 if( ! $e['employee_id'] ) continue;
84 + if( ! $e['user_id'] ) continue;
81 85 $this->repoEmployeeUser[ $e['employee_id'] ] = $e['user_id'];
82 - $this->repoUserEmployee[ $e['user_id'] ] = $e['employee_id'];
86 + $this->repoUserEmployee[ $e['user_id'] ?? '' ] = $e['employee_id'];
83 87 }
84 88
85 89 if( $this->repoUserEmployee ){
86 90 $this->repoUser = $this->usersQuery->findManyById( array_keys($this->repoUserEmployee) );