This commit is contained in:
Roly Rudy Gutierrez Pinto
2019-05-23 16:30:49 -04:00
parent 8252428a0c
commit 250976c159
4 changed files with 878 additions and 143 deletions

View File

@@ -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',
];
});
});

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -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;
}
}