This commit is contained in:
weiz 2024-01-27 17:21:24 +08:00
parent 87da163086
commit 256e0bd053
40 changed files with 58 additions and 58 deletions

View File

@ -60,7 +60,7 @@ class BidBiddingDecision extends BaseModel
public function getProjectAssuranceTextAttr($value,$data){
$dictData = DictData::where('type_value','project_assurance')->column('name','value');
return $dictData[$data['project_assurance']];
return !empty($data['project_assurance']) ? $dictData[$data['project_assurance']] : '';
}
public function getIsMarginTextAttr($value,$data): string
@ -77,7 +77,7 @@ class BidBiddingDecision extends BaseModel
public function getAnnexAttr($value)
{
return empty($value) ? null : json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
}

View File

@ -39,7 +39,7 @@ class BidResult extends BaseModel
public function getAnnexAttr($value)
{
return empty($value) ? null : json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
}

View File

@ -32,6 +32,6 @@ class BuildProcessSettings extends BaseModel
public function getAnnexAttr($value)
{
return json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
}

View File

@ -32,6 +32,6 @@ class BuildReport extends BaseModel
public function getSceneFileAttr($value)
{
return json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
}

View File

@ -38,7 +38,7 @@ class CustomFollow extends BaseModel
public function getAnnexAttr($value)
{
return empty($value) ? null : json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
public function getNextFollowDateAttr($value): string
@ -48,6 +48,6 @@ class CustomFollow extends BaseModel
public function getTypesTextAttr($value,$data){
$dictData = DictData::where('type_value','custom_follow_type')->column('name','value');
return $dictData[$data['types']];
return !empty($data['types']) ? $dictData[$data['types']] : '';
}
}

View File

@ -44,6 +44,6 @@ class CustomerDemand extends BaseModel
public function getAnnexAttr($value)
{
return empty($value) ? null : json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
}

View File

