Solving conflicts updating with last changes in develop branch
This commit is contained in:
@@ -35,6 +35,19 @@ class Application extends Model
|
||||
return $this->belongsTo(User::class, 'APP_INIT_USER', 'USR_UID');
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope for query to get the positive cases
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopePositivesCases($query)
|
||||
{
|
||||
$result = $query->where('APP_NUMBER', '>', 0);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope for query to get the application by APP_UID.
|
||||
*
|
||||
@@ -49,6 +62,20 @@ class Application extends Model
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope for query to get the application by status Id
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @param integer $status
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopeStatusId($query, int $status)
|
||||
{
|
||||
$result = $query->where('APP_STATUS_ID', '=', $status);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope for query to get the applications by PRO_UID.
|
||||
*
|
||||
@@ -76,6 +103,7 @@ class Application extends Model
|
||||
$query = Application::query()
|
||||
->select()
|
||||
->proUid($proUid)
|
||||
->positivesCases()
|
||||
->orderBy('APP_NUMBER', 'ASC');
|
||||
return $query->get();
|
||||
}
|
||||
@@ -118,4 +146,24 @@ class Application extends Model
|
||||
|
||||
return $properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Applications by PRO_UID, ordered by APP_NUMBER.
|
||||
*
|
||||
* @param string $proUid
|
||||
* @param int $status
|
||||
*
|
||||
* @return object
|
||||
* @see ReportTables->populateTable()
|
||||
*/
|
||||
public static function getCountByProUid(string $proUid, $status = 2)
|
||||
{
|
||||
$query = Application::query()
|
||||
->select()
|
||||
->proUid($proUid)
|
||||
->statusId($status)
|
||||
->positivesCases();
|
||||
|
||||
return $query->get()->count();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user