crud freezer

This commit is contained in:
2026-07-07 09:29:00 +07:00
parent 907b3b2aec
commit cc615a58ca
23 changed files with 618 additions and 164 deletions

View File

@@ -29,11 +29,10 @@ class RoomController extends Controller
}
public function index(Request $request){
$recordStatusCondition = Auth::id()==1 ? [RecordStatusEnum::DELETE, RecordStatusEnum::ACTIVE] : [RecordStatusEnum::ACTIVE];
$buildings = $this->buildingModel::query()->where(BaseModel::RECORD_STATUS_FIELD, RecordStatusEnum::ACTIVE)
->where('organization_id', $this->baseOrganizationId)->get();
$concepts = $this->conceptModel::query()->where(BaseModel::RECORD_STATUS_FIELD, RecordStatusEnum::ACTIVE)->get();
$rooms = $this->model::with(['building', 'bsl'])->whereIn(BaseModel::RECORD_STATUS_FIELD, $recordStatusCondition)
$rooms = $this->model::with(['building', 'bsl'])->where(BaseModel::RECORD_STATUS_FIELD, RecordStatusEnum::ACTIVE)
->where('organization_id', $this->baseOrganizationId)
->when(!empty($request->kword), function ($query) use($request){
$query->whereRaw("replace(name_en, ' ','') like '%".str_replace(" ","",$request->kword)."%'")