|
@@ -1,5 +1,6 @@
|
|
|
<?php
|
|
|
namespace App\Repositories\Behavior;
|
|
|
+use App\Models\Behavior;
|
|
|
use App\Models\GeneralRecord;
|
|
|
|
|
|
/**
|
|
@@ -11,9 +12,10 @@ use App\Models\GeneralRecord;
|
|
|
|
|
|
class GenaralRecordRepository
|
|
|
{
|
|
|
- public function __construct(GeneralRecord $generalRecord)
|
|
|
+ public function __construct(GeneralRecord $generalRecord,Behavior $behavior)
|
|
|
{
|
|
|
$this->generalRecord = $generalRecord;
|
|
|
+ $this->behavior = $behavior;
|
|
|
}
|
|
|
|
|
|
public function lists($request)
|
|
@@ -34,10 +36,10 @@ class GenaralRecordRepository
|
|
|
}
|
|
|
|
|
|
if(isset($request['behavior_identification'])){
|
|
|
- if ($request['type'] == 1){
|
|
|
-
|
|
|
+ $virus_id = $this->behavior->select('virus_behavior_id')->where('behavior_identification',$request['behavior_identification'])->first();
|
|
|
+ if ($virus_id){
|
|
|
+ $where[] = ['virus_behavior_id', $virus_id->virus_behavior_id];
|
|
|
}
|
|
|
- $where[] = ['virus_behavior_id', $request['virus_behavior_id']];
|
|
|
}
|
|
|
|
|
|
return $this->generalRecord
|