transaction(function () use ($activityUser, $formData) { // 添加评论 $result = $this->addComment($activityUser, $formData); if (!$result) { return false; } // 保存评论图片 if (!empty($formData['image_list'])) { $this->saveCommentImages($this['comment_id'], $formData['image_list']); } return true; }); } /** * 检查活动报名是否可以评论 */ public function checkActivityUserAllowComment($activityUser) { return $this->checkAllowComment($activityUser); } }