本文整理汇总了PHP中Vehicle::whereIn方法的典型用法代码示例。如果您正苦于以下问题:PHP Vehicle::whereIn方法的具体用法?PHP Vehicle::whereIn怎么用?PHP Vehicle::whereIn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vehicle
的用法示例。
在下文中一共展示了Vehicle::whereIn方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: owner_nin_response
public static function owner_nin_response($owner)
{
if ($owner) {
$owner_id = $owner->id;
$vehicle_id = VehicleDriverOwner::where('vehicle_driver_owners_driver_id', $owner_id)->lists('vehicle_driver_owners_vehicle_id');
$vehicles = Vehicle::whereIn('id', $vehicle_id)->get()->toArray();
//print_r($vehicle);
$searched_data_all = array();
foreach ($vehicles as $vehicle) {
$vehicles_vin = $vehicle['vehicles_vin'];
$vehicles_model_id = $vehicle['vehicles_model_id'];
$vehicles_use_type_id = $vehicle['vehicles_use_type'];
$model = Model::find($vehicles_model_id);
$model_make_id = $model->model_make_id;
$model_name = $model->model_name;
$vehicle_use_types_name = VehicleUseType::find($vehicles_use_type_id)->vehicle_use_types_name;
$result_data[] = array('id' => $vehicle['id'], 'vin_number' => $vehicles_vin, 'model_make_id' => $model_make_id, 'model_name' => $model_name, 'vehicle_use_types_name' => $vehicle_use_types_name);
}
Helpers::response_data('200', 'success', $result_data);
}
}