From 258c880ec77dec64a7d0721c3c226a5b45026774 Mon Sep 17 00:00:00 2001 From: weiz <736250432@qq.com> Date: Sun, 21 Jan 2024 09:43:44 +0800 Subject: [PATCH] update --- .../statistics/StatisticsController.php | 54 +++++++++++++++++++ .../logic/project/ProjectFollowUpLogic.php | 4 +- .../bid/BidBiddingDecisionValidate.php | 3 +- .../bid/BidDocumentExaminationValidate.php | 3 +- .../validate/bid/BidResultValidate.php | 3 +- .../validate/bid/BidSecurityApplyValidate.php | 3 +- .../bid/BidSecurityRefundValidate.php | 3 +- .../validate/contract/ContractValidate.php | 3 +- .../contract/ProcurementContractValidate.php | 3 +- ...contractingContractNegotiationValidate.php | 3 +- .../SubcontractingContractValidate.php | 3 +- .../custom/CustomContactsValidate.php | 3 +- .../validate/custom/CustomFollowValidate.php | 3 +- .../custom/CustomerDemandSolutionValidate.php | 3 +- .../custom/CustomerDemandValidate.php | 3 +- .../finance/FinanceInvoiceApplyValidate.php | 3 +- .../finance/FinancePaymentApplyValidate.php | 3 +- .../finance/FinancePaymentPlanValidate.php | 3 +- .../finance/FinanceReceiptRecordValidate.php | 3 +- .../finance/FinanceRefundApplyValidate.php | 3 +- .../finance/FinanceRefundRecordValidate.php | 3 +- .../finance/FinanceReturnedMoneyValidate.php | 3 +- .../finance/FinanceReturnedRecordValidate.php | 3 +- .../MaterialPurchaseRequestValidate.php | 3 +- .../validate/material/MaterialValidate.php | 3 +- .../material/MaterialWarehouseValidate.php | 3 +- .../validate/project/CompetitorValidate.php | 3 +- .../project/ProjectEstimateValidate.php | 3 +- .../project/ProjectFollowUpValidate.php | 6 +-- .../project/ProjectMaterialBudgetValidate.php | 3 +- .../ProjectSubpackageBudgetValidate.php | 3 +- .../validate/quotation/QuotationValidate.php | 3 +- .../supplier/SupplierContactsValidate.php | 3 +- .../validate/supplier/SupplierValidate.php | 3 +- app/common/model/project/ProjectFollowUp.php | 4 +- 35 files changed, 92 insertions(+), 69 deletions(-) create mode 100644 app/adminapi/controller/statistics/StatisticsController.php diff --git a/app/adminapi/controller/statistics/StatisticsController.php b/app/adminapi/controller/statistics/StatisticsController.php new file mode 100644 index 000000000..3b89b6971 --- /dev/null +++ b/app/adminapi/controller/statistics/StatisticsController.php @@ -0,0 +1,54 @@ +request->get('year'); + if(empty($year)){ + $year = date('Y'); + } + $column = ['1','2','3','4','5','6','7','8','9','10','11','12']; + $series = [ + 'name' => '客户数', + 'data' => [] + ]; + foreach($column as &$v){ + $month = $v; + if($month < 10){ + $month = '0'.$month; + } + $series['data'][] = Custom::field('id')->whereMonth('create_time', $year.'-'.$month)->count(); + $v = $v.'月'; + } + $custom_total = Custom::field('id')->count(); + $this_year_add = Custom::field('id')->whereYear('create_time',date('Y'))->count(); + $result = [ + 'column' => $column, + 'series' => $series, + 'custom_total' => $custom_total, + 'this_year_add' => $this_year_add + ]; + return $this->success('success',$result); + } + + //项目立项 + public function projectInitiation(){ + //立项总数 + $project_total = Project::field('id')->where('status',0)->count(); + //项目跟进 + $project_follow_total = ProjectInsuranceManagement::field('id')->count(); + //项目需求 +// $project_demand_total = + } + + } \ No newline at end of file diff --git a/app/adminapi/logic/project/ProjectFollowUpLogic.php b/app/adminapi/logic/project/ProjectFollowUpLogic.php index 219fe5807..ffdca9da6 100644 --- a/app/adminapi/logic/project/ProjectFollowUpLogic.php +++ b/app/adminapi/logic/project/ProjectFollowUpLogic.php @@ -58,7 +58,7 @@ class ProjectFollowUpLogic extends BaseLogic 'follow_stage' => $params['follow_stage'], 'notes' => $params['notes'] ?? '', 'next_follow_up_date' => !empty($params['next_follow_up_date']) ? strtotime($params['next_follow_up_date']) : 0, - 'file' => $params['file']? json_encode($params['file']) : null, + 'annex' => $params['annex']? json_encode($params['annex']) : null, ]); Project::where('id', $params['project_id'])->update([ 'status' => 1, @@ -101,7 +101,7 @@ class ProjectFollowUpLogic extends BaseLogic 'follow_stage' => $params['follow_stage'], 'notes' => $params['notes'] ?? '', 'next_follow_up_date' => !empty($params['next_follow_up_date']) ? strtotime($params['next_follow_up_date']) : 0, - 'file' => $params['file']? json_encode($params['file']) : null, + 'annex' => $params['annex']? json_encode($params['annex']) : null, 'update_time' => time(), ]); Db::commit(); diff --git a/app/adminapi/validate/bid/BidBiddingDecisionValidate.php b/app/adminapi/validate/bid/BidBiddingDecisionValidate.php index b4fd36591..5abc3c153 100644 --- a/app/adminapi/validate/bid/BidBiddingDecisionValidate.php +++ b/app/adminapi/validate/bid/BidBiddingDecisionValidate.php @@ -175,8 +175,7 @@ class BidBiddingDecisionValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/bid/BidDocumentExaminationValidate.php b/app/adminapi/validate/bid/BidDocumentExaminationValidate.php index 3a17b52d9..3172a8bbf 100644 --- a/app/adminapi/validate/bid/BidDocumentExaminationValidate.php +++ b/app/adminapi/validate/bid/BidDocumentExaminationValidate.php @@ -134,8 +134,7 @@ class BidDocumentExaminationValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/bid/BidResultValidate.php b/app/adminapi/validate/bid/BidResultValidate.php index fac5aa941..377e8676c 100644 --- a/app/adminapi/validate/bid/BidResultValidate.php +++ b/app/adminapi/validate/bid/BidResultValidate.php @@ -136,8 +136,7 @@ class BidResultValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/bid/BidSecurityApplyValidate.php b/app/adminapi/validate/bid/BidSecurityApplyValidate.php index 4322d8bf9..15c054c83 100644 --- a/app/adminapi/validate/bid/BidSecurityApplyValidate.php +++ b/app/adminapi/validate/bid/BidSecurityApplyValidate.php @@ -127,8 +127,7 @@ class BidSecurityApplyValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/bid/BidSecurityRefundValidate.php b/app/adminapi/validate/bid/BidSecurityRefundValidate.php index 73a4aa256..c332788ff 100644 --- a/app/adminapi/validate/bid/BidSecurityRefundValidate.php +++ b/app/adminapi/validate/bid/BidSecurityRefundValidate.php @@ -112,8 +112,7 @@ class BidSecurityRefundValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/contract/ContractValidate.php b/app/adminapi/validate/contract/ContractValidate.php index 785aea15e..d8a84e990 100644 --- a/app/adminapi/validate/contract/ContractValidate.php +++ b/app/adminapi/validate/contract/ContractValidate.php @@ -217,8 +217,7 @@ class ContractValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/contract/ProcurementContractValidate.php b/app/adminapi/validate/contract/ProcurementContractValidate.php index c3bb561f0..56bffccc6 100644 --- a/app/adminapi/validate/contract/ProcurementContractValidate.php +++ b/app/adminapi/validate/contract/ProcurementContractValidate.php @@ -194,8 +194,7 @@ class ProcurementContractValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/contract/SubcontractingContractNegotiationValidate.php b/app/adminapi/validate/contract/SubcontractingContractNegotiationValidate.php index 598b1db9c..1047b0419 100644 --- a/app/adminapi/validate/contract/SubcontractingContractNegotiationValidate.php +++ b/app/adminapi/validate/contract/SubcontractingContractNegotiationValidate.php @@ -127,8 +127,7 @@ class SubcontractingContractNegotiationValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/contract/SubcontractingContractValidate.php b/app/adminapi/validate/contract/SubcontractingContractValidate.php index f11eeb9ca..ef71d89c0 100644 --- a/app/adminapi/validate/contract/SubcontractingContractValidate.php +++ b/app/adminapi/validate/contract/SubcontractingContractValidate.php @@ -188,8 +188,7 @@ class SubcontractingContractValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/custom/CustomContactsValidate.php b/app/adminapi/validate/custom/CustomContactsValidate.php index 409a93d84..80d1a9b02 100644 --- a/app/adminapi/validate/custom/CustomContactsValidate.php +++ b/app/adminapi/validate/custom/CustomContactsValidate.php @@ -108,8 +108,7 @@ class CustomContactsValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/custom/CustomFollowValidate.php b/app/adminapi/validate/custom/CustomFollowValidate.php index 309321795..71670285c 100644 --- a/app/adminapi/validate/custom/CustomFollowValidate.php +++ b/app/adminapi/validate/custom/CustomFollowValidate.php @@ -118,8 +118,7 @@ class CustomFollowValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/custom/CustomerDemandSolutionValidate.php b/app/adminapi/validate/custom/CustomerDemandSolutionValidate.php index e905d1936..126a5f223 100644 --- a/app/adminapi/validate/custom/CustomerDemandSolutionValidate.php +++ b/app/adminapi/validate/custom/CustomerDemandSolutionValidate.php @@ -147,8 +147,7 @@ class CustomerDemandSolutionValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/custom/CustomerDemandValidate.php b/app/adminapi/validate/custom/CustomerDemandValidate.php index 5036a06dc..0c3ea9a15 100644 --- a/app/adminapi/validate/custom/CustomerDemandValidate.php +++ b/app/adminapi/validate/custom/CustomerDemandValidate.php @@ -143,8 +143,7 @@ class CustomerDemandValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/finance/FinanceInvoiceApplyValidate.php b/app/adminapi/validate/finance/FinanceInvoiceApplyValidate.php index e7fa6346e..c97f3c913 100644 --- a/app/adminapi/validate/finance/FinanceInvoiceApplyValidate.php +++ b/app/adminapi/validate/finance/FinanceInvoiceApplyValidate.php @@ -145,8 +145,7 @@ class FinanceInvoiceApplyValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/finance/FinancePaymentApplyValidate.php b/app/adminapi/validate/finance/FinancePaymentApplyValidate.php index 7c7d40604..c91c28b54 100644 --- a/app/adminapi/validate/finance/FinancePaymentApplyValidate.php +++ b/app/adminapi/validate/finance/FinancePaymentApplyValidate.php @@ -191,8 +191,7 @@ class FinancePaymentApplyValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/finance/FinancePaymentPlanValidate.php b/app/adminapi/validate/finance/FinancePaymentPlanValidate.php index 7c89fbbaf..781556bc0 100644 --- a/app/adminapi/validate/finance/FinancePaymentPlanValidate.php +++ b/app/adminapi/validate/finance/FinancePaymentPlanValidate.php @@ -156,8 +156,7 @@ class FinancePaymentPlanValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/finance/FinanceReceiptRecordValidate.php b/app/adminapi/validate/finance/FinanceReceiptRecordValidate.php index 76fec3fc7..c9fb4e46c 100644 --- a/app/adminapi/validate/finance/FinanceReceiptRecordValidate.php +++ b/app/adminapi/validate/finance/FinanceReceiptRecordValidate.php @@ -157,8 +157,7 @@ class FinanceReceiptRecordValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/finance/FinanceRefundApplyValidate.php b/app/adminapi/validate/finance/FinanceRefundApplyValidate.php index 66f8249b9..84251d38d 100644 --- a/app/adminapi/validate/finance/FinanceRefundApplyValidate.php +++ b/app/adminapi/validate/finance/FinanceRefundApplyValidate.php @@ -130,8 +130,7 @@ class FinanceRefundApplyValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/finance/FinanceRefundRecordValidate.php b/app/adminapi/validate/finance/FinanceRefundRecordValidate.php index f9cd58c94..936b3059a 100644 --- a/app/adminapi/validate/finance/FinanceRefundRecordValidate.php +++ b/app/adminapi/validate/finance/FinanceRefundRecordValidate.php @@ -148,8 +148,7 @@ class FinanceRefundRecordValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/finance/FinanceReturnedMoneyValidate.php b/app/adminapi/validate/finance/FinanceReturnedMoneyValidate.php index a14fcaa2e..b8d59f1da 100644 --- a/app/adminapi/validate/finance/FinanceReturnedMoneyValidate.php +++ b/app/adminapi/validate/finance/FinanceReturnedMoneyValidate.php @@ -144,8 +144,7 @@ class FinanceReturnedMoneyValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/finance/FinanceReturnedRecordValidate.php b/app/adminapi/validate/finance/FinanceReturnedRecordValidate.php index 66cac20fc..b7dd2781c 100644 --- a/app/adminapi/validate/finance/FinanceReturnedRecordValidate.php +++ b/app/adminapi/validate/finance/FinanceReturnedRecordValidate.php @@ -161,8 +161,7 @@ class FinanceReturnedRecordValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/material/MaterialPurchaseRequestValidate.php b/app/adminapi/validate/material/MaterialPurchaseRequestValidate.php index 4c358b65f..608fef2d4 100644 --- a/app/adminapi/validate/material/MaterialPurchaseRequestValidate.php +++ b/app/adminapi/validate/material/MaterialPurchaseRequestValidate.php @@ -137,8 +137,7 @@ class MaterialPurchaseRequestValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/material/MaterialValidate.php b/app/adminapi/validate/material/MaterialValidate.php index d6b158fbf..c543585cc 100644 --- a/app/adminapi/validate/material/MaterialValidate.php +++ b/app/adminapi/validate/material/MaterialValidate.php @@ -136,8 +136,7 @@ class MaterialValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/material/MaterialWarehouseValidate.php b/app/adminapi/validate/material/MaterialWarehouseValidate.php index 608e8ae3d..26bc9620d 100644 --- a/app/adminapi/validate/material/MaterialWarehouseValidate.php +++ b/app/adminapi/validate/material/MaterialWarehouseValidate.php @@ -144,8 +144,7 @@ class MaterialWarehouseValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/project/CompetitorValidate.php b/app/adminapi/validate/project/CompetitorValidate.php index 661693422..4feeecb1a 100644 --- a/app/adminapi/validate/project/CompetitorValidate.php +++ b/app/adminapi/validate/project/CompetitorValidate.php @@ -146,8 +146,7 @@ class CompetitorValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/project/ProjectEstimateValidate.php b/app/adminapi/validate/project/ProjectEstimateValidate.php index 26e072c5e..34dce4fcc 100644 --- a/app/adminapi/validate/project/ProjectEstimateValidate.php +++ b/app/adminapi/validate/project/ProjectEstimateValidate.php @@ -198,8 +198,7 @@ class ProjectEstimateValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/project/ProjectFollowUpValidate.php b/app/adminapi/validate/project/ProjectFollowUpValidate.php index b89f3f41b..c8eb3ec7c 100644 --- a/app/adminapi/validate/project/ProjectFollowUpValidate.php +++ b/app/adminapi/validate/project/ProjectFollowUpValidate.php @@ -43,7 +43,7 @@ class ProjectFollowUpValidate extends BaseValidate 'follow_status' => 'require|checkStatus', 'follow_stage' => 'require|checkStage', 'next_follow_up_date' => 'date|dateFormat:Y-m-d|checkNextFollowUpDate', - 'file' => 'checkFile', + 'annex' => 'checkAnnex', ]; protected $message = [ @@ -155,9 +155,9 @@ class ProjectFollowUpValidate extends BaseValidate return true; } - public function checkFile($value): bool|string + public function checkAnnex($value): bool|string { - if($value){ + if(!empty($value) && $value != ''){ if(!is_array($value)){ return '附件格式错误'; } diff --git a/app/adminapi/validate/project/ProjectMaterialBudgetValidate.php b/app/adminapi/validate/project/ProjectMaterialBudgetValidate.php index a31184123..5c6958714 100644 --- a/app/adminapi/validate/project/ProjectMaterialBudgetValidate.php +++ b/app/adminapi/validate/project/ProjectMaterialBudgetValidate.php @@ -133,8 +133,7 @@ class ProjectMaterialBudgetValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/project/ProjectSubpackageBudgetValidate.php b/app/adminapi/validate/project/ProjectSubpackageBudgetValidate.php index fd3353479..5de3ae4af 100644 --- a/app/adminapi/validate/project/ProjectSubpackageBudgetValidate.php +++ b/app/adminapi/validate/project/ProjectSubpackageBudgetValidate.php @@ -137,8 +137,7 @@ class ProjectSubpackageBudgetValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/quotation/QuotationValidate.php b/app/adminapi/validate/quotation/QuotationValidate.php index 68440293d..3ae83508c 100644 --- a/app/adminapi/validate/quotation/QuotationValidate.php +++ b/app/adminapi/validate/quotation/QuotationValidate.php @@ -200,8 +200,7 @@ class QuotationValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/supplier/SupplierContactsValidate.php b/app/adminapi/validate/supplier/SupplierContactsValidate.php index 5cfb9c4f0..a30eb6a7c 100644 --- a/app/adminapi/validate/supplier/SupplierContactsValidate.php +++ b/app/adminapi/validate/supplier/SupplierContactsValidate.php @@ -137,8 +137,7 @@ class SupplierContactsValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/adminapi/validate/supplier/SupplierValidate.php b/app/adminapi/validate/supplier/SupplierValidate.php index 9de6936f4..bdd1485a6 100644 --- a/app/adminapi/validate/supplier/SupplierValidate.php +++ b/app/adminapi/validate/supplier/SupplierValidate.php @@ -171,8 +171,7 @@ class SupplierValidate extends BaseValidate public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ - $annex = $value;//json_decode($value,true); - if(empty($annex) || !is_array($annex)){ + if(!is_array($value)){ return '附件格式错误'; } } diff --git a/app/common/model/project/ProjectFollowUp.php b/app/common/model/project/ProjectFollowUp.php index da913c28c..9ef41ae90 100644 --- a/app/common/model/project/ProjectFollowUp.php +++ b/app/common/model/project/ProjectFollowUp.php @@ -65,8 +65,8 @@ class ProjectFollowUp extends BaseModel return !empty($value) ? date('Y-m-d',$value) : ''; } - public function getFileAttr($value) + public function getAnnexAttr($value) { - return !empty($value) ? json_decode($value) : null; + return !empty($value) ? json_decode($value) : ''; } } \ No newline at end of file