本文整理汇总了PHP中Registration::withTrashed方法的典型用法代码示例。如果您正苦于以下问题:PHP Registration::withTrashed方法的具体用法?PHP Registration::withTrashed怎么用?PHP Registration::withTrashed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Registration
的用法示例。
在下文中一共展示了Registration::withTrashed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: data
/**
* This function is responsible for all the data that is
* needed by different pages viaajax
*
* @return Depends on what what is being called
*/
public function data()
{
// BEGIN CHECK VEHICLE VIN
if (isset($_POST['vehicles_vin']) && $_POST['vehicles_vin'] != "") {
$vehicles_vin = $_POST['vehicles_vin'];
$vehicles_vin_status = Vehicle::where('vehicles_vin', $vehicles_vin)->withTrashed()->get()->count();
if ($vehicles_vin_status > 0) {
return 1;
}
}
// END CHECK VEHICLE VIN
// BEGIN CHECK VEHICLE LIC NO
if (isset($_POST['registrations_licence_plate_no']) && $_POST['registrations_licence_plate_no'] != "") {
$registrations_licence_plate_no = $_POST['registrations_licence_plate_no'];
$registrations_licence_plate_no_status = Registration::withTrashed()->where('registrations_licence_plate_no', $registrations_licence_plate_no)->get()->count();
if ($registrations_licence_plate_no_status > 0) {
return 1;
}
}
// END CHECK VEHICLE LIC NO
// BEGIN SHOW ALL MAKES (USER CLICKED ON YEAR)
if (isset($_POST['inp']) && $_POST['inp'] == 1) {
/* REMOVE TO SHOW ALL MODELS
$model_make_ar = ['-1' => 'Select Make'] + Model::distinct()->orderBy('model_make_id')->lists('model_make_id', 'model_make_id');
*/
$vehicles_year = $_POST['vehicles_year'];
$model_make_ar = ['-1' => 'Select Make'] + Model::where('model_year', $vehicles_year)->distinct()->orderBy('model_make_id')->lists('model_make_id', 'model_make_id');
$model_make_ar['add_new'] = "Add New";
foreach ($model_make_ar as $model_make_ar_fet) {
echo "<option value='{$model_make_ar_fet}'>{$model_make_ar_fet}</option>";
}
}
// END SHOW ALL MAKES (USER CLICKED ON YEAR)
// BEGIN SHOW ALL ASSOCIATED MODELS NAME AND TRIM (USER CLICKED ON MAKE)
if (isset($_POST['inp']) && $_POST['inp'] == 2) {
$vehicles_year = $_POST['vehicles_year'];
$vehicles_make_id = $_POST['vehicles_make_id'];
$vehicles_name_trim_arr = Model::where('model_year', $vehicles_year)->where('model_make_id', $vehicles_make_id)->get(['model_name', 'model_trim'])->toArray();
foreach ($vehicles_name_trim_arr as $vehicles_name_trim_arr_fet) {
$vehicles_name_trim[] = implode(', ', $vehicles_name_trim_arr_fet);
}
$vehicles_name_trim = array_unique($vehicles_name_trim);
sort($vehicles_name_trim);
$firstOp = "<option value='-1'>Select Model</option>";
echo $firstOp;
foreach ($vehicles_name_trim as $vehicles_name_trim_fet) {
echo "<option value='{$vehicles_name_trim_fet}'>{$vehicles_name_trim_fet}</option>";
}
}
// BEGIN SHOW ALL ASSOCIATED MODELS NAME AND TRIM (USER CLICKED ON MAKE)
// BEGIN SHOW ALL ASSOCIATED BODY STYLE (USER CLICKED ON MODEL)
if (isset($_POST['inp']) && $_POST['inp'] == 3) {
$vehicles_year = $_POST['vehicles_year'];
$vehicles_make_id = $_POST['vehicles_make_id'];
$vehicles_name_trim = $_POST['vehicles_name_trim'];
$vehicles_name_trim_ar = explode(',', $vehicles_name_trim);
$model_name = trim($vehicles_name_trim_ar[0]);
$model_trim = trim($vehicles_name_trim_ar[1]);
$vehicles_body_ar = array_filter(array_unique(Model::where('model_year', $vehicles_year)->where('model_make_id', $vehicles_make_id)->where('model_name', $model_name)->where('model_trim', $model_trim)->lists('model_body')));
sort($vehicles_body_ar);
$firstOp = "<option value='-1'>Select Body Style</option>";
echo $firstOp;
foreach ($vehicles_body_ar as $vehicles_body) {
echo "<option value='{$vehicles_body}'>{$vehicles_body}</option>";
}
}
// END SHOW ALL ASSOCIATED BODY STYLE (USER CLICKED ON MODEL)
// BEGIN SHOW ASSOCIATED BODY WEIGHT (USER CLICKED ON BODY STYLE)
// ALSO RESPONSIBLE FOR REPLYING TO AJAX REQUEST WHEN USER CLICKED ON MODEL
if (isset($_POST['inp']) && $_POST['inp'] == 4) {
$vehicles_year = $_POST['vehicles_year'];
$vehicles_make_id = $_POST['vehicles_make_id'];
$vehicles_name_trim = $_POST['vehicles_name_trim'];
$vehicles_name_trim_ar = explode(',', $vehicles_name_trim);
$model_name = trim($vehicles_name_trim_ar[0]);
$model_trim = trim($vehicles_name_trim_ar[1]);
// USER CLICKED ON MODEL
if (!isset($_POST['vehicles_body'])) {
$model_weight_kg_ar = array_filter(array_unique(Model::where('model_make_id', $vehicles_make_id)->where('model_name', $model_name)->where('model_trim', $model_trim)->where('model_year', $vehicles_year)->lists('model_weight_kg')));
if (!empty($model_weight_kg_ar)) {
sort($model_weight_kg_ar);
$firstOp = "<option value='-1'>Select Gross Weight</option>";
echo $firstOp;
foreach ($model_weight_kg_ar as $model_weight_kg_ar_fet) {
echo "<option value='{$model_weight_kg_ar_fet}'>{$model_weight_kg_ar_fet}</option>";
}
} else {
return 0;
}
} else {
$vehicles_body = $_POST['vehicles_body'];
$model_weight_kg_ar = array_filter(array_unique(Model::where('model_make_id', $vehicles_make_id)->where('model_name', $model_name)->where('model_trim', $model_trim)->where('model_body', $vehicles_body)->where('model_year', $vehicles_year)->lists('model_weight_kg')));
if (!empty($model_weight_kg_ar)) {
sort($model_weight_kg_ar);
//.........这里部分代码省略.........
示例2: checkLicense
public static function checkLicense($registrations_licence_plate_no_status)
{
$registrations_licence_plate_no_status = Registration::withTrashed()->where('registrations_licence_plate_no', $registrations_licence_plate_no_status)->get()->count();
if ($registrations_licence_plate_no_status > 0) {
return 1;
}
}