PMC-744
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Model factory for a process
|
||||
*/
|
||||
@@ -11,7 +12,7 @@ $factory->define(\ProcessMaker\Model\Task::class, function(Faker $faker) {
|
||||
return $process->PRO_UID;
|
||||
},
|
||||
'TAS_UID' => G::generateUniqueID(),
|
||||
'TAS_ID' => $faker->unique()->numberBetween(1, 2000),
|
||||
'TAS_ID' => $faker->unique()->numberBetween(1, 100000),
|
||||
'TAS_TITLE' => $faker->sentence(2),
|
||||
'TAS_TYPE' => 'NORMAL',
|
||||
'TAS_TYPE_DAY' => 1,
|
||||
@@ -31,4 +32,4 @@ $factory->define(\ProcessMaker\Model\Task::class, function(Faker $faker) {
|
||||
'TAS_CAN_SEND_MESSAGE' => 'FALSE',
|
||||
'TAS_SEND_LAST_EMAIL' => 'FALSE',
|
||||
];
|
||||
});
|
||||
});
|
||||
|
||||
733
tests/unit/workflow/engine/classes/ReportTablesTest.php
Normal file
733
tests/unit/workflow/engine/classes/ReportTablesTest.php
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -3,6 +3,7 @@
|
||||
namespace ProcessMaker\Model;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class Application extends Model
|
||||
{
|
||||
@@ -24,4 +25,31 @@ class Application extends Model
|
||||
{
|
||||
return $this->hasOne(User::class, 'APP_CUR_USER', 'USR_UID');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Applications by PRO_UID, ordered by APP_NUMBER.
|
||||
* @param string $proUid
|
||||
* @return object
|
||||
* @see ReportTables->populateTable()
|
||||
*/
|
||||
public static function getByProUid($proUid)
|
||||
{
|
||||
$query = Application::query()
|
||||
->select()
|
||||
->proUid($proUid)
|
||||
->orderBy('APP_NUMBER', 'ASC');
|
||||
return $query->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope for query to get the applications by PRO_UID.
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @param string $proUid
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopeProUid($query, $proUid)
|
||||
{
|
||||
$result = $query->where('PRO_UID', '=', $proUid);
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user