1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- namespace App\Services\Complain;
- use App\Models\BlackListModel;
- use App\Models\Gteam\UserModel;
- use App\Services\User\ProfileService;
- class GameComplaintHandle extends ComplaintHandle
- {
- public function erasing()
- {
- $be_user = $this->getBeUser();
- foreach ($this->fields as $field) {
- try {
- switch ($field) {
- case "cj_wx_rank":
- $gteamUser = UserModel::find($be_user->uid);
- $gteamUser->cj_wx_rank = 0;
- $gteamUser->save();
- // no break
- case "wz_wx_rank":
- $gteamUser = UserModel::find($be_user->uid);
- $gteamUser->wz_wx_rank = 0;
- $gteamUser->save();
- break;
- case "sex":
- $value = 0;
- if ($be_user->sex == 1) {
- $value = 2;
- } elseif ($be_user->sex == 2) {
- $value = 1;
- }
- $userService = new ProfileService();
- $userService->updateUser($be_user, [$field => $value]);
- break;
- }
- } catch (\Exception $e) {
- }
- }
- }
- public function reply()
- {
- switch ($this->state) {
- case "1":
- return "仅回复";
- break;
- case "2":
- return "联系客服";
- break;
- }
- }
- public function defriend()
- {
- BlackListModel::create([
- 'uid' => $this->complaint->be_uid,
- 'complaint_id' => $this->complaint->id,
- 'end_at' => $this->defriend_at,
- 'type' => 'game',
- 'state' => $this->defriend_state,
- ]);
- }
- }
|