diff --git a/Server/application/api/controller/FriendTaskController.php b/Server/application/api/controller/FriendTaskController.php index 09a21f0b..893a8109 100644 --- a/Server/application/api/controller/FriendTaskController.php +++ b/Server/application/api/controller/FriendTaskController.php @@ -3,6 +3,7 @@ namespace app\api\controller; use app\api\model\FriendTaskModel; +use app\common\model\WechatRestricts; use think\facade\Request; class FriendTaskController extends BaseController @@ -153,11 +154,39 @@ class FriendTaskController extends BaseController // 使用taskId作为唯一性判断 $task = FriendTaskModel::where('id', $item['id'])->find(); - if ($task) { $task->save($data); } else { FriendTaskModel::create($data); } + + //创建非法记录 + if ($item['status'] == 2){ + $data = [ + 'level' => 2, + 'taskId' => $item['id'], + 'reason' => '', + 'memo' => '', + 'wechatId' => $item['wechatId'], + 'companyId' => '', + 'restrictTime' => time(), + 'recoveryTime' => time() + 3600 * 72, + ]; + if (strpos('操作过于频繁', $item['extra']) !== false){ + $data['reason'] = '频繁添加好友'; + $data['memo'] = '操作过于频繁,请稍后再试'; + } + + if (strpos('当前账号存在安全风险', $item['extra']) !== false){ + $data['reason'] = '账号风险'; + $data['memo'] = '当前账号存在安全风险,需先到「微信团队」进行安全验证后才能继续使用当前功能'; + } + $res = WechatRestricts::where('taskId', $item['id'])->find(); + if (empty($res)) { + WechatRestricts::create($data); + } + } + + } } \ No newline at end of file