modified assests
This commit is contained in:
@@ -6,9 +6,9 @@ use App\Enums\RecordStatusEnum;
|
||||
use App\Models\BaseModel;
|
||||
use App\Models\Commune;
|
||||
use App\Models\District;
|
||||
use App\Models\Laboratory;
|
||||
use App\Models\Organization;
|
||||
use App\Models\Province;
|
||||
use App\Models\UserLabCover;
|
||||
use App\Models\UserOrganization;
|
||||
use App\Models\Village;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
@@ -18,12 +18,12 @@ abstract class Controller
|
||||
{
|
||||
function getAccessAbleLabs(){
|
||||
$recordStatusCondition = Auth::id()==1 ? [RecordStatusEnum::DELETE, RecordStatusEnum::ACTIVE] : [RecordStatusEnum::ACTIVE];
|
||||
$labs = Laboratory::query()->whereIn(BaseModel::RECORD_STATUS_FIELD, $recordStatusCondition)->get();
|
||||
$organizations = Organization::query()->whereIn(BaseModel::RECORD_STATUS_FIELD, $recordStatusCondition)->get();
|
||||
if(Auth::id()!=1){
|
||||
$labIds = UserLabCover::query()->where('user_id', Auth::id())->where(BaseModel::RECORD_STATUS_FIELD, RecordStatusEnum::ACTIVE)->pluck('lab_id')->toArray();
|
||||
$labs = $labs->whereIn('id', $labIds);
|
||||
$organizationId = UserOrganization::query()->where('user_id', Auth::id())->where(BaseModel::RECORD_STATUS_FIELD, RecordStatusEnum::ACTIVE)->pluck('organization_id')->toArray();
|
||||
$organizations = $organizations->whereIn('id', $organizationId);
|
||||
}
|
||||
return $labs;
|
||||
return $organizations;
|
||||
}
|
||||
|
||||
function province(){
|
||||
@@ -52,33 +52,10 @@ abstract class Controller
|
||||
}
|
||||
|
||||
public function location(){
|
||||
// discount_type = [1 => '%', 2 => 'USD']
|
||||
return Laboratory::query()->find(Session::get('base_lab_id'))->only([
|
||||
return Organization::query()->find(Session::get('base_organization_id'))->only([
|
||||
'id',
|
||||
'name_en',
|
||||
'name_kh',
|
||||
'short_name',
|
||||
'sample_number',
|
||||
'patient_code',
|
||||
'verify_label',
|
||||
'technician_label',
|
||||
'discount_type',
|
||||
'logo',
|
||||
'address_kh',
|
||||
'address_en',
|
||||
'phone_number',
|
||||
'email',
|
||||
'shareable_lab_result',
|
||||
'result_header_id',
|
||||
'show_result_footer',
|
||||
'abnormal_result_font_weight',
|
||||
'abnormal_text_color',
|
||||
'exchange_rate',
|
||||
'lab_category_id',
|
||||
'currency',
|
||||
'is_hide_inv_discount',
|
||||
'is_hide_comission_percentage',
|
||||
'invoice_template_id',
|
||||
'alternative_logo'
|
||||
'name_kh'
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user