Initial commit

This commit is contained in:
meusinfirmary
2025-04-22 14:33:37 +07:00
commit b9891d2f81
1305 changed files with 452033 additions and 0 deletions

45
app/Models/VehiclesDetail.php Executable file
View File

@ -0,0 +1,45 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class VehiclesDetail extends Model
{
public static function getDetailByVid($vid)
{
return DB::select("SELECT * FROM t_vehicles_detail WHERE vid = ? LIMIT 1;", [$vid]);
}
public static function getDetailById($id)
{
return DB::select("SELECT * FROM t_vehicles_detail WHERE id = ? LIMIT 1;", [$id]);
}
public static function addDetail($data)
{
$id = DB::table("t_vehicles_detail")->insertGetId($data);
return $id;
}
public static function updateDetail($id, $data)
{
return DB::table("t_vehicles_detail")->where("id", $id)->update($data);
}
public static function updateDetailByVid($vid, $data)
{
return DB::table("t_vehicles_detail")->where("vid", $vid)->update($data);
}
public static function deleteDetail($id)
{
return DB::table("t_vehicles_detail")->where("id", $id)->delete();
}
public static function deleteDetailByVid($vid)
{
return DB::table("t_vehicles_detail")->where("vid", $vid)->delete();
}
}