sign = $sign; $this->platform = $platform; } public function doHandle() { $this->user = UserModel::find($this->sign->uid); if (!$this->user) { return; } $this->doReport(self::SIGN, $this->sign->uid, [ 'type' => $this->getType(), 'gender' => $this->getGender(), ]); } protected function getGender() { switch ($this->user->gender) { case 1: return '男性'; case 2: return '女性'; default: return '未知'; } } protected function getType() { switch ($this->platform) { case "wx": return "小程序签到"; case "qq": return "小程序签到"; case "ios": return "APP签到"; case "android": return "APP签到"; } } }