'正常', self::STATUS_PAUSE => '暂停' ]; const TYPE_NULL = 0; const TYPE_BILL_BIKE = 1; const TYPE_OPEN_BIKE = 2; const TYPE_CLONE_BIKE = 3; public static $typeMaps = [ self::TYPE_NULL => '未知', self::TYPE_BILL_BIKE => '寻车', self::TYPE_OPEN_BIKE => '开锁', self::TYPE_CLONE_BIKE => '关锁' ]; public static function log($type, $bike_no, $user_id, $lat, $lng) { $data = [ 'name' => self::$typeMaps[$type], 'type' => $type, 'bike_no' => $bike_no, 'user_id' => $user_id, 'latitude' => $lat, 'longitude' => $lng, ]; self::create($data); } }