$scene, 'params' => [ 'mobile' => $params['mobile'], 'code' => mt_rand(1000, 9999), ] ]); return $result[0]; } catch (\Exception $e) { self::$error = $e->getMessage(); return false; } } public static function contractUrl($params) { try { $scene = NoticeEnum::getSceneByTag($params['scene']); if (empty($scene)) { throw new \Exception('场景值异常'); } $result = event('Notice', [ 'scene_id' => $scene, 'params' => [ 'mobile' => $params['mobile'], 'name' => $params['name'], 'type' => $params['type'], 'code' => $params['code'] ] ]); return $result[0]; } catch (\Exception $e) { self::$error = $e->getMessage(); return false; } } }