|
@@ -2,6 +2,10 @@
|
|
|
namespace App\Repositories\Behavior;
|
|
|
use App\Models\Behavior;
|
|
|
use App\Models\BehaviorOperationLog;
|
|
|
+use App\Models\CommentRecord;
|
|
|
+use App\Models\GeneralRecord;
|
|
|
+use App\Models\RegisteredRecord;
|
|
|
+use App\Models\ReleaseRecord;
|
|
|
use GuzzleHttp\Client;
|
|
|
use GuzzleHttp\Exception\RequestException;
|
|
|
use Illuminate\Support\Facades\DB;
|
|
@@ -20,10 +24,16 @@ use Illuminate\Database\QueryException;
|
|
|
|
|
|
class BehaviorRepository
|
|
|
{
|
|
|
- public function __construct(Behavior $behavior,BehaviorOperationLog $behaviorOperationLog)
|
|
|
+ public function __construct(Behavior $behavior,BehaviorOperationLog $behaviorOperationLog,
|
|
|
+ RegisteredRecord $registeredRecord,CommentRecord $commentRecord,
|
|
|
+ GeneralRecord $generalRecord,ReleaseRecord $releaseRecord)
|
|
|
{
|
|
|
$this->behavior = $behavior;
|
|
|
$this->behaviorOperationLog = $behaviorOperationLog;
|
|
|
+ $this->registeredRecord = $registeredRecord;
|
|
|
+ $this->commentRecord = $commentRecord;
|
|
|
+ $this->generalRecord = $generalRecord;
|
|
|
+ $this->releaseRecord = $releaseRecord;
|
|
|
//初始化virus域名
|
|
|
$this->client = new Client([
|
|
|
'base_uri' => config('constants.VIRUS_URL'),
|
|
@@ -71,6 +81,9 @@ class BehaviorRepository
|
|
|
foreach ($res as $k=>$v) {
|
|
|
if (isset($v['_id']) && !empty($virus_behavior_id)){
|
|
|
$res[$k]['behavior_status'] = 0;//未登记
|
|
|
+ $res[$k]['behavior_flag'] = $v['behavior_flag'];
|
|
|
+ $res[$k]['behavior_identification'] = $v['behavior_flag'];
|
|
|
+ unset($res[$k]['behavior_flag']);
|
|
|
if (in_array($v['_id'], $virus_behavior_id)) {
|
|
|
unset($res[$k]);
|
|
|
}
|
|
@@ -80,6 +93,9 @@ class BehaviorRepository
|
|
|
$new_res = $registered_bahaviors;
|
|
|
}elseif (isset($v['_id']) && empty($virus_behavior_id)){
|
|
|
$res[$k]['behavior_status'] = 0;//未登记
|
|
|
+ $res[$k]['behavior_flag'] = $v['behavior_flag'];
|
|
|
+ $res[$k]['behavior_identification'] = $v['behavior_flag'];
|
|
|
+ unset($res[$k]['behavior_flag']);
|
|
|
$new_res = $res;
|
|
|
}
|
|
|
}
|
|
@@ -382,5 +398,6 @@ class BehaviorRepository
|
|
|
return $this->behavior->where($where)->paginate($perPage);
|
|
|
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|