modified assests
This commit is contained in:
@@ -6,11 +6,6 @@ use App\Http\Controllers\Helper\GlobalController;
|
||||
use App\Http\Requests\TestSampleCreateRequest;
|
||||
use App\Models\BaseModel;
|
||||
use App\Models\Organism;
|
||||
use App\Models\PatientType;
|
||||
use App\Models\SampleType;
|
||||
use App\Models\Test;
|
||||
use App\Models\TestNormalValue;
|
||||
use App\Models\TestSample;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
@@ -20,19 +15,19 @@ class OrganismController extends Controller
|
||||
{
|
||||
|
||||
protected $model;
|
||||
protected $baseLabId;
|
||||
protected $baseOrganizationId;
|
||||
protected $labs;
|
||||
|
||||
public function __construct(Organism $organism){
|
||||
$this->model = $organism;
|
||||
$this->baseLabId = Session::get('base_lab_id');
|
||||
$this->base = Session::get('base_lab');
|
||||
$this->baseOrganizationId = Session::get('base_organization_id');
|
||||
$this->base = Session::get('base_organization');
|
||||
}
|
||||
|
||||
public function index(Request $request){
|
||||
if(!GlobalController::user_can(Auth::user()->role_id, ['view_organism'])) return redirect(url('my-profile'));
|
||||
$organisms = $this->model::with(['lab'])->where(BaseModel::RECORD_STATUS_FIELD, RecordStatusEnum::ACTIVE)
|
||||
//->where('lab_id', $this->baseLabId)
|
||||
//->where('organization_id', $this->baseOrganizationId)
|
||||
->when(!empty($request->kword), function ($organisms) use($request){
|
||||
$organisms->whereRaw("replace(name_en, ' ','') like '%".str_replace(" ","",$request->kword)."%'");
|
||||
})->orderBy(BaseModel::CREATED_AT_FIELD,'desc')->paginate(config('labis.pagination.perpage', 10));
|
||||
@@ -48,7 +43,7 @@ class OrganismController extends Controller
|
||||
$new->name_en = $request->name_en;
|
||||
$new->weight = $request->weight;
|
||||
$new->is_bold = $request->is_bold;
|
||||
$new->lab_id = $this->baseLabId;
|
||||
$new->organization_id = $this->baseOrganizationId;
|
||||
$new->created_at = date('Y-m-d H:i:s');
|
||||
$new->created_by = Auth::id();
|
||||
$new->record_status_id = RecordStatusEnum::ACTIVE;
|
||||
|
||||
Reference in New Issue
Block a user