|
@@ -9,8 +9,6 @@
|
|
namespace App\Repositories;
|
|
namespace App\Repositories;
|
|
|
|
|
|
|
|
|
|
-use App\Models\BindPhoneRecord;
|
|
|
|
-use App\Models\BindWxRecord;
|
|
|
|
use App\Models\CommentAccountRecord;
|
|
use App\Models\CommentAccountRecord;
|
|
use App\Models\GeneralLedgerRecord;
|
|
use App\Models\GeneralLedgerRecord;
|
|
use App\Models\RegisteredAccountsRecord;
|
|
use App\Models\RegisteredAccountsRecord;
|
|
@@ -23,23 +21,19 @@ class BehaviorRecordRepositories
|
|
public function __construct(RegisteredAccountsRecord $registeredAccountsRecord,
|
|
public function __construct(RegisteredAccountsRecord $registeredAccountsRecord,
|
|
GeneralLedgerRecord $generalLedgerRecord,
|
|
GeneralLedgerRecord $generalLedgerRecord,
|
|
ReleaseRecord $releaseRecord,
|
|
ReleaseRecord $releaseRecord,
|
|
- CommentAccountRecord $commentAccountRecord,
|
|
|
|
- BindPhoneRecord $bindPhoneRecord,
|
|
|
|
- BindWxRecord $bindWxRecord)
|
|
|
|
|
|
+ CommentAccountRecord $commentAccountRecord)
|
|
{
|
|
{
|
|
$this->registeredAccountsRecord = $registeredAccountsRecord;
|
|
$this->registeredAccountsRecord = $registeredAccountsRecord;
|
|
$this->generalLedgerRecord = $generalLedgerRecord;
|
|
$this->generalLedgerRecord = $generalLedgerRecord;
|
|
$this->releaseRecord = $releaseRecord;
|
|
$this->releaseRecord = $releaseRecord;
|
|
$this->commentAccountRecord = $commentAccountRecord;
|
|
$this->commentAccountRecord = $commentAccountRecord;
|
|
- $this->bindPhoneRecord = $bindPhoneRecord;
|
|
|
|
- $this->bindWxRecord = $bindWxRecord;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 根据行为标识获取行为记录表
|
|
* 根据行为标识获取行为记录表
|
|
* @param $behavior
|
|
* @param $behavior
|
|
*/
|
|
*/
|
|
- public function getBehaviorTable($behavior)
|
|
|
|
|
|
+ private function getBehaviorTable($behavior)
|
|
{
|
|
{
|
|
$tables = [
|
|
$tables = [
|
|
'register' => 'registered_accounts_record',
|
|
'register' => 'registered_accounts_record',
|
|
@@ -49,9 +43,7 @@ class BehaviorRecordRepositories
|
|
'unlike' => 'general_ledger_record',
|
|
'unlike' => 'general_ledger_record',
|
|
'forward' => 'general_ledger_record',
|
|
'forward' => 'general_ledger_record',
|
|
'collect' => 'general_ledger_record',
|
|
'collect' => 'general_ledger_record',
|
|
- 'comment' => 'comment_account_record',
|
|
|
|
- 'bind_phone' => 'bind_phone_record',
|
|
|
|
- 'bind_wechat' => 'bind_wx_record'
|
|
|
|
|
|
+ 'comment' => 'comment_account_record'
|
|
];
|
|
];
|
|
return isset($tables[$behavior]) ? $tables[$behavior] : false;
|
|
return isset($tables[$behavior]) ? $tables[$behavior] : false;
|
|
}
|
|
}
|
|
@@ -76,10 +68,6 @@ class BehaviorRecordRepositories
|
|
return $this->addGeneralRecord($info);
|
|
return $this->addGeneralRecord($info);
|
|
} elseif ($behaviorTable == 'comment_account_record') {
|
|
} elseif ($behaviorTable == 'comment_account_record') {
|
|
return $this->addCommentRecord($info);
|
|
return $this->addCommentRecord($info);
|
|
- } elseif ($behaviorTable == 'bind_phone_record') {
|
|
|
|
- return $this->addBindPhoneRecord($info);
|
|
|
|
- } elseif ($behaviorTable == 'bind_wx_record') {
|
|
|
|
- return $this->addBindWxRecord($info);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return false;
|
|
return false;
|
|
@@ -90,7 +78,7 @@ class BehaviorRecordRepositories
|
|
* @param $register
|
|
* @param $register
|
|
* @return bool
|
|
* @return bool
|
|
*/
|
|
*/
|
|
- public function addRegisterRecord($register)
|
|
|
|
|
|
+ private function addRegisterRecord($register)
|
|
{
|
|
{
|
|
try {
|
|
try {
|
|
$data['virus_behavior_id'] = $register['virus_behavior_id'];
|
|
$data['virus_behavior_id'] = $register['virus_behavior_id'];
|
|
@@ -115,7 +103,7 @@ class BehaviorRecordRepositories
|
|
* @param $release
|
|
* @param $release
|
|
* @return bool
|
|
* @return bool
|
|
*/
|
|
*/
|
|
- public function addReleaseRecord($release)
|
|
|
|
|
|
+ private function addReleaseRecord($release)
|
|
{
|
|
{
|
|
try {
|
|
try {
|
|
$data['virus_behavior_id'] = $release['virus_behavior_id'];
|
|
$data['virus_behavior_id'] = $release['virus_behavior_id'];
|
|
@@ -139,7 +127,7 @@ class BehaviorRecordRepositories
|
|
* @param $general
|
|
* @param $general
|
|
* @return bool
|
|
* @return bool
|
|
*/
|
|
*/
|
|
- public function addGeneralRecord($general)
|
|
|
|
|
|
+ private function addGeneralRecord($general)
|
|
{
|
|
{
|
|
try {
|
|
try {
|
|
$data['virus_behavior_id'] = $general['virus_behavior_id'];
|
|
$data['virus_behavior_id'] = $general['virus_behavior_id'];
|
|
@@ -164,7 +152,7 @@ class BehaviorRecordRepositories
|
|
* @param $comment
|
|
* @param $comment
|
|
* @return bool
|
|
* @return bool
|
|
*/
|
|
*/
|
|
- public function addCommentRecord($comment)
|
|
|
|
|
|
+ private function addCommentRecord($comment)
|
|
{
|
|
{
|
|
try {
|
|
try {
|
|
$data['virus_behavior_id'] = $comment['virus_behavior_id'];
|
|
$data['virus_behavior_id'] = $comment['virus_behavior_id'];
|
|
@@ -184,52 +172,4 @@ class BehaviorRecordRepositories
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 记录账本-绑定手机
|
|
|
|
- * @param $bindphone
|
|
|
|
- * @return bool
|
|
|
|
- */
|
|
|
|
- public function addBindPhoneRecord($bindphone)
|
|
|
|
- {
|
|
|
|
- try {
|
|
|
|
- $data['virus_behavior_id'] = $bindphone['virus_behavior_id'];
|
|
|
|
- $data['uid'] = $bindphone['uid'];
|
|
|
|
- $data['trigger_time'] = $bindphone['trigger_time'];
|
|
|
|
- $data['phone'] = $bindphone['phone'];
|
|
|
|
- $data['physical_exertion'] = $bindphone['physical_exertion'];
|
|
|
|
- $data['trigger_type'] = $bindphone['trigger_type'];
|
|
|
|
- $data['generation_type'] = $bindphone['generation_type'];
|
|
|
|
- $data['release_status'] = $bindphone['release_status'];
|
|
|
|
- $data['generation_quantity'] = $bindphone['generation_quantity'];
|
|
|
|
- $data['quantity_issued'] = $bindphone['quantity_issued'];
|
|
|
|
- return $this->bindPhoneRecord->create($data);
|
|
|
|
- } catch (QueryException $exception) {
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 记录账本-绑定微信
|
|
|
|
- * @param $bindwx
|
|
|
|
- * @return bool
|
|
|
|
- */
|
|
|
|
- public function addBindWxRecord($bindwx)
|
|
|
|
- {
|
|
|
|
- try {
|
|
|
|
- $data['virus_behavior_id'] = $bindwx['virus_behavior_id'];
|
|
|
|
- $data['uid'] = $bindwx['uid'];
|
|
|
|
- $data['trigger_time'] = $bindwx['trigger_time'];
|
|
|
|
- $data['weixin'] = $bindwx['weixin'];
|
|
|
|
- $data['physical_exertion'] = $bindwx['physical_exertion'];
|
|
|
|
- $data['trigger_type'] = $bindwx['trigger_type'];
|
|
|
|
- $data['generation_type'] = $bindwx['generation_type'];
|
|
|
|
- $data['release_status'] = $bindwx['release_status'];
|
|
|
|
- $data['generation_quantity'] = $bindwx['generation_quantity'];
|
|
|
|
- $data['quantity_issued'] = $bindwx['quantity_issued'];
|
|
|
|
- return $this->bindWxRecord->create($data);
|
|
|
|
- } catch (QueryException $exception) {
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
}
|
|
}
|