@ -32,7 +32,7 @@ class CustomerDemandSolution extends BaseModel
public function getAnnexAttr($value)
{
return empty($value) ? null : json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
public function getSubmissionTimeAttr($value): string

View File

@ -32,6 +32,6 @@ class Material extends BaseModel
public function getAnnexAttr($value)
{
return empty($value) ? null : json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
}

View File

@ -32,7 +32,7 @@ class MaterialWarehouse extends BaseModel
public function getAnnexAttr($value)
{
return empty($value) ? null : json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
public function getIsMrpTextAttr($value,$data): string

View File

@ -32,6 +32,6 @@ class Competitor extends BaseModel
public function getAnnexAttr($value)
{
return empty($value) ? null : json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
}

View File

@ -124,6 +124,6 @@ class Project extends BaseModel
public function getAnnexAttr($value)
{
return empty($value) ? null : json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
}

View File

@ -32,7 +32,7 @@ class ProjectAttendanceRecord extends BaseModel
public function getFileAttr($value)
{
return json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
public function getAttendanceDateAttr($value): string
{

View File

@ -34,7 +34,7 @@ class ProjectEstimate extends BaseModel
public function getEstimateSourceTextAttr($value,$data)
{
$dictData = DictData::where('type_value','estimate_source')->column('name','value');
return $dictData[$data['estimate_source']];
return !empty($data['estimate_source']) ? $dictData[$data['estimate_source']] : '';
}
public function getInvoiceTypeTextAttr($value,$data)
{
@ -45,7 +45,7 @@ class ProjectEstimate extends BaseModel
public function getAnnexAttr($value)
{
return empty($value) ? null : json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
public function getQuotationDateAttr($value): string

View File

@ -32,7 +32,7 @@ class ProjectInsuranceManagement extends BaseModel
public function getAnnexAttr($value)
{
return json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
public function getInsuranceDateAttr($value): string

View File

@ -32,21 +32,21 @@ class ProjectManagerAppointment extends BaseModel
public function getProjectApprovalDateAttr($value)
{
return date('Y-m-d',$value);
return !empty($value) ? date('Y-m-d',$value) : '';
}
public function getStartDateAttr($value)
{
return date('Y-m-d',$value);
return !empty($value) ? date('Y-m-d',$value) : '';
}
public function getDeliveryDateAttr($value)
{
return date('Y-m-d',$value);
return !empty($value) ? date('Y-m-d',$value) : '';
}
public function getannexAttr($value)
public function getAnnexAttr($value)
{
return json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
}

View File

@ -33,12 +33,12 @@ class ProjectMilestones extends BaseModel
public function getProjectMilestonesDateAttr($value): string
{
return date('Y-m-d',$value);
return !empty($value) ? date('Y-m-d',$value) : '';
}
public function getProjectMilestonesTextAttr($value,$data)
{
$dictDate = DictData::where('type_value','project_milestones')->column('name','value');
return $dictDate[$data['project_milestones']];
return !empty($data['project_milestones']) ? $dictDate[$data['project_milestones']] : '';
}
}

View File

@ -32,21 +32,21 @@ class ProjectPlan extends BaseModel
public function getStartTimeAttr($value)
{
return date('Y-m-d',$value);
return !empty($value) ? date('Y-m-d',$value) : '';
}
public function getDeliverTimeAttr($value)
{
return date('Y-m-d',$value);
return !empty($value) ? date('Y-m-d',$value) : '';
}
public function getDeclareTimeAttr($value)
{
return date('Y-m-d',$value);
return !empty($value) ? date('Y-m-d',$value) : '';
}
public function getannexAttr($value)
public function getAnnexAttr($value)
{
return json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
}

View File

@ -33,7 +33,7 @@ class ProjectSalaryPayment extends BaseModel
public function getAnnexAttr($value)
{
return json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
public function getApplyDateAttr($value): string
@ -44,6 +44,6 @@ class ProjectSalaryPayment extends BaseModel
public function getPaymentTypeAttr($value,$data): string
{
$dictData = DictData::where('type_value','salary_payment_type')->column('name','value');
return $dictData[$data['payment_type']];
return !empty($data['payment_type']) ? $dictData[$data['payment_type']] : '';
}
}

View File

@ -32,7 +32,7 @@ class ProjectSettlement extends BaseModel
public function getAnnexAttr($value)
{
return json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
public function getSettlementDateAttr($value): string

View File

@ -32,7 +32,7 @@ class ProjectSubcontractSettlement extends BaseModel
public function getAnnexAttr($value)
{
return json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
public function getSettlementDateAttr($value): string

View File

@ -32,7 +32,7 @@ class QualityAccept extends BaseModel
public function getFileAttr($value)
{
return json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
public function getAcceptDateAttr($value): string

View File

@ -32,7 +32,7 @@ class QualityAccident extends BaseModel
public function getFileAttr($value)
{
return json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
public function getHappenDateAttr($value): string

View File

@ -32,7 +32,7 @@ class QualityDetection extends BaseModel
public function getFileAttr($value)
{
return json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
public function getScheduledStartTimeAttr($value): string

View File

@ -33,11 +33,11 @@ class QualityDetectionTemp extends BaseModel
public function getFileAttr($value)
{
return json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
public function getNodeTextAttr($value,$data) {
$dictData = DictData::where('type_value','quality_detection_node')->column('name','value');
return $dictData[$data['node']];
return !empty($data['node']) ? $dictData[$data['node']] : '';
}
}

View File

@ -32,7 +32,7 @@ class QualityEvent extends BaseModel
public function getFileAttr($value)
{
return json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
public function getHappenDateAttr($value): string

View File

@ -32,6 +32,6 @@ class QualityMbo extends BaseModel
public function getFileAttr($value)
{
return json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
}

View File

@ -37,6 +37,6 @@ class QualitySpecification extends BaseModel
public function getFileAttr($value)
{
return json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
}

View File

@ -32,7 +32,7 @@ class QualitySupervise extends BaseModel
public function getFileAttr($value)
{
return json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
public function getHappenDateAttr($value): string

View File

@ -32,7 +32,7 @@ class SafetyAccident extends BaseModel
public function getFileAttr($value)
{
return json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
public function getHappenTimeAttr($value): string

View File

@ -32,7 +32,7 @@ class SafetyCheck extends BaseModel
public function getFileAttr($value)
{
return json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
public function getCheckDateAttr($value): string

View File

@ -32,7 +32,7 @@ class SafetyEmergencyPlan extends BaseModel
public function getFileAttr($value)
{
return json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
public function getHappenDateAttr($value): string

View File

@ -32,7 +32,7 @@ class SafetyEvaluate extends BaseModel
public function getFileAttr($value)
{
return json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
public function getHappenDateAttr($value): string

View File

@ -32,7 +32,7 @@ class SafetyEvent extends BaseModel
public function getFileAttr($value)
{
return json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
public function getHappenTimeAttr($value): string

View File

@ -32,6 +32,6 @@ class SafetyHazard extends BaseModel
public function getFileAttr($value)
{
return json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
}

View File

@ -32,6 +32,6 @@ class SafetyProductMonth extends BaseModel
public function getFileAttr($value)
{
return json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
}

View File

@ -32,7 +32,7 @@ class SafetyRehearsal extends BaseModel
public function getFileAttr($value)
{
return json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
public function getHappenDateAttr($value): string

View File

@ -32,6 +32,6 @@ class SafetyStandard extends BaseModel
public function getFileAttr($value)
{
return json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
}

View File

@ -32,7 +32,7 @@ class SafetySupervise extends BaseModel
public function getFileAttr($value)
{
return json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
public function getHappenTimeAttr($value): string

View File

@ -32,6 +32,6 @@ class SafetyTarget extends BaseModel
public function getFileAttr($value)
{
return json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
}

View File

@ -33,12 +33,12 @@ class Supplier extends BaseModel
public function getAnnexAttr($value)
{
return empty($value) ? null : json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
public function getSupplierPhotosAttr($value)
{
return empty($value) ? null : json_decode($value,true);
return !empty($value) ? json_decode($value,true) : '';
}
public function getBirthdayAttr($value): string
@ -56,19 +56,19 @@ class Supplier extends BaseModel
public function getSupplierGroupTextAttr($value,$data): string
{
$dict = DictData::where('type_value','supplier_group')->column('name','value');
return $dict[$data['supplier_group']];
return !empty($data['supplier_group']) ? $dict[$data['supplier_group']] : '';
}
public function getSupplierCategoryTextAttr($value,$data): string
{
$dict = DictData::where('type_value','supplier_category')->column('name','value');
return $dict[$data['supplier_category']];
return !empty($data['supplier_category']) ? $dict[$data['supplier_category']] : '';
}
public function getSupplierGradeTextAttr($value,$data): string
{
$dict = DictData::where('type_value','supplier_grade')->column('name','value');
return $dict[$data['supplier_grade']];
return !empty($data['supplier_grade']) ? $dict[$data['supplier_grade']] : '';
}
}