|
|
|
@@ -754,9 +754,14 @@ class TB_Shared_Ent_TeamData_Profile extends Francis_Db_Row { |
|
|
|
* @param $teamId
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public static function getProfilesByTeamId( $teamId )
|
|
|
|
public static function getProfilesByTeamId( $teamId, $activeOnly = null )
|
|
|
|
{
|
|
|
|
$whereJson = json_encode( array( 'team_id' => $teamId ) );
|
|
|
|
$params = array('team_id' => $teamId);
|
|
|
|
if ($activeOnly === true ) {
|
|
|
|
$params['status'] = self::STATUS_ACTIVE;
|
|
|
|
}
|
|
|
|
|
|
|
|
$whereJson = json_encode( $params );
|
|
|
|
$sql = 'SELECT * FROM ' . self::getTable() . ' WHERE ';
|
|
|
|
$sql .= 'JSON_CONTAINS( `teams_js`, :where_json ) ';
|
|
|
|
$sql .= 'ORDER BY last_name ASC';
|
|
|
|
|