| 1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace addons\WechatVideoShop\common\service;
- use addons\WechatVideoShop\common\models\WechatVideoShopEvents;
- class EventService
- {
- /**
- * @param array $params
- * @param string $org_post
- * @param array $post
- * @param \Exception|null $e
- * @return WechatVideoShopEvents
- */
- public function create(array $params, string $org_post, array $post = [], \Exception $e = null)
- {
- $model = new WechatVideoShopEvents();
- $model->req = $params;
- $model->org_post = $org_post;
- $model->post = $post;
- if (!empty($e)) {
- $model->exception = [
- 'file' => $e->getFile(),
- 'code' => $e->getCode(),
- 'line' => $e->getLine(),
- 'msg' => $e->getMessage(),
- 'trace' => $e->getTrace()
- ];
- }
- $model->save();
- return $model;
- }
- }
|