bike = $bike; } /** * Execute the job. * * @return void */ public function handle() { // $bike = $this->bike; $res = app()->redis->hexists(BikeStatusInfoSyncHandler::REDIS_RIDE_BIKE_WORKER_ORDERS_TAG,$bike->bike_no); if($res){ $bike_location = LocationsLog::getNewestLocationByBikeNo($bike->bike_no); (new BikeStatusInfoSyncHandler())->toBikeWaitRideStatus($bike->bike_no, $bike_location['lng'], $bike_location['lat'], $bike->put_status); if(!$bike->is_riding){ $bike->last_use_bike_end_time = Carbon::now(); $bike->is_lock = Bike::LOCK_YES; $bike->save(); BikeControl::closeLock($bike->box_no); // 添加记录 $worker_bike_operate = new WorkerBikeOperate(); $worker_bike_operate->type = WorkerBikeOperate::TYPE_CLOSE_BIKE_LOCK; $worker_bike_operate->name = WorkerBikeOperate::$typeMaps[WorkerBikeOperate::TYPE_CLOSE_BIKE_LOCK]; $worker_bike_operate->bike_id = $bike->id; $last_location = object_array(json_decode($bike->last_location)); $worker_bike_operate->latitude = empty($last_location['lat']) ? 0 : $last_location['lat']; $worker_bike_operate->longitude = empty($last_location['lng']) ? 0 : $last_location['lng']; $worker_bike_operate->reason = "系统自动关锁"; $worker_bike_operate->worker_id = 0; $worker_bike_operate->save(); } } } }