PR

位置登録時詳細ログ記録対応 #2237

kouho opened this at 2022-08-29T16:01:18; closed

Description

opened by kouho at 2022-08-29T16:01:18; updated 2022-10-31T17:58:31

概要

位置登録時に詳細ログを調査確認用に記録する対応用のPRです。

テスト方法、確認した内容

位置登録してデータが入るか確認。
PCでの位置登録ではaltitude,altitudeAccuracy, heading.speedは0が入る
$_SERVER['USER_AGENT']とnavigator.userAgentが一応一致するか確認

TODO

問題なければ開発反映で実機テストして本番に反映

テーブル作成クエリ

CREATE TABLE `log_user_location_detail` (
  `user_no` int(11) NOT NULL,
  `position_id` int(11) NOT NULL,
  `area_id` int(11) NOT NULL,
  `longitude` float NOT NULL,
  `latitude` float NOT NULL,
  `altitude` float DEFAULT '0',
  `accuracy` float DEFAULT '0',
  `altitudeAccuracy` int(11) DEFAULT NULL,
  `heading` int(11) DEFAULT NULL,
  `speed` int(11) DEFAULT NULL,
  `server_user_agent` char(255) DEFAULT NULL,
  `browser_user_agent` char(255) DEFAULT NULL,
  `reg_date` int(11) NOT NULL,
  UNIQUE KEY `user_no` (`user_no`,`position_id`),
  KEY `reg_date` (`reg_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

実装時参照サイト

https://developer.mozilla.org/ja/docs/Web/API/GeolocationCoordinates

Comment

#21921 by kouho at 2022-08-29T16:01:34; updated 2022-08-29T16:01:34

@wada
レビューお願いいたします

Comment

#21940 by wada at 2022-08-29T19:04:02; updated 2022-08-29T19:04:02

@kouho
reg_dateはunixtimeを格納するので、reg_timeに変更お願いします。

今後格納するデータが増える可能性もあるので、longitude から browser_user_agent まで、jsonでまとめて1カラムに格納しても良いかなと思いました。
これはお任せします。

Comment

#21953 by wada at 2022-08-30T10:52:52; updated 2022-08-30T10:52:52

@kouho
> reg_dateはunixtimeを格納するので、reg_timeに変更お願いします。

log_user_locationがそうなっていたんですね。
それであれば、そのままで大丈夫です。

wada add_label at 2022-08-30T10:55:50: 和田 LGTM

Comment

#21960 by kouho at 2022-08-30T16:35:54; updated 2022-08-30T16:35:54

@wada
確認ありがとうございます。テスト用なので一旦これでもしもこれから先格納データを追加することがあればjson形式に変更しようと思います。

kouho merge at 2022-08-30T16:36:00: 位置登録時詳細ログ記録対応
kouho close at 2022-08-30T16:36:00: Close
kouho refer at 2022-10-31T17:58:31: 2371:位置登録まとめ

Commit range

based92119c361f8f8696cf34e115c38233350e22cd3
head91e41d0c25631d982a6519dee08db05637955908
base branchjolly/jr-web:develop
head branchjolly/jr-web:log_location_detail

View commits

Commit details are loaded from Git when a dynamic archive server is running, or can be embedded with --include-commits.
Files changed4 filesView patch
statusfile
modifiedlib/SubFunc.inc
modifiedlib/conf/define_y.inc
modifiedlib/public/Area-Set.inc
modifiedpublic_html/template/Main-Location.tpl
Patch body is stored as a separate file to keep this page lightweight.