module = $module; } /** * Get the mail representation of the notification. * * @param mixed $notifiable * * @return MailMessage */ public function toGroup($notifiable) { $module = $this->module; // make wecom_key visible $wecom_key = $module->wecom_key ?? config('settings.wecom.robot_hook.billing'); $text = "# {$module->name} 收益"; foreach ($notifiable as $year => $months) { // 排序 months 从小到大 ksort($months); $total = 0; $total_should = 0; foreach ($months as $month => $m) { $total += $m['balance']; $total_should += $m['should_balance']; $text .= << 'markdown', 'markdown' => [ 'content' => $text, ], ]); if ($resp->failed()) { Log::error('发送模块盈利到企业微信时失败', [ 'module' => $module->id, 'data' => $notifiable, 'resp' => $resp->json(), ]); } } }