Crted issue in characteristic approver master for filtering plant
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 17s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Laravel Pint / pint (pull_request) Failing after 31s
Laravel Larastan / larastan (pull_request) Failing after 3m6s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 17s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Laravel Pint / pint (pull_request) Failing after 31s
Laravel Larastan / larastan (pull_request) Failing after 3m6s
This commit is contained in:
@@ -411,7 +411,7 @@ class CharacteristicApproverMasterResource extends Resource
|
||||
if ($userHas && strlen($userHas) > 0) {
|
||||
return Plant::where('id', $userHas)->pluck('name', 'id')->toArray();
|
||||
} else {
|
||||
return Plant::whereHas('requestCharacteristics', function ($query) {
|
||||
return Plant::whereHas('characteristicApproverMaster', function ($query) {
|
||||
$query->whereNotNull('id');
|
||||
})->orderBy('code')->pluck('name', 'id');
|
||||
}
|
||||
@@ -434,7 +434,7 @@ class CharacteristicApproverMasterResource extends Resource
|
||||
return [];
|
||||
}
|
||||
|
||||
return Machine::whereHas('requestCharacteristics', function ($query) use ($plantId) {
|
||||
return Machine::whereHas('characteristicApproverMaster', function ($query) use ($plantId) {
|
||||
if ($plantId) {
|
||||
$query->where('plant_id', $plantId);
|
||||
}
|
||||
|
||||
@@ -53,6 +53,11 @@ class Machine extends Model
|
||||
return $this->hasMany(RequestCharacteristic::class, 'machine_id', 'id');
|
||||
}
|
||||
|
||||
public function characteristicApproverMaster()
|
||||
{
|
||||
return $this->hasMany(CharacteristicApproverMaster::class, 'machine_id', 'id');
|
||||
}
|
||||
|
||||
public function productionCharacteristics()
|
||||
{
|
||||
return $this->hasMany(ProductionCharacteristic::class, 'machine_id', 'id');
|
||||
|
||||
@@ -193,4 +193,9 @@ class Plant extends Model
|
||||
// {
|
||||
// return $this->hasMany(LocatorValidation::class, 'plant_id', 'id');
|
||||
// }
|
||||
|
||||
public function characteristicApproverMaster()
|
||||
{
|
||||
return $this->hasMany(CharacteristicApproverMaster::class, 'plant_id', 'id');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user