diff --git a/app/adminapi/http/middleware/LoginMiddleware.php b/app/adminapi/http/middleware/LoginMiddleware.php index 0a09cef25..673246608 100755 --- a/app/adminapi/http/middleware/LoginMiddleware.php +++ b/app/adminapi/http/middleware/LoginMiddleware.php @@ -70,7 +70,7 @@ class LoginMiddleware //给request赋值,用于控制器 $request->adminInfo = $adminInfo; - $request->adminId = $adminInfo['admin_id'] ?? 0; + $request->adminId = $adminInfo['admin_id'] ?: 0; return $next($request); } diff --git a/app/adminapi/listener/OperationLog.php b/app/adminapi/listener/OperationLog.php index 9bab18a9c..72efecf38 100755 --- a/app/adminapi/listener/OperationLog.php +++ b/app/adminapi/listener/OperationLog.php @@ -64,7 +64,7 @@ class OperationLog //记录日志 $systemLog = new \app\common\model\OperationLog(); - $systemLog->admin_id = $request->adminInfo['admin_id'] ?? 0; + $systemLog->admin_id = $request->adminInfo['admin_id'] ?: 0; $systemLog->admin_name = $request->adminInfo['name'] ?? ''; $systemLog->action = $notes; $systemLog->account = $request->adminInfo['account'] ?? ''; diff --git a/app/adminapi/logic/administrative/AdministrativePaymentsLogic.php b/app/adminapi/logic/administrative/AdministrativePaymentsLogic.php index 4d46e5d15..8b446b0b2 100644 --- a/app/adminapi/logic/administrative/AdministrativePaymentsLogic.php +++ b/app/adminapi/logic/administrative/AdministrativePaymentsLogic.php @@ -41,15 +41,15 @@ class AdministrativePaymentsLogic extends BaseLogic Db::startTrans(); try { AdministrativePayments::create([ - 'org_id' => $params['org_id'] ?? 0, - 'dept_id' => $params['dept_id'] ?? 0, - 'approve_id' => $params['approve_id'] ?? 0, - 'administrative_contract_id' => $params['administrative_contract_id'] ?? 0, + 'org_id' => $params['org_id'] ?: 0, + 'dept_id' => $params['dept_id'] ?: 0, + 'approve_id' => $params['approve_id'] ?: 0, + 'administrative_contract_id' => $params['administrative_contract_id'] ?: 0, 'applier' => $params['applier'] ?? '', 'apply_date' => $params['apply_date'] ?? '', - 'pay_type' => $params['pay_type'] ?? 0, - 'payment_rate' => $params['payment_rate'] ?? 0, - 'payment_amount' => $params['payment_amount'] ?? 0, + 'pay_type' => $params['pay_type'] ?: 0, + 'payment_rate' => $params['payment_rate'] ?: 0, + 'payment_amount' => $params['payment_amount'] ?: 0, 'remark' => $params['remark'] ?? '', 'annex' => $params['annex'] ?? '', 'deposit_bank' => $params['deposit_bank'] ?? '', diff --git a/app/adminapi/logic/administrative/AdministrativeTicketCollectionLogic.php b/app/adminapi/logic/administrative/AdministrativeTicketCollectionLogic.php index c5e0b6dee..0133755bb 100644 --- a/app/adminapi/logic/administrative/AdministrativeTicketCollectionLogic.php +++ b/app/adminapi/logic/administrative/AdministrativeTicketCollectionLogic.php @@ -41,17 +41,17 @@ class AdministrativeTicketCollectionLogic extends BaseLogic Db::startTrans(); try { AdministrativeTicketCollection::create([ - 'org_id' => $params['org_id'] ?? 0, - 'dept_id' => $params['dept_id'] ?? 0, - 'administrative_contract_id' => $params['administrative_contract_id'] ?? 0, + 'org_id' => $params['org_id'] ?: 0, + 'dept_id' => $params['dept_id'] ?: 0, + 'administrative_contract_id' => $params['administrative_contract_id'] ?: 0, 'invoicing_date' => $params['invoicing_date'] ?? '', 'commitor' => $params['commitor'] ?? '', - 'invoice_type' => $params['invoice_type'] ?? 0, + 'invoice_type' => $params['invoice_type'] ?: 0, 'invoice_sn' => $params['invoice_sn'] ?? '', - 'invoice_amount' => $params['invoice_amount'] ?? 0, - 'invoice_tax_rate' => $params['invoice_tax_rate'] ?? 0, - 'tax' => $params['tax'] ?? 0, - 'amount_excluding_tax' => $params['amount_excluding_tax'] ?? 0, + 'invoice_amount' => $params['invoice_amount'] ?: 0, + 'invoice_tax_rate' => $params['invoice_tax_rate'] ?: 0, + 'tax' => $params['tax'] ?: 0, + 'amount_excluding_tax' => $params['amount_excluding_tax'] ?: 0, 'receipt_date' => $params['receipt_date'] ?? '', 'remark' => $params['remark'] ?? '', 'annex' => $params['annex'] ?? '', diff --git a/app/adminapi/logic/article/ArticleCateLogic.php b/app/adminapi/logic/article/ArticleCateLogic.php index 1836fe6eb..6224631f0 100755 --- a/app/adminapi/logic/article/ArticleCateLogic.php +++ b/app/adminapi/logic/article/ArticleCateLogic.php @@ -38,7 +38,7 @@ class ArticleCateLogic extends BaseLogic ArticleCate::create([ 'name' => $params['name'], 'is_show' => $params['is_show'], - 'sort' => $params['sort'] ?? 0 + 'sort' => $params['sort'] ?: 0 ]); } @@ -57,7 +57,7 @@ class ArticleCateLogic extends BaseLogic 'id' => $params['id'], 'name' => $params['name'], 'is_show' => $params['is_show'], - 'sort' => $params['sort'] ?? 0 + 'sort' => $params['sort'] ?: 0 ]); return true; } catch (\Exception $e) { diff --git a/app/adminapi/logic/article/ArticleLogic.php b/app/adminapi/logic/article/ArticleLogic.php index 641ab0404..a07a97e6c 100755 --- a/app/adminapi/logic/article/ArticleLogic.php +++ b/app/adminapi/logic/article/ArticleLogic.php @@ -38,9 +38,9 @@ class ArticleLogic extends BaseLogic 'title' => $params['title'], 'desc' => $params['desc'] ?? '', 'author' => $params['author'] ?? '', //作者 - 'sort' => $params['sort'] ?? 0, // 排序 + 'sort' => $params['sort'] ?: 0, // 排序 'abstract' => $params['abstract'], // 文章摘要 - 'click_virtual' => $params['click_virtual'] ?? 0, + 'click_virtual' => $params['click_virtual'] ?: 0, 'image' => $params['image'] ? FileService::setFileUrl($params['image']) : '', 'cid' => $params['cid'], 'is_show' => $params['is_show'], @@ -64,9 +64,9 @@ class ArticleLogic extends BaseLogic 'title' => $params['title'], 'desc' => $params['desc'] ?? '', // 简介 'author' => $params['author'] ?? '', //作者 - 'sort' => $params['sort'] ?? 0, // 排序 + 'sort' => $params['sort'] ?: 0, // 排序 'abstract' => $params['abstract'], // 文章摘要 - 'click_virtual' => $params['click_virtual'] ?? 0, + 'click_virtual' => $params['click_virtual'] ?: 0, 'image' => $params['image'] ? FileService::setFileUrl($params['image']) : '', 'cid' => $params['cid'], 'is_show' => $params['is_show'], diff --git a/app/adminapi/logic/auth/RoleLogic.php b/app/adminapi/logic/auth/RoleLogic.php index 7bcf69ebd..8c6c49a32 100755 --- a/app/adminapi/logic/auth/RoleLogic.php +++ b/app/adminapi/logic/auth/RoleLogic.php @@ -48,7 +48,7 @@ class RoleLogic extends BaseLogic $role = SystemRole::create([ 'name' => $params['name'], 'desc' => $params['desc'] ?? '', - 'sort' => $params['sort'] ?? 0, + 'sort' => $params['sort'] ?: 0, ]); $data = []; @@ -99,7 +99,7 @@ class RoleLogic extends BaseLogic 'id' => $params['id'], 'name' => $params['name'], 'desc' => $params['desc'] ?? '', - 'sort' => $params['sort'] ?? 0, + 'sort' => $params['sort'] ?: 0, ]); if (!empty($menuId)) { diff --git a/app/adminapi/logic/bank/RevenueExpenditureStatementLogic.php b/app/adminapi/logic/bank/RevenueExpenditureStatementLogic.php index 9801a23b6..4860ac41b 100644 --- a/app/adminapi/logic/bank/RevenueExpenditureStatementLogic.php +++ b/app/adminapi/logic/bank/RevenueExpenditureStatementLogic.php @@ -41,19 +41,19 @@ class RevenueExpenditureStatementLogic extends BaseLogic Db::startTrans(); try { RevenueExpenditureStatement::create([ - 'org_id' => $params['org_id'] ?? 0, - 'dept_id' => $params['dept_id'] ?? 0, - 'document_type' => $params['document_type'] ?? 0, + 'org_id' => $params['org_id'] ?: 0, + 'dept_id' => $params['dept_id'] ?: 0, + 'document_type' => $params['document_type'] ?: 0, 'document_no' => $params['document_no'] ?? '', - 'contract_id' => $params['contract_id'] ?? 0, - 'contract_type' => $params['contract_type'] ?? 0, - 'bank_account_id' => $params['bank_account_id'] ?? 0, + 'contract_id' => $params['contract_id'] ?: 0, + 'contract_type' => $params['contract_type'] ?: 0, + 'bank_account_id' => $params['bank_account_id'] ?: 0, 'create_date' => $params['create_date'] ?? '', - 'handled_by' => $params['handled_by'] ?? 0, - 'amount' => $params['amount'] ?? 0, - 'is_generate_vouchers' => $params['is_generate_vouchers'] ?? 0, + 'handled_by' => $params['handled_by'] ?: 0, + 'amount' => $params['amount'] ?: 0, + 'is_generate_vouchers' => $params['is_generate_vouchers'] ?: 0, 'vouchers_sn' => $params['vouchers_sn'] ?? '', - 'is_interest' => $params['is_interest'] ?? 0, + 'is_interest' => $params['is_interest'] ?: 0, 'interest_date' => $params['interest_date'] ?? '', 'remark' => $params['remark'] ?? '', 'annex' => $params['annex'] ?? '', @@ -81,19 +81,19 @@ class RevenueExpenditureStatementLogic extends BaseLogic Db::startTrans(); try { RevenueExpenditureStatement::where('id', $params['id'])->update([ - 'org_id' => $params['org_id'] ?? 0, - 'dept_id' => $params['dept_id'] ?? 0, - 'document_type' => $params['document_type'] ?? 0, + 'org_id' => $params['org_id'] ?: 0, + 'dept_id' => $params['dept_id'] ?: 0, + 'document_type' => $params['document_type'] ?: 0, 'document_no' => $params['document_no'] ?? '', - 'contract_id' => $params['contract_id'] ?? 0, - 'contract_type' => $params['contract_type'] ?? 0, - 'bank_account_id' => $params['bank_account_id'] ?? 0, + 'contract_id' => $params['contract_id'] ?: 0, + 'contract_type' => $params['contract_type'] ?: 0, + 'bank_account_id' => $params['bank_account_id'] ?: 0, 'create_date' => $params['create_date'] ?? '', - 'handled_by' => $params['handled_by'] ?? 0, - 'amount' => $params['amount'] ?? 0, - 'is_generate_vouchers' => $params['is_generate_vouchers'] ?? 0, + 'handled_by' => $params['handled_by'] ?: 0, + 'amount' => $params['amount'] ?: 0, + 'is_generate_vouchers' => $params['is_generate_vouchers'] ?: 0, 'vouchers_sn' => $params['vouchers_sn'] ?? '', - 'is_interest' => $params['is_interest'] ?? 0, + 'is_interest' => $params['is_interest'] ?: 0, 'interest_date' => $params['interest_date'] ?? '', 'remark' => $params['remark'] ?? '', 'annex' => $params['annex'] ?? '', diff --git a/app/adminapi/logic/bid/BidBiddingDecisionLogic.php b/app/adminapi/logic/bid/BidBiddingDecisionLogic.php index 4cce28b48..6cb50640f 100644 --- a/app/adminapi/logic/bid/BidBiddingDecisionLogic.php +++ b/app/adminapi/logic/bid/BidBiddingDecisionLogic.php @@ -46,16 +46,16 @@ class BidBiddingDecisionLogic extends BaseLogic 'code' => data_unique_code('投标决策'), 'project_id' => $params['project_id'], 'project_estimation' => $params['project_estimation'], - 'bidding_project_fund_source' => $params['bidding_project_fund_source'] ?? 0, + 'bidding_project_fund_source' => $params['bidding_project_fund_source'] ?: 0, 'bidding_time' => !empty($params['bidding_time']) ? strtotime($params['bidding_time']) : 0, - 'bid_type' => $params['bid_type'] ?? 0, + 'bid_type' => $params['bid_type'] ?: 0, 'competitor' => $params['competitor'] ?? '', - 'is_margin' => $params['is_margin'] ?? 0, - 'margin_amount' => $params['margin_amount'] ?? 0, + 'is_margin' => $params['is_margin'] ?: 0, + 'margin_amount' => $params['margin_amount'] ?: 0, 'bid_opening_date' => !empty($params['bid_opening_date']) ? strtotime($params['bid_opening_date']) : 0, 'margin_amount_return_date' => !empty($params['margin_amount_return_date']) ? strtotime($params['margin_amount_return_date']) : 0, - 'is_internal_resources' => $params['is_internal_resources'] ?? 0, - 'project_assurance' => $params['project_assurance'] ?? 0, + 'is_internal_resources' => $params['is_internal_resources'] ?: 0, + 'project_assurance' => $params['project_assurance'] ?: 0, 'bid_project_overview' => $params['bid_project_overview'] ?? '', 'project_desc' => $params['project_desc'] ?? '', 'annex' => $params['annex']? json_encode($params['annex']) : null, @@ -88,16 +88,16 @@ class BidBiddingDecisionLogic extends BaseLogic BidBiddingDecision::where('id', $params['id'])->update([ 'project_id' => $params['project_id'], 'project_estimation' => $params['project_estimation'], - 'bidding_project_fund_source' => $params['bidding_project_fund_source'] ?? 0, + 'bidding_project_fund_source' => $params['bidding_project_fund_source'] ?: 0, 'bidding_time' => !empty($params['bidding_time']) ? strtotime($params['bidding_time']) : 0, - 'bid_type' => $params['bid_type'] ?? 0, + 'bid_type' => $params['bid_type'] ?: 0, 'competitor' => $params['competitor'] ?? '', - 'is_margin' => $params['is_margin'] ?? 0, - 'margin_amount' => $params['margin_amount'] ?? 0, + 'is_margin' => $params['is_margin'] ?: 0, + 'margin_amount' => $params['margin_amount'] ?: 0, 'bid_opening_date' => !empty($params['bid_opening_date']) ? strtotime($params['bid_opening_date']) : 0, 'margin_amount_return_date' => !empty($params['margin_amount_return_date']) ? strtotime($params['margin_amount_return_date']) : 0, - 'is_internal_resources' => $params['is_internal_resources'] ?? 0, - 'project_assurance' => $params['project_assurance'] ?? 0, + 'is_internal_resources' => $params['is_internal_resources'] ?: 0, + 'project_assurance' => $params['project_assurance'] ?: 0, 'bid_project_overview' => $params['bid_project_overview'] ?? '', 'project_desc' => $params['project_desc'] ?? '', 'annex' => $params['annex']? json_encode($params['annex']) : null, diff --git a/app/adminapi/logic/bid/BidBuyBiddingDocumentLogic.php b/app/adminapi/logic/bid/BidBuyBiddingDocumentLogic.php index 9ad087ff6..32a719e2c 100644 --- a/app/adminapi/logic/bid/BidBuyBiddingDocumentLogic.php +++ b/app/adminapi/logic/bid/BidBuyBiddingDocumentLogic.php @@ -50,8 +50,8 @@ class BidBuyBiddingDocumentLogic extends BaseLogic 'bid_document_no' => data_unique_code('购买标书'), 'invite_tenders_company_name' => $params['invite_tenders_company_name'], 'bid_company_name' => $params['bid_company_name'], - 'buyer' => $params['buyer'] ?? 0, - 'amount' => $params['amount'] ?? 0, + 'buyer' => $params['buyer'] ?: 0, + 'amount' => $params['amount'] ?: 0, 'buy_date' => !empty($params['buy_date']) ? strtotime($params['buy_date']) : 0, ]); Db::commit(); @@ -80,8 +80,8 @@ class BidBuyBiddingDocumentLogic extends BaseLogic 'bid_decision_id' => $params['bid_decision_id'], 'invite_tenders_company_name' => $params['invite_tenders_company_name'], 'bid_company_name' => $params['bid_company_name'], - 'buyer' => $params['buyer'] ?? 0, - 'amount' => $params['amount'] ?? 0, + 'buyer' => $params['buyer'] ?: 0, + 'amount' => $params['amount'] ?: 0, 'buy_date' => !empty($params['buy_date']) ? strtotime($params['buy_date']) : 0, 'update_time' => time(), ]); diff --git a/app/adminapi/logic/bid/BidDocumentExaminationLogic.php b/app/adminapi/logic/bid/BidDocumentExaminationLogic.php index 1cdfdd63a..420e56f28 100644 --- a/app/adminapi/logic/bid/BidDocumentExaminationLogic.php +++ b/app/adminapi/logic/bid/BidDocumentExaminationLogic.php @@ -54,8 +54,8 @@ class BidDocumentExaminationLogic extends BaseLogic 'technical_protocol_deviation' => $params['technical_protocol_deviation'] ?? '', 'protocol_deviation_handling_plan' => $params['protocol_deviation_handling_plan'] ?? '', 'technical_review_annex' => !empty($params['technical_review_annex']) ? $params['technical_review_annex'] : null, - 'tax_rate' => $params['tax_rate'] ?? 0, - 'pay_type' => $params['pay_type'] ?? 0, + 'tax_rate' => $params['tax_rate'] ?: 0, + 'pay_type' => $params['pay_type'] ?: 0, 'pay_rate' => $params['pay_rate'] ?? '', 'business_contract_deviation' => $params['business_contract_deviation'] ?? '', 'business_contract_deviation_handling_plan' => $params['business_contract_deviation_handling_plan'] ?? '', @@ -69,7 +69,7 @@ class BidDocumentExaminationLogic extends BaseLogic 'bid_document_examination_id' => $bidDocumentExamination->id, 'product_id' => $item['product_id'], 'num' => $item['num'], - 'points' => $item['points'] ?? 0, + 'points' => $item['points'] ?: 0, 'cost_price' => $item['cost_price'], 'sale_price' => $item['sale_price'], 'cost_amount' => $item['cost_price'] * $item['num'], diff --git a/app/adminapi/logic/bid/BidSecurityRefundLogic.php b/app/adminapi/logic/bid/BidSecurityRefundLogic.php index 4d2968bd5..f0dbbed9a 100644 --- a/app/adminapi/logic/bid/BidSecurityRefundLogic.php +++ b/app/adminapi/logic/bid/BidSecurityRefundLogic.php @@ -53,7 +53,7 @@ class BidSecurityRefundLogic extends BaseLogic 'refund_date' => strtotime($params['refund_date']), 'remark' => $params['remark'] ?? '', 'annex' => $params['annex']? json_encode($params['annex']) : null, - 'bank_account_id' => $params['bank_account_id'] ?? 0, + 'bank_account_id' => $params['bank_account_id'] ?: 0, ]); Db::commit(); return true; @@ -84,7 +84,7 @@ class BidSecurityRefundLogic extends BaseLogic 'refund_date' => strtotime($params['refund_date']), 'remark' => $params['remark'] ?? '', 'annex' => $params['annex']? json_encode($params['annex']) : null, - 'bank_account_id' => $params['bank_account_id'] ?? 0, + 'bank_account_id' => $params['bank_account_id'] ?: 0, ]); Db::commit(); diff --git a/app/adminapi/logic/bill/AcceptanceBillLogic.php b/app/adminapi/logic/bill/AcceptanceBillLogic.php index 22bdac23f..a79da0871 100644 --- a/app/adminapi/logic/bill/AcceptanceBillLogic.php +++ b/app/adminapi/logic/bill/AcceptanceBillLogic.php @@ -41,18 +41,18 @@ class AcceptanceBillLogic extends BaseLogic Db::startTrans(); try { AcceptanceBill::create([ - 'org_id' => $params['org_id'] ?? 0, - 'dept_id' => $params['dept_id'] ?? 0, - 'customer_id' => $params['customer_id'] ?? 0, - 'project_id' => $params['project_id'] ?? 0, - 'contract_id' => $params['contract_id'] ?? 0, + 'org_id' => $params['org_id'] ?: 0, + 'dept_id' => $params['dept_id'] ?: 0, + 'customer_id' => $params['customer_id'] ?: 0, + 'project_id' => $params['project_id'] ?: 0, + 'contract_id' => $params['contract_id'] ?: 0, 'receipt_date' => $params['receipt_date'] ?? '', 'bill_sn' => $params['bill_sn'] ?? '', - 'bank_account_id' => $params['bank_account_id'] ?? 0, - 'bill_type' => $params['bill_type'] ?? 0, + 'bank_account_id' => $params['bank_account_id'] ?: 0, + 'bill_type' => $params['bill_type'] ?: 0, 'draft_acceptance_bank' => $params['draft_acceptance_bank'] ?? '', 'bill_due_date' => $params['bill_due_date'] ?? '', - 'receipt_amount' => $params['receipt_amount'] ?? 0, + 'receipt_amount' => $params['receipt_amount'] ?: 0, 'receipt_amount_daxie' => $params['receipt_amount_daxie'] ?? '', 'remark' => $params['remark'] ?? '', 'annex' => $params['annex'] ?? '', @@ -80,18 +80,18 @@ class AcceptanceBillLogic extends BaseLogic Db::startTrans(); try { AcceptanceBill::where('id', $params['id'])->update([ - 'org_id' => $params['org_id'] ?? 0, - 'dept_id' => $params['dept_id'] ?? 0, - 'customer_id' => $params['customer_id'] ?? 0, - 'project_id' => $params['project_id'] ?? 0, - 'contract_id' => $params['contract_id'] ?? 0, + 'org_id' => $params['org_id'] ?: 0, + 'dept_id' => $params['dept_id'] ?: 0, + 'customer_id' => $params['customer_id'] ?: 0, + 'project_id' => $params['project_id'] ?: 0, + 'contract_id' => $params['contract_id'] ?: 0, 'receipt_date' => $params['receipt_date'] ?? '', 'bill_sn' => $params['bill_sn'] ?? '', - 'bank_account_id' => $params['bank_account_id'] ?? 0, - 'bill_type' => $params['bill_type'] ?? 0, + 'bank_account_id' => $params['bank_account_id'] ?: 0, + 'bill_type' => $params['bill_type'] ?: 0, 'draft_acceptance_bank' => $params['draft_acceptance_bank'] ?? '', 'bill_due_date' => $params['bill_due_date'] ?? '', - 'receipt_amount' => $params['receipt_amount'] ?? 0, + 'receipt_amount' => $params['receipt_amount'] ?: 0, 'receipt_amount_daxie' => $params['receipt_amount_daxie'] ?? '', 'remark' => $params['remark'] ?? '', 'annex' => $params['annex'] ?? '', diff --git a/app/adminapi/logic/bill/RedemptionBillLogic.php b/app/adminapi/logic/bill/RedemptionBillLogic.php index 182f5cc0a..b5f87e3d1 100644 --- a/app/adminapi/logic/bill/RedemptionBillLogic.php +++ b/app/adminapi/logic/bill/RedemptionBillLogic.php @@ -41,11 +41,11 @@ class RedemptionBillLogic extends BaseLogic Db::startTrans(); try { RedemptionBill::create([ - 'org_id' => $params['org_id'] ?? 0, - 'dept_id' => $params['dept_id'] ?? 0, - 'acceptance_bill_id' => $params['acceptance_bill_id'] ?? 0, + 'org_id' => $params['org_id'] ?: 0, + 'dept_id' => $params['dept_id'] ?: 0, + 'acceptance_bill_id' => $params['acceptance_bill_id'] ?: 0, 'maturity_date' => $params['maturity_date'] ?? '', - 'amount' => $params['amount'] ?? 0, + 'amount' => $params['amount'] ?: 0, 'remark' => $params['remark'] ?? '', 'annex' => $params['annex'] ?? '', 'amount_daxie' => $params['amount_daxie'] ?? '', @@ -73,11 +73,11 @@ class RedemptionBillLogic extends BaseLogic Db::startTrans(); try { RedemptionBill::where('id', $params['id'])->update([ - 'org_id' => $params['org_id'] ?? 0, - 'dept_id' => $params['dept_id'] ?? 0, - 'acceptance_bill_id' => $params['acceptance_bill_id'] ?? 0, + 'org_id' => $params['org_id'] ?: 0, + 'dept_id' => $params['dept_id'] ?: 0, + 'acceptance_bill_id' => $params['acceptance_bill_id'] ?: 0, 'maturity_date' => $params['maturity_date'] ?? '', - 'amount' => $params['amount'] ?? 0, + 'amount' => $params['amount'] ?: 0, 'remark' => $params['remark'] ?? '', 'annex' => $params['annex'] ?? '', 'amount_daxie' => $params['amount_daxie'] ?? '', diff --git a/app/adminapi/logic/bill/TransferBillLogic.php b/app/adminapi/logic/bill/TransferBillLogic.php index 4f3c1d9e2..9fe6285eb 100644 --- a/app/adminapi/logic/bill/TransferBillLogic.php +++ b/app/adminapi/logic/bill/TransferBillLogic.php @@ -41,13 +41,13 @@ class TransferBillLogic extends BaseLogic Db::startTrans(); try { TransferBill::create([ - 'org_id' => $params['org_id'] ?? 0, - 'dept_id' => $params['dept_id'] ?? 0, - 'supplier_id' => $params['supplier_id'] ?? 0, - 'procurement_contract_id' => $params['procurement_contract_id'] ?? 0, - 'acceptance_bill_id' => $params['acceptance_bill_id'] ?? 0, + 'org_id' => $params['org_id'] ?: 0, + 'dept_id' => $params['dept_id'] ?: 0, + 'supplier_id' => $params['supplier_id'] ?: 0, + 'procurement_contract_id' => $params['procurement_contract_id'] ?: 0, + 'acceptance_bill_id' => $params['acceptance_bill_id'] ?: 0, 'payment_date' => $params['payment_date'] ?? '', - 'amount' => $params['amount'] ?? 0, + 'amount' => $params['amount'] ?: 0, 'amount_daxie' => $params['amount_daxie'] ?? '', 'remark' => $params['remark'] ?? '', 'annex' => $params['annex'] ?? '', @@ -75,13 +75,13 @@ class TransferBillLogic extends BaseLogic Db::startTrans(); try { TransferBill::where('id', $params['id'])->update([ - 'org_id' => $params['org_id'] ?? 0, - 'dept_id' => $params['dept_id'] ?? 0, - 'supplier_id' => $params['supplier_id'] ?? 0, - 'procurement_contract_id' => $params['procurement_contract_id'] ?? 0, - 'acceptance_bill_id' => $params['acceptance_bill_id'] ?? 0, + 'org_id' => $params['org_id'] ?: 0, + 'dept_id' => $params['dept_id'] ?: 0, + 'supplier_id' => $params['supplier_id'] ?: 0, + 'procurement_contract_id' => $params['procurement_contract_id'] ?: 0, + 'acceptance_bill_id' => $params['acceptance_bill_id'] ?: 0, 'payment_date' => $params['payment_date'] ?? '', - 'amount' => $params['amount'] ?? 0, + 'amount' => $params['amount'] ?: 0, 'amount_daxie' => $params['amount_daxie'] ?? '', 'remark' => $params['remark'] ?? '', 'annex' => $params['annex'] ?? '', diff --git a/app/adminapi/logic/contract/AdministrativeContractLogic.php b/app/adminapi/logic/contract/AdministrativeContractLogic.php index 63d554036..531035106 100644 --- a/app/adminapi/logic/contract/AdministrativeContractLogic.php +++ b/app/adminapi/logic/contract/AdministrativeContractLogic.php @@ -41,18 +41,18 @@ class AdministrativeContractLogic extends BaseLogic Db::startTrans(); try { AdministrativeContract::create([ - 'org_id' => $params['org_id'] ?? 0, - 'dept_id' => $params['dept_id'] ?? 0, - 'supplier_id' => $params['supplier_id'] ?? 0, + 'org_id' => $params['org_id'] ?: 0, + 'dept_id' => $params['dept_id'] ?: 0, + 'supplier_id' => $params['supplier_id'] ?: 0, 'contract_no' => data_unique_code('XZHT'), 'contract_name' => $params['contract_name'] ?? '', - 'procurement_type' => $params['procurement_type'] ?? 0, + 'procurement_type' => $params['procurement_type'] ?: 0, 'asset_apply_no' => $params['asset_apply_no'] ?? '', 'start_date' => $params['start_date'] ?? '', 'end_date' => $params['end_date'] ?? '', 'signing_date' => $params['signing_date'] ?? '', - 'pay_type' => $params['pay_type'] ?? 0, - 'amount' => $params['amount'] ?? 0, + 'pay_type' => $params['pay_type'] ?: 0, + 'amount' => $params['amount'] ?: 0, 'amount_daxie' => $params['amount_daxie'] ?? '', 'main_content' => $params['main_content'] ?? '', 'remark' => $params['remark'] ?? '', @@ -81,17 +81,17 @@ class AdministrativeContractLogic extends BaseLogic Db::startTrans(); try { AdministrativeContract::where('id', $params['id'])->update([ - 'org_id' => $params['org_id'] ?? 0, - 'dept_id' => $params['dept_id'] ?? 0, - 'supplier_id' => $params['supplier_id'] ?? 0, + 'org_id' => $params['org_id'] ?: 0, + 'dept_id' => $params['dept_id'] ?: 0, + 'supplier_id' => $params['supplier_id'] ?: 0, 'contract_name' => $params['contract_name'] ?? '', - 'procurement_type' => $params['procurement_type'] ?? 0, + 'procurement_type' => $params['procurement_type'] ?: 0, 'asset_apply_no' => $params['asset_apply_no'] ?? '', 'start_date' => $params['start_date'] ?? '', 'end_date' => $params['end_date'] ?? '', 'signing_date' => $params['signing_date'] ?? '', - 'pay_type' => $params['pay_type'] ?? 0, - 'amount' => $params['amount'] ?? 0, + 'pay_type' => $params['pay_type'] ?: 0, + 'amount' => $params['amount'] ?: 0, 'amount_daxie' => $params['amount_daxie'] ?? '', 'main_content' => $params['main_content'] ?? '', 'remark' => $params['remark'] ?? '', diff --git a/app/adminapi/logic/contract/ContractNegotiationLogic.php b/app/adminapi/logic/contract/ContractNegotiationLogic.php index 61a56be6a..1df5ca3f8 100644 --- a/app/adminapi/logic/contract/ContractNegotiationLogic.php +++ b/app/adminapi/logic/contract/ContractNegotiationLogic.php @@ -45,7 +45,7 @@ class ContractNegotiationLogic extends BaseLogic public static function add(array $params): bool { $contract = Contract::field('project_id')->where('id',$params['contract_id'])->findOrEmpty(); - $profit = $params['negotiation_amount'] - (($params['labor_costs']??0) + ($params['material_costs']??0)); + $profit = $params['negotiation_amount'] - (($params['labor_costs']?:0) + ($params['material_costs']?:0)); $profit_rate = $profit / $params['negotiation_amount']; Db::startTrans(); try { @@ -58,9 +58,9 @@ class ContractNegotiationLogic extends BaseLogic 'negotiation_no' => data_unique_code('QS'), 'negotiation_amount' => $params['negotiation_amount'], 'negotiation_type' => $params['negotiation_type'], - 'labor_costs' => $params['labor_costs'] ?? 0, - 'material_costs' => $params['material_costs'] ?? 0, - 'warranty_amount' => $params['warranty_amount'] ?? 0, + 'labor_costs' => $params['labor_costs'] ?: 0, + 'material_costs' => $params['material_costs'] ?: 0, + 'warranty_amount' => $params['warranty_amount'] ?: 0, 'warranty_expire_date' => !empty($params['Warranty_expire_date']) ? strtotime($params['Warranty_expire_date']) : 0, 'profit' => $profit, 'profit_rate' => $profit_rate, @@ -102,9 +102,9 @@ class ContractNegotiationLogic extends BaseLogic 'negotiation_no' => data_unique_code('QS'), 'negotiation_amount' => $params['negotiation_amount'], 'negotiation_type' => $params['negotiation_type'], - 'labor_costs' => $params['labor_costs'] ?? 0, - 'material_costs' => $params['material_costs'] ?? 0, - 'warranty_amount' => $params['warranty_amount'] ?? 0, + 'labor_costs' => $params['labor_costs'] ?: 0, + 'material_costs' => $params['material_costs'] ?: 0, + 'warranty_amount' => $params['warranty_amount'] ?: 0, 'warranty_expire_date' => !empty($params['Warranty_expire_date']) ? strtotime($params['Warranty_expire_date']) : 0, 'profit' => $profit, 'profit_rate' => $profit_rate, diff --git a/app/adminapi/logic/contract/ProcurementContractChangeLogic.php b/app/adminapi/logic/contract/ProcurementContractChangeLogic.php index 6a4c2cedf..177c0b579 100644 --- a/app/adminapi/logic/contract/ProcurementContractChangeLogic.php +++ b/app/adminapi/logic/contract/ProcurementContractChangeLogic.php @@ -43,37 +43,37 @@ class ProcurementContractChangeLogic extends BaseLogic Db::startTrans(); try { ProcurementContractChange::create([ - 'org_id' => $params['org_id'] ?? 0, - 'dept_id' => $params['dept_id'] ?? 0, - 'procurement_contract_id' => $params['procurement_contract_id'] ?? 0, - 'supplier_id' => $params['supplier_id'] ?? 0, - 'project_id' => $params['project_id'] ?? 0, + 'org_id' => $params['org_id'] ?: 0, + 'dept_id' => $params['dept_id'] ?: 0, + 'procurement_contract_id' => $params['procurement_contract_id'] ?: 0, + 'supplier_id' => $params['supplier_id'] ?: 0, + 'project_id' => $params['project_id'] ?: 0, 'contract_no' => $params['contract_no'] ?? '', 'supplier_contract_no' => $params['supplier_contract_no'] ?? '', - 'contract_type' => $params['contract_type'] ?? 0, + 'contract_type' => $params['contract_type'] ?: 0, 'signing_date' => strtotime($params['signing_date']), - 'pay_type' => $params['pay_type'] ?? 0, - 'account_period' => $params['account_period'] ?? 0, - 'amount' => $params['amount'] ?? 0, - 'amount_excluding_tax' => $params['amount_excluding_tax'] ?? 0, + 'pay_type' => $params['pay_type'] ?: 0, + 'account_period' => $params['account_period'] ?: 0, + 'amount' => $params['amount'] ?: 0, + 'amount_excluding_tax' => $params['amount_excluding_tax'] ?: 0, 'amount_daxie' => $params['amount_daxie'] ?? '', - 'retention_money_rate' => $params['retention_money_rate'] ?? 0, - 'retention_money' => $params['retention_money'] ?? 0, + 'retention_money_rate' => $params['retention_money_rate'] ?: 0, + 'retention_money' => $params['retention_money'] ?: 0, 'pay_plan' => empty($params['pay_plan']) ? [] : json_encode($params['pay_plan']), - 'remark' => $params['remark'] ?? 0, - 'annex' => $params['annex'] ?? 0, + 'remark' => $params['remark'] ?: 0, + 'annex' => $params['annex'] ?: 0, ]); ProcurementContractDetail::where('procurement_contract_id', $params['procurement_contract_id'])->update(['delete_time' =>time()]); foreach ($params['material'] ?? [] as $item) { ProcurementContractDetail::create([ 'procurement_contract_id' => $params['procurement_contract_id'], - 'material_procurement_application_id' => $item['material_procurement_application_id'] ?? 0, - 'num' => $item['num'] ?? 0, - 'unit_price_including_tax' => $item['unit_price_including_tax'] ?? 0, - 'tax_rate' => $item['tax_rate'] ?? 0, - 'amount_excluding_tax' => $item['amount_excluding_tax'] ?? 0, - 'amount_including_tax' => $item['amount_including_tax'] ?? 0, + 'material_procurement_application_id' => $item['material_procurement_application_id'] ?: 0, + 'num' => $item['num'] ?: 0, + 'unit_price_including_tax' => $item['unit_price_including_tax'] ?: 0, + 'tax_rate' => $item['tax_rate'] ?: 0, + 'amount_excluding_tax' => $item['amount_excluding_tax'] ?: 0, + 'amount_including_tax' => $item['amount_including_tax'] ?: 0, ]); } Db::commit(); @@ -98,37 +98,37 @@ class ProcurementContractChangeLogic extends BaseLogic Db::startTrans(); try { ProcurementContractChange::where('id', $params['id'])->update([ - 'org_id' => $params['org_id'] ?? 0, - 'dept_id' => $params['dept_id'] ?? 0, - 'procurement_contract_id' => $params['procurement_contract_id'] ?? 0, - 'supplier_id' => $params['supplier_id'] ?? 0, - 'approve_id' => $params['approve_id'] ?? 0, + 'org_id' => $params['org_id'] ?: 0, + 'dept_id' => $params['dept_id'] ?: 0, + 'procurement_contract_id' => $params['procurement_contract_id'] ?: 0, + 'supplier_id' => $params['supplier_id'] ?: 0, + 'approve_id' => $params['approve_id'] ?: 0, 'contract_no' => $params['contract_no'] ?? '', 'supplier_contract_no' => $params['supplier_contract_no'] ?? '', - 'contract_type' => $params['contract_type'] ?? 0, + 'contract_type' => $params['contract_type'] ?: 0, 'signing_date' => strtotime($params['signing_date']), - 'pay_type' => $params['pay_type'] ?? 0, - 'account_period' => $params['account_period'] ?? 0, - 'amount' => $params['amount'] ?? 0, - 'amount_excluding_tax' => $params['amount_excluding_tax'] ?? 0, + 'pay_type' => $params['pay_type'] ?: 0, + 'account_period' => $params['account_period'] ?: 0, + 'amount' => $params['amount'] ?: 0, + 'amount_excluding_tax' => $params['amount_excluding_tax'] ?: 0, 'amount_daxie' => $params['amount_daxie'] ?? '', - 'retention_money_rate' => $params['retention_money_rate'] ?? 0, - 'retention_money' => $params['retention_money'] ?? 0, + 'retention_money_rate' => $params['retention_money_rate'] ?: 0, + 'retention_money' => $params['retention_money'] ?: 0, 'pay_plan' => empty($params['pay_plan']) ? [] : json_encode($params['pay_plan']), - 'remark' => $params['remark'] ?? 0, - 'annex' => $params['annex'] ?? 0, + 'remark' => $params['remark'] ?: 0, + 'annex' => $params['annex'] ?: 0, ]); ProcurementContractDetail::where('procurement_contract_id', $params['procurement_contract_id'])->update(['delete_time' =>time()]); foreach ($params['material'] ?? [] as $item) { ProcurementContractDetail::create([ 'procurement_contract_id' =>$params['procurement_contract_id'], - 'material_procurement_application_id' => $item['material_procurement_application_id'] ?? 0, - 'num' => $item['num'] ?? 0, - 'unit_price_including_tax' => $item['unit_price_including_tax'] ?? 0, - 'tax_rate' => $item['tax_rate'] ?? 0, - 'amount_excluding_tax' => $item['amount_excluding_tax'] ?? 0, - 'amount_including_tax' => $item['amount_including_tax'] ?? 0, + 'material_procurement_application_id' => $item['material_procurement_application_id'] ?: 0, + 'num' => $item['num'] ?: 0, + 'unit_price_including_tax' => $item['unit_price_including_tax'] ?: 0, + 'tax_rate' => $item['tax_rate'] ?: 0, + 'amount_excluding_tax' => $item['amount_excluding_tax'] ?: 0, + 'amount_including_tax' => $item['amount_including_tax'] ?: 0, ]); } Db::commit(); diff --git a/app/adminapi/logic/contract/SubcontractingContractNegotiationLogic.php b/app/adminapi/logic/contract/SubcontractingContractNegotiationLogic.php index c002f14a3..cad61b989 100644 --- a/app/adminapi/logic/contract/SubcontractingContractNegotiationLogic.php +++ b/app/adminapi/logic/contract/SubcontractingContractNegotiationLogic.php @@ -51,7 +51,7 @@ class SubcontractingContractNegotiationLogic extends BaseLogic 'negotiation_no' => data_unique_code('QS-FBHT'), 'negotiation_amount' => $params['negotiation_amount'], 'negotiation_type' => $params['negotiation_type'], - 'warranty_amount' => $params['warranty_amount'] ?? 0, + 'warranty_amount' => $params['warranty_amount'] ?: 0, 'warranty_expire_date' => !empty($params['Warranty_expire_date']) ? strtotime($params['Warranty_expire_date']) : 0, 'negotiation_content' => $params['negotiation_content'] ?? '', 'negotiation_detail' => $params['negotiation_detail'] ?? '', @@ -87,7 +87,7 @@ class SubcontractingContractNegotiationLogic extends BaseLogic 'negotiation_name' => $params['negotiation_name'], 'negotiation_amount' => $params['negotiation_amount'], 'negotiation_type' => $params['negotiation_type'], - 'warranty_amount' => $params['warranty_amount'] ?? 0, + 'warranty_amount' => $params['warranty_amount'] ?: 0, 'warranty_expire_date' => !empty($params['Warranty_expire_date']) ? strtotime($params['Warranty_expire_date']) : 0, 'negotiation_content' => $params['negotiation_content'] ?? '', 'negotiation_detail' => $params['negotiation_detail'] ?? '', diff --git a/app/adminapi/logic/cost/CostBudgetAdjustLogic.php b/app/adminapi/logic/cost/CostBudgetAdjustLogic.php index 391f2a860..031260681 100644 --- a/app/adminapi/logic/cost/CostBudgetAdjustLogic.php +++ b/app/adminapi/logic/cost/CostBudgetAdjustLogic.php @@ -52,20 +52,20 @@ class CostBudgetAdjustLogic extends BaseLogic { CostBudgetAdjustDetail::create([ 'cost_budget_adjust_id' => $costBudgetAdjust->id, - 'cost_subject_id' => $item['cost_subject_id'] ?? 0, - 'dept_id' => $item['dept_id'] ?? 0, - 'month1' => $item['month1'] ?? 0, - 'month2' => $item['month2'] ?? 0, - 'month3' => $item['month3'] ?? 0, - 'month4' => $item['month4'] ?? 0, - 'month5' => $item['month5'] ?? 0, - 'month6' => $item['month6'] ?? 0, - 'month7' => $item['month7'] ?? 0, - 'month8' => $item['month8'] ?? 0, - 'month9' => $item['month9'] ?? 0, - 'month10' => $item['month10'] ?? 0, - 'month11' => $item['month11'] ?? 0, - 'month12' => $item['month12'] ?? 0 + 'cost_subject_id' => $item['cost_subject_id'] ?: 0, + 'dept_id' => $item['dept_id'] ?: 0, + 'month1' => $item['month1'] ?: 0, + 'month2' => $item['month2'] ?: 0, + 'month3' => $item['month3'] ?: 0, + 'month4' => $item['month4'] ?: 0, + 'month5' => $item['month5'] ?: 0, + 'month6' => $item['month6'] ?: 0, + 'month7' => $item['month7'] ?: 0, + 'month8' => $item['month8'] ?: 0, + 'month9' => $item['month9'] ?: 0, + 'month10' => $item['month10'] ?: 0, + 'month11' => $item['month11'] ?: 0, + 'month12' => $item['month12'] ?: 0 ]); } @@ -102,20 +102,20 @@ class CostBudgetAdjustLogic extends BaseLogic foreach ($params['detail'] ?? [] as $item) { CostBudgetAdjustDetail::where('cost_budget_adjust_id', $params['id'])->update([ - 'cost_subject_id' => $item['cost_subject_id'] ?? 0, - 'dept_id' => $item['dept_id'] ?? 0, - 'month1' => $item['month1'] ?? 0, - 'month2' => $item['month2'] ?? 0, - 'month3' => $item['month3'] ?? 0, - 'month4' => $item['month4'] ?? 0, - 'month5' => $item['month5'] ?? 0, - 'month6' => $item['month6'] ?? 0, - 'month7' => $item['month7'] ?? 0, - 'month8' => $item['month8'] ?? 0, - 'month9' => $item['month9'] ?? 0, - 'month10' => $item['month10'] ?? 0, - 'month11' => $item['month11'] ?? 0, - 'month12' => $item['month12'] ?? 0 + 'cost_subject_id' => $item['cost_subject_id'] ?: 0, + 'dept_id' => $item['dept_id'] ?: 0, + 'month1' => $item['month1'] ?: 0, + 'month2' => $item['month2'] ?: 0, + 'month3' => $item['month3'] ?: 0, + 'month4' => $item['month4'] ?: 0, + 'month5' => $item['month5'] ?: 0, + 'month6' => $item['month6'] ?: 0, + 'month7' => $item['month7'] ?: 0, + 'month8' => $item['month8'] ?: 0, + 'month9' => $item['month9'] ?: 0, + 'month10' => $item['month10'] ?: 0, + 'month11' => $item['month11'] ?: 0, + 'month12' => $item['month12'] ?: 0 ]); } Db::commit(); diff --git a/app/adminapi/logic/cost/CostBudgetLogic.php b/app/adminapi/logic/cost/CostBudgetLogic.php index 80d74808d..e0bd441b7 100644 --- a/app/adminapi/logic/cost/CostBudgetLogic.php +++ b/app/adminapi/logic/cost/CostBudgetLogic.php @@ -42,10 +42,10 @@ class CostBudgetLogic extends BaseLogic Db::startTrans(); try { $costBudget = CostBudget::create([ - 'approve_id' => $params['approve_id'] ?? 0, + 'approve_id' => $params['approve_id'] ?: 0, 'years' => $params['years'] ?? '', 'document_preparation_time' => $params['document_preparation_time'] ?? '', - 'total' => $params['total'] ?? 0, + 'total' => $params['total'] ?: 0, 'remark' => $params['remark'] ?? '', 'annex' => $params['annex'] ?? '', ]); @@ -53,20 +53,20 @@ class CostBudgetLogic extends BaseLogic { CostBudgetDetail::create([ 'cost_budget_id' => $costBudget->id, - 'cost_subject_id' => $item['cost_subject_id'] ?? 0, - 'dept_id' => $item['dept_id'] ?? 0, - 'month1' => $item['month1'] ?? 0, - 'month2' => $item['month2'] ?? 0, - 'month3' => $item['month3'] ?? 0, - 'month4' => $item['month4'] ?? 0, - 'month5' => $item['month5'] ?? 0, - 'month6' => $item['month6'] ?? 0, - 'month7' => $item['month7'] ?? 0, - 'month8' => $item['month8'] ?? 0, - 'month9' => $item['month9'] ?? 0, - 'month10' => $item['month10'] ?? 0, - 'month11' => $item['month11'] ?? 0, - 'month12' => $item['month12'] ?? 0 + 'cost_subject_id' => $item['cost_subject_id'] ?: 0, + 'dept_id' => $item['dept_id'] ?: 0, + 'month1' => $item['month1'] ?: 0, + 'month2' => $item['month2'] ?: 0, + 'month3' => $item['month3'] ?: 0, + 'month4' => $item['month4'] ?: 0, + 'month5' => $item['month5'] ?: 0, + 'month6' => $item['month6'] ?: 0, + 'month7' => $item['month7'] ?: 0, + 'month8' => $item['month8'] ?: 0, + 'month9' => $item['month9'] ?: 0, + 'month10' => $item['month10'] ?: 0, + 'month11' => $item['month11'] ?: 0, + 'month12' => $item['month12'] ?: 0 ]); } @@ -92,10 +92,10 @@ class CostBudgetLogic extends BaseLogic Db::startTrans(); try { CostBudget::where('id', $params['id'])->update([ - 'approve_id' => $params['approve_id'] ?? 0, + 'approve_id' => $params['approve_id'] ?: 0, 'years' => $params['years'] ?? '', 'document_preparation_time' => $params['document_preparation_time'] ?? '', - 'total' => $params['total'] ?? 0, + 'total' => $params['total'] ?: 0, 'remark' => $params['remark'] ?? '', 'annex' => $params['annex'] ?? '', ]); @@ -103,20 +103,20 @@ class CostBudgetLogic extends BaseLogic foreach ($params['detail'] ?? [] as $item) { CostBudgetDetail::where('cost_budget_id', $params['id'])->update([ - 'cost_subject_id' => $item['cost_subject_id'] ?? 0, - 'dept_id' => $item['dept_id'] ?? 0, - 'month1' => $item['month1'] ?? 0, - 'month2' => $item['month2'] ?? 0, - 'month3' => $item['month3'] ?? 0, - 'month4' => $item['month4'] ?? 0, - 'month5' => $item['month5'] ?? 0, - 'month6' => $item['month6'] ?? 0, - 'month7' => $item['month7'] ?? 0, - 'month8' => $item['month8'] ?? 0, - 'month9' => $item['month9'] ?? 0, - 'month10' => $item['month10'] ?? 0, - 'month11' => $item['month11'] ?? 0, - 'month12' => $item['month12'] ?? 0 + 'cost_subject_id' => $item['cost_subject_id'] ?: 0, + 'dept_id' => $item['dept_id'] ?: 0, + 'month1' => $item['month1'] ?: 0, + 'month2' => $item['month2'] ?: 0, + 'month3' => $item['month3'] ?: 0, + 'month4' => $item['month4'] ?: 0, + 'month5' => $item['month5'] ?: 0, + 'month6' => $item['month6'] ?: 0, + 'month7' => $item['month7'] ?: 0, + 'month8' => $item['month8'] ?: 0, + 'month9' => $item['month9'] ?: 0, + 'month10' => $item['month10'] ?: 0, + 'month11' => $item['month11'] ?: 0, + 'month12' => $item['month12'] ?: 0 ]); } diff --git a/app/adminapi/logic/custom/CustomLogic.php b/app/adminapi/logic/custom/CustomLogic.php index bce4940aa..a0b28f890 100644 --- a/app/adminapi/logic/custom/CustomLogic.php +++ b/app/adminapi/logic/custom/CustomLogic.php @@ -53,9 +53,9 @@ class CustomLogic extends BaseLogic 'custom_type' => $params['custom_type'], 'phone' => $params['phone'], 'credit_rating' => $params['credit_rating'], - 'province' => $params['province'] ?? 0, - 'city' => $params['city'] ?? 0, - 'area' => $params['area'] ?? 0, + 'province' => $params['province'] ?: 0, + 'city' => $params['city'] ?: 0, + 'area' => $params['area'] ?: 0, 'address' => $params['address'] ?? '', 'notes' => $params['notes'] ?? '', 'master_name' => $params['master_name'], @@ -114,9 +114,9 @@ class CustomLogic extends BaseLogic 'custom_type' => $params['custom_type'], 'phone' => $params['phone'], 'credit_rating' => $params['credit_rating'], - 'province' => $params['province'] ?? 0, - 'city' => $params['city'] ?? 0, - 'area' => $params['area'] ?? 0, + 'province' => $params['province'] ?: 0, + 'city' => $params['city'] ?: 0, + 'area' => $params['area'] ?: 0, 'address' => $params['address'] ?? '', 'notes' => $params['notes'] ?? '', 'master_name' => $params['master_name'] ?? '', diff --git a/app/adminapi/logic/dept/DeptLogic.php b/app/adminapi/logic/dept/DeptLogic.php index d4debaeae..5577cb9d1 100755 --- a/app/adminapi/logic/dept/DeptLogic.php +++ b/app/adminapi/logic/dept/DeptLogic.php @@ -44,7 +44,7 @@ class DeptLogic extends BaseLogic 'leader' => $params['leader'], 'mobile' => $params['mobile'], 'status' => $params['status'], - 'sort' => $params['sort'] ?? 0 + 'sort' => $params['sort'] ?: 0 ]); } @@ -66,7 +66,7 @@ class DeptLogic extends BaseLogic 'leader' => $params['leader'], 'mobile' => $params['mobile'], 'status' => $params['status'], - 'sort' => $params['sort'] ?? 0 + 'sort' => $params['sort'] ?: 0 ]); return true; } catch (\Exception $e) { diff --git a/app/adminapi/logic/dept/JobsLogic.php b/app/adminapi/logic/dept/JobsLogic.php index 001efe937..a345d2b03 100755 --- a/app/adminapi/logic/dept/JobsLogic.php +++ b/app/adminapi/logic/dept/JobsLogic.php @@ -43,7 +43,7 @@ class JobsLogic extends BaseLogic Jobs::create([ 'dept_id' => $params['dept_id'], 'name' => $params['name'], - 'sort' => $params['sort'] ?? 0, + 'sort' => $params['sort'] ?: 0, 'status' => $params['status'], ]); } @@ -63,7 +63,7 @@ class JobsLogic extends BaseLogic 'id' => $params['id'], 'dept_id' => $params['dept_id'], 'name' => $params['name'], - 'sort' => $params['sort'] ?? 0, + 'sort' => $params['sort'] ?: 0, 'status' => $params['status'], ]); return true; diff --git a/app/adminapi/logic/expense/ExpenseReimbursementLogic.php b/app/adminapi/logic/expense/ExpenseReimbursementLogic.php index cba916f70..1c8aa053f 100644 --- a/app/adminapi/logic/expense/ExpenseReimbursementLogic.php +++ b/app/adminapi/logic/expense/ExpenseReimbursementLogic.php @@ -43,14 +43,14 @@ class ExpenseReimbursementLogic extends BaseLogic Db::startTrans(); try { $expenseReimbursement = ExpenseReimbursement::create([ - 'org_id' => $params['org_id'] ?? 0, - 'dept_id' => $params['dept_id'] ?? 0, - 'approve_id' => $params['approve_id'] ?? 0, + 'org_id' => $params['org_id'] ?: 0, + 'dept_id' => $params['dept_id'] ?: 0, + 'approve_id' => $params['approve_id'] ?: 0, 'reimburser' => $params['reimburser'] ?? '', 'reimbursement_date' => $params['reimbursement_date'] ?? '', - 'customer_id' => $params['customer_id'] ?? 0, - 'pay_type' => $params['pay_type'] ?? 0, - 'reimbursement_amount' => $params['reimbursement_amount'] ?? 0, + 'customer_id' => $params['customer_id'] ?: 0, + 'pay_type' => $params['pay_type'] ?: 0, + 'reimbursement_amount' => $params['reimbursement_amount'] ?: 0, 'reimbursement_amount_daxie' => $params['reimbursement_amount_daxie'] ?? '', 'payee_name' => $params['payee_name'] ?? '', 'payee_bank' => $params['payee_bank'] ?? '', @@ -63,9 +63,9 @@ class ExpenseReimbursementLogic extends BaseLogic { ExpenseReimbursementDetail::create([ 'expense_id' => $expenseReimbursement->id, - 'cost_subject_id' => $item['cost_subject_id'] ?? 0, + 'cost_subject_id' => $item['cost_subject_id'] ?: 0, 'use_to' => $item['use_to'] ?? '', - 'amount' => $item['amount'] ?? 0, + 'amount' => $item['amount'] ?: 0, 'remark' => $item['remark'] ?? '' ]); } @@ -74,12 +74,12 @@ class ExpenseReimbursementLogic extends BaseLogic { ExpenseReimbursementInvoiceDetail::create([ 'expense_id' => $expenseReimbursement->id, - 'invoice_type' => $item['invoice_type'] ?? 0, + 'invoice_type' => $item['invoice_type'] ?: 0, 'invoice_sn' => $item['invoice_sn'] ?? '', - 'tax_rate' => $item['tax_rate'] ?? 0, - 'invoice_form' => $item['invoice_form'] ?? 0, - 'amount' => $item['amount'] ?? 0, - 'tax' => $item['tax'] ?? 0, + 'tax_rate' => $item['tax_rate'] ?: 0, + 'invoice_form' => $item['invoice_form'] ?: 0, + 'amount' => $item['amount'] ?: 0, + 'tax' => $item['tax'] ?: 0, 'annex' => $item['annex'] ?? '', 'remark' => $item['remark'] ?? '' ]); @@ -107,14 +107,14 @@ class ExpenseReimbursementLogic extends BaseLogic Db::startTrans(); try { ExpenseReimbursement::where('id', $params['id'])->update([ - 'org_id' => $params['org_id'] ?? 0, - 'dept_id' => $params['dept_id'] ?? 0, - 'approve_id' => $params['approve_id'] ?? 0, + 'org_id' => $params['org_id'] ?: 0, + 'dept_id' => $params['dept_id'] ?: 0, + 'approve_id' => $params['approve_id'] ?: 0, 'reimburser' => $params['reimburser'] ?? '', 'reimbursement_date' => $params['reimbursement_date'] ?? '', - 'customer_id' => $params['customer_id'] ?? 0, - 'pay_type' => $params['pay_type'] ?? 0, - 'reimbursement_amount' => $params['reimbursement_amount'] ?? 0, + 'customer_id' => $params['customer_id'] ?: 0, + 'pay_type' => $params['pay_type'] ?: 0, + 'reimbursement_amount' => $params['reimbursement_amount'] ?: 0, 'reimbursement_amount_daxie' => $params['reimbursement_amount_daxie'] ?? '', 'payee_name' => $params['payee_name'] ?? '', 'payee_bank' => $params['payee_bank'] ?? '', @@ -128,9 +128,9 @@ class ExpenseReimbursementLogic extends BaseLogic { ExpenseReimbursementDetail::where('expense_id', $params['id'])->update([ 'expense_id' => $expenseReimbursement->id, - 'cost_subject_id' => $item['cost_subject_id'] ?? 0, + 'cost_subject_id' => $item['cost_subject_id'] ?: 0, 'use_to' => $item['use_to'] ?? '', - 'amount' => $item['amount'] ?? 0, + 'amount' => $item['amount'] ?: 0, 'remark' => $item['remark'] ?? '' ]); } @@ -139,12 +139,12 @@ class ExpenseReimbursementLogic extends BaseLogic { ExpenseReimbursementInvoiceDetail::where('expense_id', $params['id'])->update([ 'expense_id' => $expenseReimbursement->id, - 'invoice_type' => $item['invoice_type'] ?? 0, + 'invoice_type' => $item['invoice_type'] ?: 0, 'invoice_sn' => $item['invoice_sn'] ?? '', - 'tax_rate' => $item['tax_rate'] ?? 0, - 'invoice_form' => $item['invoice_form'] ?? 0, - 'amount' => $item['amount'] ?? 0, - 'tax' => $item['tax'] ?? 0, + 'tax_rate' => $item['tax_rate'] ?: 0, + 'invoice_form' => $item['invoice_form'] ?: 0, + 'amount' => $item['amount'] ?: 0, + 'tax' => $item['tax'] ?: 0, 'annex' => $item['annex'] ?? '', 'remark' => $item['remark'] ?? '' ]); diff --git a/app/adminapi/logic/material/MaterialLogic.php b/app/adminapi/logic/material/MaterialLogic.php index a3652f33e..9c3e58da4 100644 --- a/app/adminapi/logic/material/MaterialLogic.php +++ b/app/adminapi/logic/material/MaterialLogic.php @@ -44,17 +44,17 @@ class MaterialLogic extends BaseLogic try { Material::create([ 'first_level' => $params['first_level'], - 'second_level' => $params['second_level'] ?? 0, - 'three_level' => $params['three_level'] ?? 0, + 'second_level' => $params['second_level'] ?: 0, + 'three_level' => $params['three_level'] ?: 0, 'code' => $params['code'], 'brand' => $params['brand'] ?? '', 'name' => $params['name'], 'specs' => $params['specs'], 'unit' => $params['unit'], 'parameter_description' => $params['parameter_description'] ?? '', - 'inventory' => $params['inventory'] ?? 0, - 'sales_price' => $params['sales_price'] ?? 0, - 'cost_price' => $params['cost_price'] ?? 0, + 'inventory' => $params['inventory'] ?: 0, + 'sales_price' => $params['sales_price'] ?: 0, + 'cost_price' => $params['cost_price'] ?: 0, 'annex' => $params['annex']? json_encode($params['annex']) : null, 'add_user' => $admin_id, 'update_user' => $admin_id, @@ -82,17 +82,17 @@ class MaterialLogic extends BaseLogic try { Material::where('id', $params['id'])->update([ 'first_level' => $params['first_level'], - 'second_level' => $params['second_level'] ?? 0, - 'three_level' => $params['three_level'] ?? 0, + 'second_level' => $params['second_level'] ?: 0, + 'three_level' => $params['three_level'] ?: 0, 'code' => $params['code'], 'brand' => $params['brand'] ?? '', 'name' => $params['name'], 'specs' => $params['specs'], 'unit' => $params['unit'], 'parameter_description' => $params['parameter_description'] ?? '', - 'inventory' => $params['inventory'] ?? 0, - 'sales_price' => $params['sales_price'] ?? 0, - 'cost_price' => $params['cost_price'] ?? 0, + 'inventory' => $params['inventory'] ?: 0, + 'sales_price' => $params['sales_price'] ?: 0, + 'cost_price' => $params['cost_price'] ?: 0, 'annex' => $params['annex']? json_encode($params['annex']) : null, 'update_user' => $admin_id, 'update_time' => time() diff --git a/app/adminapi/logic/notice/NoticeLogic.php b/app/adminapi/logic/notice/NoticeLogic.php index 552999e0b..099a036d7 100755 --- a/app/adminapi/logic/notice/NoticeLogic.php +++ b/app/adminapi/logic/notice/NoticeLogic.php @@ -124,7 +124,7 @@ class NoticeLogic extends BaseLogic */ public static function checkSet($params) { - $noticeSetting = NoticeSetting::findOrEmpty($params['id'] ?? 0); + $noticeSetting = NoticeSetting::findOrEmpty($params['id'] ?: 0); if ($noticeSetting->isEmpty()) { throw new \Exception('通知配置不存在'); diff --git a/app/adminapi/logic/notice/SmsConfigLogic.php b/app/adminapi/logic/notice/SmsConfigLogic.php index cfcfada74..189c22b25 100755 --- a/app/adminapi/logic/notice/SmsConfigLogic.php +++ b/app/adminapi/logic/notice/SmsConfigLogic.php @@ -104,7 +104,7 @@ class SmsConfigLogic extends BaseLogic break; } $result = ConfigService::get('sms', $params['type'], $default); - $result['status'] = intval($result['status'] ?? 0); + $result['status'] = intval($result['status'] ?: 0); return $result; } diff --git a/app/adminapi/logic/project/ProjectEstimateLogic.php b/app/adminapi/logic/project/ProjectEstimateLogic.php index 13a65e0a9..9f752d875 100644 --- a/app/adminapi/logic/project/ProjectEstimateLogic.php +++ b/app/adminapi/logic/project/ProjectEstimateLogic.php @@ -56,9 +56,9 @@ class ProjectEstimateLogic extends BaseLogic 'contact_id' => $params['contact_id'], 'create_user' => $params['create_user'] ?? '', 'quotation_date' => strtotime($params['quotation_date']), - 'invoice_type' => $params['invoice_type'] ?? 0, - 'technician' => $params['technician'] ?? 0, - 'estimate_amount' => $params['estimate_amount'] ?? 0, + 'invoice_type' => $params['invoice_type'] ?: 0, + 'technician' => $params['technician'] ?: 0, + 'estimate_amount' => $params['estimate_amount'] ?: 0, 'ask' => $params['ask'] ?? '', 'annex' => $params['annex']? json_encode($params['annex']) : null, 'add_user' => $admin_id, @@ -94,9 +94,9 @@ class ProjectEstimateLogic extends BaseLogic 'contact_id' => $params['contact_id'], 'create_user' => $params['create_user'] ?? '', 'quotation_date' => strtotime($params['quotation_date']), - 'invoice_type' => $params['invoice_type'] ?? 0, - 'technician' => $params['technician'] ?? 0, - 'estimate_amount' => $params['estimate_amount'] ?? 0, + 'invoice_type' => $params['invoice_type'] ?: 0, + 'technician' => $params['technician'] ?: 0, + 'estimate_amount' => $params['estimate_amount'] ?: 0, 'ask' => $params['ask'] ?? '', 'annex' => $params['annex']? json_encode($params['annex']) : null, 'update_user' => $admin_id, diff --git a/app/adminapi/logic/project/ProjectExpenseReimbursementLogic.php b/app/adminapi/logic/project/ProjectExpenseReimbursementLogic.php index 52694d582..e8f81c8f8 100644 --- a/app/adminapi/logic/project/ProjectExpenseReimbursementLogic.php +++ b/app/adminapi/logic/project/ProjectExpenseReimbursementLogic.php @@ -54,8 +54,8 @@ class ProjectExpenseReimbursementLogic extends BaseLogic 'apply_user' => $params['apply_user'], 'apply_date' => strtotime($params['apply_date']), 'reimbursement_type' => $params['reimbursement_type'], - 'loan_apply_id' => $params['loan_apply_id'] ?? 0, - 'offset_loan_amount' => $params['offset_loan_amount'] ?? 0, + 'loan_apply_id' => $params['loan_apply_id'] ?: 0, + 'offset_loan_amount' => $params['offset_loan_amount'] ?: 0, 'payee_name' => $params['payee_name'], 'payee_bank' => $params['payee_bank'], 'payee_account' => $params['payee_account'], @@ -112,8 +112,8 @@ class ProjectExpenseReimbursementLogic extends BaseLogic 'apply_user' => $params['apply_user'], 'apply_date' => strtotime($params['apply_date']), 'reimbursement_type' => $params['reimbursement_type'], - 'loan_apply_id' => $params['loan_apply_id'] ?? 0, - 'offset_loan_amount' => $params['offset_loan_amount'] ?? 0, + 'loan_apply_id' => $params['loan_apply_id'] ?: 0, + 'offset_loan_amount' => $params['offset_loan_amount'] ?: 0, 'payee_name' => $params['payee_name'], 'payee_bank' => $params['payee_bank'], 'payee_account' => $params['payee_account'], diff --git a/app/adminapi/logic/project/ProjectLogic.php b/app/adminapi/logic/project/ProjectLogic.php index 95c87d3d6..447036858 100644 --- a/app/adminapi/logic/project/ProjectLogic.php +++ b/app/adminapi/logic/project/ProjectLogic.php @@ -51,29 +51,29 @@ class ProjectLogic extends BaseLogic 'name' => $params['name'], 'project_type' => $params['project_type'], 'project_code' => data_unique_code('P'), - 'project_content' => $params['project_content'] ?? 0, - 'project_estimation' => $params['project_estimation'] ?? 0, + 'project_content' => $params['project_content'] ?: 0, + 'project_estimation' => $params['project_estimation'] ?: 0, 'project_address' => $params['project_address'] ?? '', 'estimated_construction' => $params['estimated_construction'] ?? '', 'bidding_time' => !empty($params['bidding_time']) ? strtotime($params['bidding_time']) : 0, - 'bidding_method' => $params['bidding_method'] ?? 0, + 'bidding_method' => $params['bidding_method'] ?: 0, 'contacts' => $params['contacts'] ?? '', 'position' => $params['position'] ?? '', 'telephone' => $params['telephone'] ?? '', 'department' => $params['department'] ?? '', 'person' => $params['person'] ?? '', - 'relationship' => $params['relationship'] ?? 0, + 'relationship' => $params['relationship'] ?: 0, 'discovery_time' => strtotime($params['discovery_time']), 'information_sources' => $params['information_sources'], 'competitor' => $params['competitor'] ?? '', - 'construction_funds_sources' => $params['construction_funds_sources'] ?? 0, + 'construction_funds_sources' => $params['construction_funds_sources'] ?: 0, 'construction_payment_method' => $params['construction_payment_method'] ?? '', - 'construction_financial_status' => $params['construction_financial_status'] ?? 0, - 'construction_recognition' => $params['construction_recognition'] ?? 0, - 'my_construction_recognition' => $params['my_construction_recognition'] ?? 0, - 'strategic_significance' => $params['strategic_significance'] ?? 0, - 'industry' => $params['industry'] ?? 0, - 'unit_nature' => $params['unit_nature'] ?? 0, + 'construction_financial_status' => $params['construction_financial_status'] ?: 0, + 'construction_recognition' => $params['construction_recognition'] ?: 0, + 'my_construction_recognition' => $params['my_construction_recognition'] ?: 0, + 'strategic_significance' => $params['strategic_significance'] ?: 0, + 'industry' => $params['industry'] ?: 0, + 'unit_nature' => $params['unit_nature'] ?: 0, 'annex' => $params['annex']? json_encode($params['annex']) : null, 'status' => 0, 'is_budget' => 0, @@ -107,29 +107,29 @@ class ProjectLogic extends BaseLogic 'name' => $params['name'], 'project_type' => $params['project_type'], 'project_code' => data_unique_code('P'), - 'project_content' => $params['project_content'] ?? 0, - 'project_estimation' => $params['project_estimation'] ?? 0, + 'project_content' => $params['project_content'] ?: 0, + 'project_estimation' => $params['project_estimation'] ?: 0, 'project_address' => $params['project_address'] ?? '', 'estimated_construction' => $params['estimated_construction'] ?? '', 'bidding_time' => !empty($params['bidding_time']) ? strtotime($params['bidding_time']) : 0, - 'bidding_method' => $params['bidding_method'] ?? 0, + 'bidding_method' => $params['bidding_method'] ?: 0, 'contacts' => $params['contacts'] ?? '', 'position' => $params['position'] ?? '', 'telephone' => $params['telephone'] ?? '', 'department' => $params['department'] ?? '', 'person' => $params['person'] ?? '', - 'relationship' => $params['relationship'] ?? 0, + 'relationship' => $params['relationship'] ?: 0, 'discovery_time' => strtotime($params['discovery_time']), 'information_sources' => $params['information_sources'], 'competitor' => $params['competitor'] ?? '', - 'construction_funds_sources' => $params['construction_funds_sources'] ?? 0, + 'construction_funds_sources' => $params['construction_funds_sources'] ?: 0, 'construction_payment_method' => $params['construction_payment_method'] ?? '', - 'construction_financial_status' => $params['construction_financial_status'] ?? 0, - 'construction_recognition' => $params['construction_recognition'] ?? 0, - 'my_construction_recognition' => $params['my_construction_recognition'] ?? 0, - 'strategic_significance' => $params['strategic_significance'] ?? 0, - 'industry' => $params['industry'] ?? 0, - 'unit_nature' => $params['unit_nature'] ?? 0, + 'construction_financial_status' => $params['construction_financial_status'] ?: 0, + 'construction_recognition' => $params['construction_recognition'] ?: 0, + 'my_construction_recognition' => $params['my_construction_recognition'] ?: 0, + 'strategic_significance' => $params['strategic_significance'] ?: 0, + 'industry' => $params['industry'] ?: 0, + 'unit_nature' => $params['unit_nature'] ?: 0, 'annex' => $params['annex']? json_encode($params['annex']) : null, 'update_time' => time(), ]); diff --git a/app/adminapi/logic/project/ProjectTotalBudgetLogic.php b/app/adminapi/logic/project/ProjectTotalBudgetLogic.php index 12695aaff..b556ed952 100644 --- a/app/adminapi/logic/project/ProjectTotalBudgetLogic.php +++ b/app/adminapi/logic/project/ProjectTotalBudgetLogic.php @@ -49,11 +49,11 @@ class ProjectTotalBudgetLogic extends BaseLogic 'project_id' => $params['project_id'], 'total_budget_code' => data_unique_code('项目总预算'), 'contract_amount' => $params['contract_amount'], - 'cl_cost' => $params['cl_cost'] ?? 0, - 'fb_cost' => $params['fb_cost'] ?? 0, - 'rg_cost' => $params['rg_cost'] ?? 0, - 'fy_cost' => $params['fy_cost'] ?? 0, - 'jj_cost' => $params['jj_cost'] ?? 0, + 'cl_cost' => $params['cl_cost'] ?: 0, + 'fb_cost' => $params['fb_cost'] ?: 0, + 'rg_cost' => $params['rg_cost'] ?: 0, + 'fy_cost' => $params['fy_cost'] ?: 0, + 'jj_cost' => $params['jj_cost'] ?: 0, 'remark' => $params['remark'] ?? '', 'budget_list' => !empty($params['budget_list']) ? $params['budget_list'] : null, 'budget_date' => strtotime($params['budget_date']), @@ -86,11 +86,11 @@ class ProjectTotalBudgetLogic extends BaseLogic try { ProjectTotalBudget::where('id', $params['id'])->update([ 'contract_amount' => $params['contract_amount'], - 'cl_cost' => $params['cl_cost'] ?? 0, - 'fb_cost' => $params['fb_cost'] ?? 0, - 'rg_cost' => $params['rg_cost'] ?? 0, - 'fy_cost' => $params['fy_cost'] ?? 0, - 'jj_cost' => $params['jj_cost'] ?? 0, + 'cl_cost' => $params['cl_cost'] ?: 0, + 'fb_cost' => $params['fb_cost'] ?: 0, + 'rg_cost' => $params['rg_cost'] ?: 0, + 'fy_cost' => $params['fy_cost'] ?: 0, + 'jj_cost' => $params['jj_cost'] ?: 0, 'remark' => $params['remark'] ?? '', 'budget_list' => !empty($params['budget_list']) ? $params['budget_list'] : null, 'budget_date' => strtotime($params['budget_date']), diff --git a/app/adminapi/logic/project/ProjectTravelReimbursementDetailLogic.php b/app/adminapi/logic/project/ProjectTravelReimbursementDetailLogic.php index 876ed8acf..edd305b7f 100644 --- a/app/adminapi/logic/project/ProjectTravelReimbursementDetailLogic.php +++ b/app/adminapi/logic/project/ProjectTravelReimbursementDetailLogic.php @@ -45,11 +45,11 @@ class ProjectTravelReimbursementDetailLogic extends BaseLogic ProjectTravelReimbursementDetail::create([ 'travel_reimbursement_id' => $params['travel_reimbursement_id'], 'project_cost_temp_id' => $params['project_cost_temp_id'], - 'traffic_fee' => $params['traffic_fee'] ?? 0, - 'stay_fee' => $params['stay_fee'] ?? 0, - 'restaurant_fee' => $params['restaurant_fee'] ?? 0, - 'subsidy_fee' => $params['subsidy_fee'] ?? 0, - 'other_fee' => $params['other_fee'] ?? 0, + 'traffic_fee' => $params['traffic_fee'] ?: 0, + 'stay_fee' => $params['stay_fee'] ?: 0, + 'restaurant_fee' => $params['restaurant_fee'] ?: 0, + 'subsidy_fee' => $params['subsidy_fee'] ?: 0, + 'other_fee' => $params['other_fee'] ?: 0, 'total_amount' => $params['traffic_fee'] + $params['stay_fee'] + $params['restaurant_fee'] + $params['subsidy_fee'] + $params['other_fee'], 'remark' => $params['remark'] ?? '', ]); @@ -77,11 +77,11 @@ class ProjectTravelReimbursementDetailLogic extends BaseLogic ProjectTravelReimbursementDetail::where('id', $params['id'])->update([ 'travel_reimbursement_id' => $params['travel_reimbursement_id'], 'project_cost_temp_id' => $params['project_cost_temp_id'], - 'traffic_fee' => $params['traffic_fee'] ?? 0, - 'stay_fee' => $params['stay_fee'] ?? 0, - 'restaurant_fee' => $params['restaurant_fee'] ?? 0, - 'subsidy_fee' => $params['subsidy_fee'] ?? 0, - 'other_fee' => $params['other_fee'] ?? 0, + 'traffic_fee' => $params['traffic_fee'] ?: 0, + 'stay_fee' => $params['stay_fee'] ?: 0, + 'restaurant_fee' => $params['restaurant_fee'] ?: 0, + 'subsidy_fee' => $params['subsidy_fee'] ?: 0, + 'other_fee' => $params['other_fee'] ?: 0, 'total_amount' => $params['traffic_fee'] + $params['stay_fee'] + $params['restaurant_fee'] + $params['subsidy_fee'] + $params['other_fee'], 'remark' => $params['remark'] ?? '', 'update_time' => time(), diff --git a/app/adminapi/logic/project/ProjectTravelReimbursementLogic.php b/app/adminapi/logic/project/ProjectTravelReimbursementLogic.php index a829a8363..6f6ad2d55 100644 --- a/app/adminapi/logic/project/ProjectTravelReimbursementLogic.php +++ b/app/adminapi/logic/project/ProjectTravelReimbursementLogic.php @@ -57,8 +57,8 @@ class ProjectTravelReimbursementLogic extends BaseLogic 'trip_apply_id' => $params['trip_apply_id'], 'project_id' => $trip_apply['project_id'], 'reimbursement_type' => $params['reimbursement_type'], - 'loan_apply_id' => $params['loan_apply_id'] ?? 0, - 'offset_loan_amount' => $params['offset_loan_amount'] ?? 0,//冲抵借款金额 + 'loan_apply_id' => $params['loan_apply_id'] ?: 0, + 'offset_loan_amount' => $params['offset_loan_amount'] ?: 0,//冲抵借款金额 'apply_user' => $params['apply_user'], 'apply_date' => strtotime($params['apply_date']), 'payee_name' => $params['payee_name'], @@ -72,11 +72,11 @@ class ProjectTravelReimbursementLogic extends BaseLogic ProjectTravelReimbursementDetail::create([ 'travel_reimbursement_id' => $res->id, 'project_cost_temp_id' => $item['project_cost_temp_id'], - 'traffic_fee' => $item['traffic_fee'] ?? 0, - 'stay_fee' => $item['stay_fee'] ?? 0, - 'restaurant_fee' => $item['restaurant_fee'] ?? 0, - 'subsidy_fee' => $item['subsidy_fee'] ?? 0, - 'other_fee' => $item['other_fee'] ?? 0, + 'traffic_fee' => $item['traffic_fee'] ?: 0, + 'stay_fee' => $item['stay_fee'] ?: 0, + 'restaurant_fee' => $item['restaurant_fee'] ?: 0, + 'subsidy_fee' => $item['subsidy_fee'] ?: 0, + 'other_fee' => $item['other_fee'] ?: 0, 'total_amount' => $item['traffic_fee'] + $item['stay_fee'] + $item['restaurant_fee'] + $item['subsidy_fee'] + $item['other_fee'], 'remark' => $item['remark'] ?? '', ]); @@ -122,8 +122,8 @@ class ProjectTravelReimbursementLogic extends BaseLogic 'trip_apply_id' => $params['trip_apply_id'], 'project_id' => $trip_apply['project_id'], 'reimbursement_type' => $params['reimbursement_type'], - 'loan_apply_id' => $params['loan_apply_id'] ?? 0, - 'offset_loan_amount' => $params['offset_loan_amount'] ?? 0,//冲抵借款金额 + 'loan_apply_id' => $params['loan_apply_id'] ?: 0, + 'offset_loan_amount' => $params['offset_loan_amount'] ?: 0,//冲抵借款金额 'apply_user' => $params['apply_user'], 'apply_date' => strtotime($params['apply_date']), 'payee_name' => $params['payee_name'], @@ -139,11 +139,11 @@ class ProjectTravelReimbursementLogic extends BaseLogic ProjectTravelReimbursementDetail::where('id',$item['id'])->update([ 'travel_reimbursement_id' => $params['id'], 'project_cost_temp_id' => $item['project_cost_temp_id'], - 'traffic_fee' => $item['traffic_fee'] ?? 0, - 'stay_fee' => $item['stay_fee'] ?? 0, - 'restaurant_fee' => $item['restaurant_fee'] ?? 0, - 'subsidy_fee' => $item['subsidy_fee'] ?? 0, - 'other_fee' => $item['other_fee'] ?? 0, + 'traffic_fee' => $item['traffic_fee'] ?: 0, + 'stay_fee' => $item['stay_fee'] ?: 0, + 'restaurant_fee' => $item['restaurant_fee'] ?: 0, + 'subsidy_fee' => $item['subsidy_fee'] ?: 0, + 'other_fee' => $item['other_fee'] ?: 0, 'total_amount' => $item['traffic_fee'] + $item['stay_fee'] + $item['restaurant_fee'] + $item['subsidy_fee'] + $item['other_fee'], 'remark' => $item['remark'] ?? '', 'update_time' => time(), @@ -152,11 +152,11 @@ class ProjectTravelReimbursementLogic extends BaseLogic ProjectTravelReimbursementDetail::create([ 'travel_reimbursement_id' => $params['id'], 'project_cost_temp_id' => $item['project_cost_temp_id'], - 'traffic_fee' => $item['traffic_fee'] ?? 0, - 'stay_fee' => $item['stay_fee'] ?? 0, - 'restaurant_fee' => $item['restaurant_fee'] ?? 0, - 'subsidy_fee' => $item['subsidy_fee'] ?? 0, - 'other_fee' => $item['other_fee'] ?? 0, + 'traffic_fee' => $item['traffic_fee'] ?: 0, + 'stay_fee' => $item['stay_fee'] ?: 0, + 'restaurant_fee' => $item['restaurant_fee'] ?: 0, + 'subsidy_fee' => $item['subsidy_fee'] ?: 0, + 'other_fee' => $item['other_fee'] ?: 0, 'total_amount' => $item['traffic_fee'] + $item['stay_fee'] + $item['restaurant_fee'] + $item['subsidy_fee'] + $item['other_fee'], 'remark' => $item['remark'] ?? '', ]); diff --git a/app/adminapi/logic/quotation/QuotationLogic.php b/app/adminapi/logic/quotation/QuotationLogic.php index 1d085cbcb..6ab0a7b57 100644 --- a/app/adminapi/logic/quotation/QuotationLogic.php +++ b/app/adminapi/logic/quotation/QuotationLogic.php @@ -58,7 +58,7 @@ class QuotationLogic extends BaseLogic 'code' => data_unique_code('报价单'), 'quotation_date' => !empty($params['quotation_date']) ? strtotime($params['quotation_date']) : 0, 'create_user' => $params['create_user'] ?? '', - 'invoice_type' => $params['invoice_type'] ?? 0, + 'invoice_type' => $params['invoice_type'] ?: 0, 'freight' => $params['freight'], 'other_fee' => $params['other_fee'], 'customer_require' => $params['customer_require'] ?? '', diff --git a/app/adminapi/logic/setting/dict/DictDataLogic.php b/app/adminapi/logic/setting/dict/DictDataLogic.php index 8ea5d934b..27e77e767 100755 --- a/app/adminapi/logic/setting/dict/DictDataLogic.php +++ b/app/adminapi/logic/setting/dict/DictDataLogic.php @@ -39,7 +39,7 @@ class DictDataLogic extends BaseLogic $data = [ 'name' => $params['name'], 'value' => $params['value'], - 'sort' => $params['sort'] ?? 0, + 'sort' => $params['sort'] ?: 0, 'status' => $params['status'], 'remark' => $params['remark'] ?? '', ]; diff --git a/app/adminapi/logic/supplier/SupplierContactsLogic.php b/app/adminapi/logic/supplier/SupplierContactsLogic.php index fe0d9a52c..04e1065f1 100644 --- a/app/adminapi/logic/supplier/SupplierContactsLogic.php +++ b/app/adminapi/logic/supplier/SupplierContactsLogic.php @@ -44,12 +44,12 @@ class SupplierContactsLogic extends BaseLogic SupplierContacts::create([ 'supplier_id' => $params['supplier_id'], 'name' => $params['name'], - 'sex' => $params['sex'] ?? 0, + 'sex' => $params['sex'] ?: 0, 'birthday' => !empty($params['birthday']) ? strtotime($params['birthday']) : 0, - 'contacts_type' => $params['contacts_type'] ?? 0, + 'contacts_type' => $params['contacts_type'] ?: 0, 'responsible' => $params['responsible'] ?? '', 'title' => $params['title'] ?? '', - 'contacts_cate' => $params['contacts_cate'] ?? 0, + 'contacts_cate' => $params['contacts_cate'] ?: 0, 'department' => $params['department'] ?? '', 'duties' => $params['duties'] ?? '', 'work_phone' => $params['work_phone'] ?? '', @@ -58,7 +58,7 @@ class SupplierContactsLogic extends BaseLogic 'fax' => $params['fax'] ?? '', 'zip_code' => $params['zip_code'] ?? '', 'family_address' => $params['family_address'] ?? '', - 'id_type' => $params['id_type'] ?? 0, + 'id_type' => $params['id_type'] ?: 0, 'idcard' => $params['idcard'] ?? '', 'remark' => $params['remark'] ?? '', 'annex' => $params['annex']? json_encode($params['annex']) : null, @@ -87,12 +87,12 @@ class SupplierContactsLogic extends BaseLogic SupplierContacts::where('id', $params['id'])->update([ 'supplier_id' => $params['supplier_id'], 'name' => $params['name'], - 'sex' => $params['sex'] ?? 0, + 'sex' => $params['sex'] ?: 0, 'birthday' => !empty($params['birthday']) ? strtotime($params['birthday']) : 0, - 'contacts_type' => $params['contacts_type'] ?? 0, + 'contacts_type' => $params['contacts_type'] ?: 0, 'responsible' => $params['responsible'] ?? '', 'title' => $params['title'] ?? '', - 'contacts_cate' => $params['contacts_cate'] ?? 0, + 'contacts_cate' => $params['contacts_cate'] ?: 0, 'department' => $params['department'] ?? '', 'duties' => $params['duties'] ?? '', 'work_phone' => $params['work_phone'] ?? '', @@ -101,7 +101,7 @@ class SupplierContactsLogic extends BaseLogic 'fax' => $params['fax'] ?? '', 'zip_code' => $params['zip_code'] ?? '', 'family_address' => $params['family_address'] ?? '', - 'id_type' => $params['id_type'] ?? 0, + 'id_type' => $params['id_type'] ?: 0, 'idcard' => $params['idcard'] ?? '', 'remark' => $params['remark'] ?? '', 'annex' => $params['annex']? json_encode($params['annex']) : null, diff --git a/app/adminapi/logic/supplier/SupplierLogic.php b/app/adminapi/logic/supplier/SupplierLogic.php index d7c730ec0..38ac8fcff 100644 --- a/app/adminapi/logic/supplier/SupplierLogic.php +++ b/app/adminapi/logic/supplier/SupplierLogic.php @@ -52,11 +52,11 @@ class SupplierLogic extends BaseLogic 'supplier_introduction' => $params['supplier_introduction'] ?? '', 'brand_category' => $params['brand_category'] ?? '', 'supplier_photos' => !empty($params['supplier_photos']) ? json_encode($params['supplier_photos']) : null, - 'supplier_group' => $params['supplier_group'] ?? 0, - 'supplier_category' => $params['supplier_category'] ?? 0, - 'supplier_grade' => $params['supplier_grade'] ?? 0, + 'supplier_group' => $params['supplier_group'] ?: 0, + 'supplier_category' => $params['supplier_category'] ?: 0, + 'supplier_grade' => $params['supplier_grade'] ?: 0, 'contacts' => $params['contacts'] ?? '', - 'contacts_sex' => $params['contacts_sex'] ?? 0, + 'contacts_sex' => $params['contacts_sex'] ?: 0, 'birthday' => !empty($params['birthday']) ? strtotime($params['birthday']) : 0, 'phone' => $params['phone'] ?? '', 'email' => $params['email'] ?? '', @@ -69,8 +69,8 @@ class SupplierLogic extends BaseLogic 'bank_accnout_name' => $params['bank_accnout_name'] ?? '', 'bank_account' => $params['bank_account'] ?? '', 'bank_address' => $params['bank_address'] ?? '', - 'init_invoice_amount' => $params['init_invoice_amount'] ?? 0, - 'credit_limit' => $params['credit_limit'] ?? 0, + 'init_invoice_amount' => $params['init_invoice_amount'] ?: 0, + 'credit_limit' => $params['credit_limit'] ?: 0, 'account_period' => $params['account_period'] ?? '', ]); Db::commit(); @@ -103,11 +103,11 @@ class SupplierLogic extends BaseLogic 'supplier_introduction' => $params['supplier_introduction'] ?? '', 'brand_category' => $params['brand_category'] ?? '', 'supplier_photos' => !empty($params['supplier_photos']) ? json_encode($params['supplier_photos']) : null, - 'supplier_group' => $params['supplier_group'] ?? 0, - 'supplier_category' => $params['supplier_category'] ?? 0, - 'supplier_grade' => $params['supplier_grade'] ?? 0, + 'supplier_group' => $params['supplier_group'] ?: 0, + 'supplier_category' => $params['supplier_category'] ?: 0, + 'supplier_grade' => $params['supplier_grade'] ?: 0, 'contacts' => $params['contacts'] ?? '', - 'contacts_sex' => $params['contacts_sex'] ?? 0, + 'contacts_sex' => $params['contacts_sex'] ?: 0, 'birthday' => !empty($params['birthday']) ? strtotime($params['birthday']) : 0, 'phone' => $params['phone'] ?? '', 'email' => $params['email'] ?? '', @@ -120,8 +120,8 @@ class SupplierLogic extends BaseLogic 'bank_accnout_name' => $params['bank_accnout_name'] ?? '', 'bank_account' => $params['bank_account'] ?? '', 'bank_address' => $params['bank_address'] ?? '', - 'init_invoice_amount' => $params['init_invoice_amount'] ?? 0, - 'credit_limit' => $params['credit_limit'] ?? 0, + 'init_invoice_amount' => $params['init_invoice_amount'] ?: 0, + 'credit_limit' => $params['credit_limit'] ?: 0, 'account_period' => $params['account_period'] ?? '', 'update_time' => time(), ]); diff --git a/app/adminapi/logic/tools/GeneratorLogic.php b/app/adminapi/logic/tools/GeneratorLogic.php index f97da9882..39ae07d41 100755 --- a/app/adminapi/logic/tools/GeneratorLogic.php +++ b/app/adminapi/logic/tools/GeneratorLogic.php @@ -118,11 +118,11 @@ class GeneratorLogic extends BaseLogic GenerateColumn::update([ 'id' => $item['id'], 'column_comment' => $item['column_comment'] ?? '', - 'is_required' => $item['is_required'] ?? 0, - 'is_insert' => $item['is_insert'] ?? 0, - 'is_update' => $item['is_update'] ?? 0, - 'is_lists' => $item['is_lists'] ?? 0, - 'is_query' => $item['is_query'] ?? 0, + 'is_required' => $item['is_required'] ?: 0, + 'is_insert' => $item['is_insert'] ?: 0, + 'is_update' => $item['is_update'] ?: 0, + 'is_lists' => $item['is_lists'] ?: 0, + 'is_query' => $item['is_query'] ?: 0, 'query_type' => $item['query_type'], 'view_type' => $item['view_type'], 'dict_type' => $item['dict_type'] ?? '', @@ -436,7 +436,7 @@ class GeneratorLogic extends BaseLogic } $options['menu'] = [ - 'pid' => intval($menuConfig['pid'] ?? 0), + 'pid' => intval($menuConfig['pid'] ?: 0), 'type' => intval($menuConfig['type'] ?? GeneratorEnum::GEN_SELF), 'name' => !empty($menuConfig['name']) ? $menuConfig['name'] : $options['table_comment'], ]; diff --git a/app/common/logic/NoticeLogic.php b/app/common/logic/NoticeLogic.php index 913aa0914..8cd445fb3 100755 --- a/app/common/logic/NoticeLogic.php +++ b/app/common/logic/NoticeLogic.php @@ -81,7 +81,7 @@ class NoticeLogic extends BaseLogic } // 跳转路径 - $jumpPath = self::getPathByScene($params['scene_id'], $params['params']['order_id'] ?? 0); + $jumpPath = self::getPathByScene($params['scene_id'], $params['params']['order_id'] ?: 0); $params['url'] = $jumpPath['url']; $params['page'] = $jumpPath['page']; @@ -142,7 +142,7 @@ class NoticeLogic extends BaseLogic public static function addNotice($params, $noticeSetting, $sendType, $content, $extra = '') { return NoticeRecord::create([ - 'user_id' => $params['params']['user_id'] ?? 0, + 'user_id' => $params['params']['user_id'] ?: 0, 'title' => self::getTitleByScene($sendType, $noticeSetting), 'content' => $content, 'scene_id' => $noticeSetting['scene_id'], diff --git a/app/common/service/generator/core/BaseGenerator.php b/app/common/service/generator/core/BaseGenerator.php index dcf17ce5f..daf79f34e 100755 --- a/app/common/service/generator/core/BaseGenerator.php +++ b/app/common/service/generator/core/BaseGenerator.php @@ -144,7 +144,7 @@ abstract class BaseGenerator public function setMenuConfig() { $this->menuConfig = [ - 'pid' => $this->tableData['menu']['pid'] ?? 0, + 'pid' => $this->tableData['menu']['pid'] ?: 0, 'type' => $this->tableData['menu']['type'] ?? GeneratorEnum::DELETE_TRUE, 'name' => $this->tableData['menu']['name'] ?? $this->tableData['table_comment'] ]; diff --git a/vendor/dragonmantank/cron-expression/src/Cron/AbstractField.php b/vendor/dragonmantank/cron-expression/src/Cron/AbstractField.php index df2848df4..fb354253e 100755 --- a/vendor/dragonmantank/cron-expression/src/Cron/AbstractField.php +++ b/vendor/dragonmantank/cron-expression/src/Cron/AbstractField.php @@ -131,7 +131,7 @@ abstract class AbstractField implements FieldInterface { $chunks = array_map('trim', explode('/', $value, 2)); $range = $chunks[0]; - $step = $chunks[1] ?? 0; + $step = $chunks[1] ?: 0; // No step or 0 steps aren't cool /** @phpstan-ignore-next-line */ @@ -211,7 +211,7 @@ abstract class AbstractField implements FieldInterface $stepSize = 1; } else { $range = array_map('trim', explode('/', $expression, 2)); - $stepSize = $range[1] ?? 0; + $stepSize = $range[1] ?: 0; $range = $range[0]; $range = explode('-', $range, 2); $offset = $range[0]; diff --git a/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php b/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php index 79664e279..a690aa921 100755 --- a/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php +++ b/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php @@ -203,7 +203,7 @@ class MockHandler implements \Countable $reason = null ): void { if (isset($options['on_stats'])) { - $transferTime = $options['transfer_time'] ?? 0; + $transferTime = $options['transfer_time'] ?: 0; $stats = new TransferStats($request, $response, $transferTime, $reason); ($options['on_stats'])($stats); } diff --git a/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php b/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php index f67d448be..e1e52a651 100755 --- a/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php +++ b/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php @@ -147,7 +147,7 @@ class RedirectMiddleware private function guardMax(RequestInterface $request, ResponseInterface $response, array &$options): void { $current = $options['__redirect_count'] - ?? 0; + ?: 0; $options['__redirect_count'] = $current + 1; $max = $options['allow_redirects']['max']; diff --git a/vendor/guzzlehttp/guzzle/src/Utils.php b/vendor/guzzlehttp/guzzle/src/Utils.php index e355f3212..9cf94952e 100755 --- a/vendor/guzzlehttp/guzzle/src/Utils.php +++ b/vendor/guzzlehttp/guzzle/src/Utils.php @@ -326,7 +326,7 @@ EOT if ($uri->getHost()) { $asciiHost = self::idnToAsci($uri->getHost(), $options, $info); if ($asciiHost === false) { - $errorBitSet = $info['errors'] ?? 0; + $errorBitSet = $info['errors'] ?: 0; $errorConstants = array_filter(array_keys(get_defined_constants()), static function (string $name): bool { return substr($name, 0, 11) === 'IDNA_ERROR_'; diff --git a/vendor/markbaker/matrix/classes/src/Decomposition/QR.php b/vendor/markbaker/matrix/classes/src/Decomposition/QR.php index 4b6106f64..e31af77c1 100755 --- a/vendor/markbaker/matrix/classes/src/Decomposition/QR.php +++ b/vendor/markbaker/matrix/classes/src/Decomposition/QR.php @@ -84,9 +84,9 @@ class QR for ($row = 0; $row < $this->columns; ++$row) { for ($column = 0; $column < $this->columns; ++$column) { if ($row < $column) { - $rGrid[$row][$column] = $this->qrMatrix[$row][$column] ?? 0.0; + $rGrid[$row][$column] = $this->qrMatrix[$row][$column] ?: 0.0; } elseif ($row === $column) { - $rGrid[$row][$column] = $this->rDiagonal[$row] ?? 0.0; + $rGrid[$row][$column] = $this->rDiagonal[$row] ?: 0.0; } else { $rGrid[$row][$column] = 0.0; } diff --git a/vendor/monolog/monolog/src/Monolog/Logger.php b/vendor/monolog/monolog/src/Monolog/Logger.php index 775d7cf1f..36e067143 100755 --- a/vendor/monolog/monolog/src/Monolog/Logger.php +++ b/vendor/monolog/monolog/src/Monolog/Logger.php @@ -345,7 +345,7 @@ class Logger implements LoggerInterface, ResettableInterface if ($this->detectCycles) { if (\PHP_VERSION_ID >= 80100 && $fiber = \Fiber::getCurrent()) { - $this->fiberLogDepth[$fiber] = $this->fiberLogDepth[$fiber] ?? 0; + $this->fiberLogDepth[$fiber] = $this->fiberLogDepth[$fiber] ?: 0; $logDepth = ++$this->fiberLogDepth[$fiber]; } else { $logDepth = ++$this->logDepth; diff --git a/vendor/overtrue/socialite/src/Providers/Base.php b/vendor/overtrue/socialite/src/Providers/Base.php index e3d6c2002..8a8a06589 100755 --- a/vendor/overtrue/socialite/src/Providers/Base.php +++ b/vendor/overtrue/socialite/src/Providers/Base.php @@ -269,7 +269,7 @@ abstract class Base implements Contracts\ProviderInterface return $response + [ Contracts\RFC6749_ABNF_ACCESS_TOKEN => $response[$this->accessTokenKey], Contracts\RFC6749_ABNF_REFRESH_TOKEN => $response[$this->refreshTokenKey] ?? null, - Contracts\RFC6749_ABNF_EXPIRES_IN => \intval($response[$this->expiresInKey] ?? 0), + Contracts\RFC6749_ABNF_EXPIRES_IN => \intval($response[$this->expiresInKey] ?: 0), ]; } diff --git a/vendor/overtrue/socialite/src/Providers/Linkedin.php b/vendor/overtrue/socialite/src/Providers/Linkedin.php index d6eea204f..2fee3ece0 100755 --- a/vendor/overtrue/socialite/src/Providers/Linkedin.php +++ b/vendor/overtrue/socialite/src/Providers/Linkedin.php @@ -81,9 +81,9 @@ class Linkedin extends Base $name = $firstName.' '.$lastName; $images = $user['profilePicture.displayImage~.elements'] ?? []; - $avatars = \array_filter($images, static fn ($image) => ($image['data']['com.linkedin.digitalmedia.mediaartifact.StillImage']['storageSize']['width'] ?? 0) === 100); + $avatars = \array_filter($images, static fn ($image) => ($image['data']['com.linkedin.digitalmedia.mediaartifact.StillImage']['storageSize']['width'] ?: 0) === 100); $avatar = \array_shift($avatars); - $originalAvatars = \array_filter($images, static fn ($image) => ($image['data']['com.linkedin.digitalmedia.mediaartifact.StillImage']['storageSize']['width'] ?? 0) === 800); + $originalAvatars = \array_filter($images, static fn ($image) => ($image['data']['com.linkedin.digitalmedia.mediaartifact.StillImage']['storageSize']['width'] ?: 0) === 800); $originalAvatar = \array_shift($originalAvatars); return new User([ diff --git a/vendor/overtrue/socialite/src/Providers/Tapd.php b/vendor/overtrue/socialite/src/Providers/Tapd.php index 6e685e9e3..81101d6c1 100755 --- a/vendor/overtrue/socialite/src/Providers/Tapd.php +++ b/vendor/overtrue/socialite/src/Providers/Tapd.php @@ -141,7 +141,7 @@ class Tapd extends Base return $response + [ Contracts\RFC6749_ABNF_ACCESS_TOKEN => $response['data'][$this->accessTokenKey], Contracts\RFC6749_ABNF_REFRESH_TOKEN => $response['data'][$this->refreshTokenKey] ?? null, - Contracts\RFC6749_ABNF_EXPIRES_IN => \intval($response['data'][$this->expiresInKey] ?? 0), + Contracts\RFC6749_ABNF_EXPIRES_IN => \intval($response['data'][$this->expiresInKey] ?: 0), ]; } } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php index 6de546fa2..e5c000074 100755 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php @@ -4215,7 +4215,7 @@ class Calculation $functionName = $matches[1]; // Get the function name $d = $stack->pop(); - $argumentCount = $d['value'] ?? 0; // See how many arguments there were (argument count is the next value stored on the stack) + $argumentCount = $d['value'] ?: 0; // See how many arguments there were (argument count is the next value stored on the stack) $output[] = $d; // Dump the argument count on the output $output[] = $stack->pop(); // Pop the function and push onto the output if (isset(self::$controlFunctions[$functionName])) { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Time.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Time.php index 4ff71983f..33a170e27 100755 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Time.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Time.php @@ -117,7 +117,7 @@ class Time */ private static function toIntWithNullBool($value): int { - $value = $value ?? 0; + $value = $value ?: 0; if (is_bool($value)) { $value = (int) $value; } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Compare.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Compare.php index 6aaf1faa5..9e5a02ade 100755 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Compare.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Compare.php @@ -72,7 +72,7 @@ class Compare try { $number = EngineeringValidations::validateFloat($number); - $step = EngineeringValidations::validateFloat($step ?? 0.0); + $step = EngineeringValidations::validateFloat($step ?: 0.0); } catch (Exception $e) { return $e->getMessage(); } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Complex.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Complex.php index 691de8b70..cbcafeb75 100755 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Complex.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Complex.php @@ -38,8 +38,8 @@ class Complex return self::evaluateArrayArguments([self::class, __FUNCTION__], $realNumber, $imaginary, $suffix); } - $realNumber = $realNumber ?? 0.0; - $imaginary = $imaginary ?? 0.0; + $realNumber = $realNumber ?: 0.0; + $imaginary = $imaginary ?: 0.0; $suffix = $suffix ?? 'i'; try { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Dollar.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Dollar.php index b1f0d25c7..ddfe032ec 100755 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Dollar.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Dollar.php @@ -59,7 +59,7 @@ class Dollar try { $fractionalDollar = FinancialValidations::validateFloat( - Functions::flattenSingleValue($fractionalDollar) ?? 0.0 + Functions::flattenSingleValue($fractionalDollar) ?: 0.0 ); $fraction = FinancialValidations::validateInt(Functions::flattenSingleValue($fraction)); } catch (Exception $e) { @@ -107,7 +107,7 @@ class Dollar try { $decimalDollar = FinancialValidations::validateFloat( - Functions::flattenSingleValue($decimalDollar) ?? 0.0 + Functions::flattenSingleValue($decimalDollar) ?: 0.0 ); $fraction = FinancialValidations::validateInt(Functions::flattenSingleValue($fraction)); } catch (Exception $e) { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical/Conditional.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical/Conditional.php index 55d5f3274..bdbf72b1b 100755 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical/Conditional.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical/Conditional.php @@ -54,7 +54,7 @@ class Conditional return $condition; } - $returnIfTrue = $returnIfTrue ?? 0; + $returnIfTrue = $returnIfTrue ?: 0; $returnIfFalse = $returnIfFalse ?? false; return ((bool) $condition) ? $returnIfTrue : $returnIfFalse; @@ -139,7 +139,7 @@ class Conditional } $errorpart = $errorpart ?? ''; - $testValue = $testValue ?? 0; // this is how Excel handles empty cell + $testValue = $testValue ?: 0; // this is how Excel handles empty cell return self::statementIf(ErrorValue::isError($testValue), $errorpart, $testValue); } @@ -166,7 +166,7 @@ class Conditional } $napart = $napart ?? ''; - $testValue = $testValue ?? 0; // this is how Excel handles empty cell + $testValue = $testValue ?: 0; // this is how Excel handles empty cell return self::statementIf(ErrorValue::isNa($testValue), $napart, $testValue); } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Matrix.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Matrix.php index 8ee759e87..767358bd2 100755 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Matrix.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Matrix.php @@ -82,9 +82,9 @@ class Matrix return self::evaluateArrayArgumentsSubsetFrom([self::class, __FUNCTION__], 1, $matrix, $rowNum, $columnNum); } - $rowNum = $rowNum ?? 0; + $rowNum = $rowNum ?: 0; $originalColumnNum = $columnNum; - $columnNum = $columnNum ?? 0; + $columnNum = $columnNum ?: 0; try { $rowNum = LookupRefValidations::validatePositiveInt($rowNum); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Beta.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Beta.php index a88c1054a..e3c4a8f77 100755 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Beta.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Beta.php @@ -43,7 +43,7 @@ class Beta return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $alpha, $beta, $rMin, $rMax); } - $rMin = $rMin ?? 0.0; + $rMin = $rMin ?: 0.0; $rMax = $rMax ?? 1.0; try { @@ -97,7 +97,7 @@ class Beta return self::evaluateArrayArguments([self::class, __FUNCTION__], $probability, $alpha, $beta, $rMin, $rMax); } - $rMin = $rMin ?? 0.0; + $rMin = $rMin ?: 0.0; $rMax = $rMax ?? 1.0; try { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Format.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Format.php index 93e728202..08861ff01 100755 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Format.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Format.php @@ -142,7 +142,7 @@ class Format */ private static function convertValue($value) { - $value = $value ?? 0; + $value = $value ?: 0; if (is_bool($value)) { if (Functions::getCompatibilityMode() === Functions::COMPATIBILITY_OPENOFFICE) { $value = (int) $value; diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Csv/Delimiter.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Csv/Delimiter.php index 029d4a186..ab5da47b0 100755 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Csv/Delimiter.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Csv/Delimiter.php @@ -66,7 +66,7 @@ class Delimiter $countLine = array_intersect_key($distribution, $delimiterKeys); foreach (self::POTENTIAL_DELIMETERS as $delimiter) { - $this->counts[$delimiter][] = $countLine[$delimiter] ?? 0; + $this->counts[$delimiter][] = $countLine[$delimiter] ?: 0; } } } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric.php index 174553225..b694ab327 100755 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric.php @@ -339,10 +339,10 @@ class Gnumeric extends BaseReader { if ($sheet !== null && isset($sheet->Selections)) { foreach ($sheet->Selections as $selection) { - $startCol = (int) ($selection->StartCol ?? 0); - $startRow = (int) ($selection->StartRow ?? 0) + 1; + $startCol = (int) ($selection->StartCol ?: 0); + $startRow = (int) ($selection->StartRow ?: 0) + 1; $endCol = (int) ($selection->EndCol ?? $startCol); - $endRow = (int) ($selection->endRow ?? 0) + 1; + $endRow = (int) ($selection->endRow ?: 0) + 1; $startColumn = Coordinate::stringFromColumnIndex($startCol + 1); $endColumn = Coordinate::stringFromColumnIndex($endCol + 1); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric/PageSetup.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric/PageSetup.php index 0257fc9a4..4830e416a 100755 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric/PageSetup.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric/PageSetup.php @@ -99,19 +99,19 @@ class PageSetup break; case 'top': - $this->sheetMargin($key, $marginSet['header'] ?? 0); + $this->sheetMargin($key, $marginSet['header'] ?: 0); break; case 'bottom': - $this->sheetMargin($key, $marginSet['footer'] ?? 0); + $this->sheetMargin($key, $marginSet['footer'] ?: 0); break; case 'header': - $this->sheetMargin($key, ($marginSet['top'] ?? 0) - $marginSize); + $this->sheetMargin($key, ($marginSet['top'] ?: 0) - $marginSize); break; case 'footer': - $this->sheetMargin($key, ($marginSet['bottom'] ?? 0) - $marginSize); + $this->sheetMargin($key, ($marginSet['bottom'] ?: 0) - $marginSize); break; } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods/PageSettings.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods/PageSettings.php index 0e18af5d2..95d4a841a 100755 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods/PageSettings.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods/PageSettings.php @@ -92,12 +92,12 @@ class PageSettings 'horizontalCentered' => $centered === 'horizontal' || $centered === 'both', 'verticalCentered' => $centered === 'vertical' || $centered === 'both', // margin size is already stored in inches, so no UOM conversion is required - 'marginLeft' => (float) ($marginLeft ?? 0.7), - 'marginRight' => (float) ($marginRight ?? 0.7), - 'marginTop' => (float) ($marginTop ?? 0.3), - 'marginBottom' => (float) ($marginBottom ?? 0.3), - 'marginHeader' => (float) ($marginHeader ?? 0.45), - 'marginFooter' => (float) ($marginFooter ?? 0.45), + 'marginLeft' => (float) ($marginLeft ?: 0.7), + 'marginRight' => (float) ($marginRight ?: 0.7), + 'marginTop' => (float) ($marginTop ?: 0.3), + 'marginBottom' => (float) ($marginBottom ?: 0.3), + 'marginHeader' => (float) ($marginHeader ?: 0.45), + 'marginFooter' => (float) ($marginFooter ?: 0.45), ]; } } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS.php index 2740a1b6d..b6b674e70 100755 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS.php @@ -142,8 +142,8 @@ class PPS $this->PrevPps = (int) $prev; $this->NextPps = (int) $next; $this->DirPps = (int) $dir; - $this->Time1st = $time_1st ?? 0; - $this->Time2nd = $time_2nd ?? 0; + $this->Time1st = $time_1st ?: 0; + $this->Time2nd = $time_2nd ?: 0; $this->_data = (string) $data; $this->children = $children; $this->Size = strlen((string) $data); @@ -185,7 +185,7 @@ class PPS . "\x00\x00\x00\x00" // 100 . OLE::localDateToOLE($this->Time1st) // 108 . OLE::localDateToOLE($this->Time2nd) // 116 - . pack('V', $this->startBlock ?? 0) // 120 + . pack('V', $this->startBlock ?: 0) // 120 . pack('V', $this->Size) // 124 . pack('V', 0); // 128 diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Style.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Style.php index be70639eb..244c8e474 100755 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Style.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Style.php @@ -450,7 +450,7 @@ class Style extends Supervisor for ($row = $rangeStartIndexes[1]; $row <= $rangeEndIndexes[1]; ++$row) { $rowDimension = $this->getActiveSheet()->getRowDimension($row); // row without explicit style should be formatted based on default style - $oldXfIndex = $rowDimension->getXfIndex() ?? 0; + $oldXfIndex = $rowDimension->getXfIndex() ?: 0; $rowDimension->setXfIndex($newXfIndexes[$oldXfIndex]); } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Meta.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Meta.php index 16f7c8b54..6cd674002 100755 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Meta.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Meta.php @@ -106,7 +106,7 @@ class Meta extends WriterPart break; case Properties::PROPERTY_TYPE_DATE: $objWriter->writeAttribute('meta:value-type', 'date'); - $dtobj = Date::dateTimeFromTimestamp($propertyValue ?? 0); + $dtobj = Date::dateTimeFromTimestamp($propertyValue ?: 0); $objWriter->writeRawData($dtobj->format(DATE_W3C)); break; diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Dompdf.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Dompdf.php index 690b0c54a..3bf3e028c 100755 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Dompdf.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Dompdf.php @@ -34,7 +34,7 @@ class Dompdf extends Pdf $fileHandle = parent::prepareForSave($filename); // Check for paper size and page orientation - $setup = $this->spreadsheet->getSheet($this->getSheetIndex() ?? 0)->getPageSetup(); + $setup = $this->spreadsheet->getSheet($this->getSheetIndex() ?: 0)->getPageSetup(); $orientation = $this->getOrientation() ?? $setup->getOrientation(); $orientation = ($orientation === PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; $printPaperSize = $this->getPaperSize() ?? $setup->getPaperSize(); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Mpdf.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Mpdf.php index d0ce9ed45..7616a3625 100755 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Mpdf.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Mpdf.php @@ -33,7 +33,7 @@ class Mpdf extends Pdf $fileHandle = parent::prepareForSave($filename); // Check for paper size and page orientation - $setup = $this->spreadsheet->getSheet($this->getSheetIndex() ?? 0)->getPageSetup(); + $setup = $this->spreadsheet->getSheet($this->getSheetIndex() ?: 0)->getPageSetup(); $orientation = $this->getOrientation() ?? $setup->getOrientation(); $orientation = ($orientation === PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; $printPaperSize = $this->getPaperSize() ?? $setup->getPaperSize(); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Tcpdf.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Tcpdf.php index aefc6b56d..d6f851234 100755 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Tcpdf.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Tcpdf.php @@ -46,12 +46,12 @@ class Tcpdf extends Pdf $paperSize = 'LETTER'; // Letter (8.5 in. by 11 in.) // Check for paper size and page orientation - $setup = $this->spreadsheet->getSheet($this->getSheetIndex() ?? 0)->getPageSetup(); + $setup = $this->spreadsheet->getSheet($this->getSheetIndex() ?: 0)->getPageSetup(); $orientation = $this->getOrientation() ?? $setup->getOrientation(); $orientation = ($orientation === PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; $printPaperSize = $this->getPaperSize() ?? $setup->getPaperSize(); $paperSize = self::$paperSizes[$printPaperSize] ?? PageSetup::getPaperSizeDefault(); - $printMargins = $this->spreadsheet->getSheet($this->getSheetIndex() ?? 0)->getPageMargins(); + $printMargins = $this->spreadsheet->getSheet($this->getSheetIndex() ?: 0)->getPageMargins(); // Create PDF $pdf = $this->createExternalWriterInstance($orientation, 'pt', $paperSize); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls.php index 33a404d42..2fb6fb97b 100755 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls.php @@ -434,7 +434,7 @@ class Xls extends BaseWriter $filename = $drawing->getPath(); $imageSize = getimagesize($filename); - $imageFormat = empty($imageSize) ? 0 : ($imageSize[2] ?? 0); + $imageFormat = empty($imageSize) ? 0 : ($imageSize[2] ?: 0); switch ($imageFormat) { case 1: // GIF, not supported by BIFF8, we convert to PNG diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Worksheet.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Worksheet.php index 9f23bd365..7c61b1167 100755 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Worksheet.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Worksheet.php @@ -1339,8 +1339,8 @@ class Worksheet extends BIFFwriter $colLast = $col_array[1] ?? null; $coldx = $col_array[2] ?? 8.43; $xfIndex = $col_array[3] ?? 15; - $grbit = $col_array[4] ?? 0; - $level = $col_array[5] ?? 0; + $grbit = $col_array[4] ?: 0; + $level = $col_array[5] ?: 0; $record = 0x007D; // Record identifier $length = 0x000C; // Number of bytes to follow diff --git a/vendor/symfony/cache/Adapter/CouchbaseBucketAdapter.php b/vendor/symfony/cache/Adapter/CouchbaseBucketAdapter.php index 36d5249b4..f31d6b431 100755 --- a/vendor/symfony/cache/Adapter/CouchbaseBucketAdapter.php +++ b/vendor/symfony/cache/Adapter/CouchbaseBucketAdapter.php @@ -148,15 +148,15 @@ class CouchbaseBucketAdapter extends AbstractAdapter { $options['username'] = $options['username'] ?? ''; $options['password'] = $options['password'] ?? ''; - $options['operationTimeout'] = $options['operationTimeout'] ?? 0; - $options['configTimeout'] = $options['configTimeout'] ?? 0; - $options['configNodeTimeout'] = $options['configNodeTimeout'] ?? 0; - $options['n1qlTimeout'] = $options['n1qlTimeout'] ?? 0; - $options['httpTimeout'] = $options['httpTimeout'] ?? 0; - $options['configDelay'] = $options['configDelay'] ?? 0; - $options['htconfigIdleTimeout'] = $options['htconfigIdleTimeout'] ?? 0; - $options['durabilityInterval'] = $options['durabilityInterval'] ?? 0; - $options['durabilityTimeout'] = $options['durabilityTimeout'] ?? 0; + $options['operationTimeout'] = $options['operationTimeout'] ?: 0; + $options['configTimeout'] = $options['configTimeout'] ?: 0; + $options['configNodeTimeout'] = $options['configNodeTimeout'] ?: 0; + $options['n1qlTimeout'] = $options['n1qlTimeout'] ?: 0; + $options['httpTimeout'] = $options['httpTimeout'] ?: 0; + $options['configDelay'] = $options['configDelay'] ?: 0; + $options['htconfigIdleTimeout'] = $options['htconfigIdleTimeout'] ?: 0; + $options['durabilityInterval'] = $options['durabilityInterval'] ?: 0; + $options['durabilityTimeout'] = $options['durabilityTimeout'] ?: 0; return $options; } diff --git a/vendor/symfony/cache/Messenger/EarlyExpirationHandler.php b/vendor/symfony/cache/Messenger/EarlyExpirationHandler.php index 9e53f5d2f..58b160f01 100755 --- a/vendor/symfony/cache/Messenger/EarlyExpirationHandler.php +++ b/vendor/symfony/cache/Messenger/EarlyExpirationHandler.php @@ -32,8 +32,8 @@ class EarlyExpirationHandler implements MessageHandlerInterface { $item = $message->getItem(); $metadata = $item->getMetadata(); - $expiry = $metadata[CacheItem::METADATA_EXPIRY] ?? 0; - $ctime = $metadata[CacheItem::METADATA_CTIME] ?? 0; + $expiry = $metadata[CacheItem::METADATA_EXPIRY] ?: 0; + $ctime = $metadata[CacheItem::METADATA_CTIME] ?: 0; if ($expiry && $ctime) { // skip duplicate or expired messages diff --git a/vendor/symfony/cache/Traits/RedisTrait.php b/vendor/symfony/cache/Traits/RedisTrait.php index 67d866316..4e9025eb1 100755 --- a/vendor/symfony/cache/Traits/RedisTrait.php +++ b/vendor/symfony/cache/Traits/RedisTrait.php @@ -196,7 +196,7 @@ trait RedisTrait $hostIndex = 0; do { $host = $hosts[$hostIndex]['host'] ?? $hosts[$hostIndex]['path']; - $port = $hosts[$hostIndex]['port'] ?? 0; + $port = $hosts[$hostIndex]['port'] ?: 0; $address = false; if (isset($hosts[$hostIndex]['host']) && $tls) { diff --git a/vendor/symfony/http-client/DataCollector/HttpClientDataCollector.php b/vendor/symfony/http-client/DataCollector/HttpClientDataCollector.php index dda03d5a3..888b4ce00 100755 --- a/vendor/symfony/http-client/DataCollector/HttpClientDataCollector.php +++ b/vendor/symfony/http-client/DataCollector/HttpClientDataCollector.php @@ -72,12 +72,12 @@ final class HttpClientDataCollector extends DataCollector implements LateDataCol public function getRequestCount(): int { - return $this->data['request_count'] ?? 0; + return $this->data['request_count'] ?: 0; } public function getErrorCount(): int { - return $this->data['error_count'] ?? 0; + return $this->data['error_count'] ?: 0; } /** @@ -112,12 +112,12 @@ final class HttpClientDataCollector extends DataCollector implements LateDataCol ]; foreach ($traces as $i => $trace) { - if (400 <= ($trace['info']['http_code'] ?? 0)) { + if (400 <= ($trace['info']['http_code'] ?: 0)) { ++$errorCount; } $info = $trace['info']; - $traces[$i]['http_code'] = $info['http_code'] ?? 0; + $traces[$i]['http_code'] = $info['http_code'] ?: 0; unset($info['filetime'], $info['http_code'], $info['ssl_verify_result'], $info['content_type']); diff --git a/vendor/symfony/http-client/HttpClientTrait.php b/vendor/symfony/http-client/HttpClientTrait.php index f09b4e8ea..078b60e2a 100755 --- a/vendor/symfony/http-client/HttpClientTrait.php +++ b/vendor/symfony/http-client/HttpClientTrait.php @@ -508,7 +508,7 @@ trait HttpClientTrait $parts['query'] = self::mergeQueryString($parts['query'] ?? null, $query, true); } - $port = $parts['port'] ?? 0; + $port = $parts['port'] ?: 0; if (null !== $scheme = $parts['scheme'] ?? null) { if (!isset($allowedSchemes[$scheme = strtolower($scheme)])) { diff --git a/vendor/symfony/http-client/Response/AsyncContext.php b/vendor/symfony/http-client/Response/AsyncContext.php index 7fd815d52..649685230 100755 --- a/vendor/symfony/http-client/Response/AsyncContext.php +++ b/vendor/symfony/http-client/Response/AsyncContext.php @@ -163,7 +163,7 @@ final class AsyncContext $onProgress($dlNow, $dlSize, $thisInfo + $info); }; } - if (0 < ($info['max_duration'] ?? 0) && 0 < ($info['total_time'] ?? 0)) { + if (0 < ($info['max_duration'] ?: 0) && 0 < ($info['total_time'] ?: 0)) { if (0 >= $options['max_duration'] = $info['max_duration'] - $info['total_time']) { throw new TransportException(sprintf('Max duration was reached for "%s".', $info['url'])); } diff --git a/vendor/symfony/http-client/Response/CurlResponse.php b/vendor/symfony/http-client/Response/CurlResponse.php index ae18d5840..f8f5ffbfe 100755 --- a/vendor/symfony/http-client/Response/CurlResponse.php +++ b/vendor/symfony/http-client/Response/CurlResponse.php @@ -329,7 +329,7 @@ final class CurlResponse implements ResponseInterface, StreamableInterface } } - if (\CURLE_RECV_ERROR === $result && 'H' === $waitFor[0] && 400 <= ($responses[(int) $ch]->info['http_code'] ?? 0)) { + if (\CURLE_RECV_ERROR === $result && 'H' === $waitFor[0] && 400 <= ($responses[(int) $ch]->info['http_code'] ?: 0)) { $multi->handlesActivity[$id][] = new FirstChunk(); } diff --git a/vendor/symfony/http-client/Response/MockResponse.php b/vendor/symfony/http-client/Response/MockResponse.php index 496b7bee5..2098ba9bb 100755 --- a/vendor/symfony/http-client/Response/MockResponse.php +++ b/vendor/symfony/http-client/Response/MockResponse.php @@ -279,9 +279,9 @@ class MockResponse implements ResponseInterface, StreamableInterface // populate info related to headers $info = $mock->getInfo() ?: []; - $response->info['http_code'] = ($info['http_code'] ?? 0) ?: $mock->getStatusCode() ?: 200; + $response->info['http_code'] = ($info['http_code'] ?: 0) ?: $mock->getStatusCode() ?: 200; $response->addResponseHeaders($info['response_headers'] ?? [], $response->info, $response->headers); - $dlSize = isset($response->headers['content-encoding']) || 'HEAD' === $response->info['http_method'] || \in_array($response->info['http_code'], [204, 304], true) ? 0 : (int) ($response->headers['content-length'][0] ?? 0); + $dlSize = isset($response->headers['content-encoding']) || 'HEAD' === $response->info['http_method'] || \in_array($response->info['http_code'], [204, 304], true) ? 0 : (int) ($response->headers['content-length'][0] ?: 0); $response->info = [ 'start_time' => $response->info['start_time'], diff --git a/vendor/symfony/http-client/Response/NativeResponse.php b/vendor/symfony/http-client/Response/NativeResponse.php index 96f1256a1..c7cc29622 100755 --- a/vendor/symfony/http-client/Response/NativeResponse.php +++ b/vendor/symfony/http-client/Response/NativeResponse.php @@ -205,7 +205,7 @@ final class NativeResponse implements ResponseInterface, StreamableInterface $host = parse_url($this->info['redirect_url'] ?? $this->url, \PHP_URL_HOST); $this->multi->lastTimeout = null; $this->multi->openHandles[$this->id] = [&$this->pauseExpiry, $h, $this->buffer, $this->onProgress, &$this->remaining, &$this->info, $host]; - $this->multi->hosts[$host] = 1 + ($this->multi->hosts[$host] ?? 0); + $this->multi->hosts[$host] = 1 + ($this->multi->hosts[$host] ?: 0); } /** @@ -336,7 +336,7 @@ final class NativeResponse implements ResponseInterface, StreamableInterface if ($response->pauseExpiry && microtime(true) < $response->pauseExpiry) { // Create empty open handles to tell we still have pending requests $multi->openHandles[$i] = [\INF, null, null, null]; - } elseif ($maxHosts && $maxHosts > ($multi->hosts[parse_url($response->url, \PHP_URL_HOST)] ?? 0)) { + } elseif ($maxHosts && $maxHosts > ($multi->hosts[parse_url($response->url, \PHP_URL_HOST)] ?: 0)) { // Open the next pending request - this is a blocking operation so we do only one of them $response->open(); $multi->sleep = false; diff --git a/vendor/symfony/http-client/Response/StreamWrapper.php b/vendor/symfony/http-client/Response/StreamWrapper.php index 3768e2e06..74291b3c2 100755 --- a/vendor/symfony/http-client/Response/StreamWrapper.php +++ b/vendor/symfony/http-client/Response/StreamWrapper.php @@ -132,7 +132,7 @@ class StreamWrapper } } - if (0 !== fseek($this->content, $this->offset ?? 0)) { + if (0 !== fseek($this->content, $this->offset ?: 0)) { return false; } @@ -208,7 +208,7 @@ class StreamWrapper public function stream_tell(): int { - return $this->offset ?? 0; + return $this->offset ?: 0; } public function stream_eof(): bool @@ -230,7 +230,7 @@ class StreamWrapper $size = ftell($this->content); if (\SEEK_CUR === $whence) { - $offset += $this->offset ?? 0; + $offset += $this->offset ?: 0; } if (\SEEK_END === $whence || $size < $offset) { diff --git a/vendor/symfony/http-foundation/InputBag.php b/vendor/symfony/http-foundation/InputBag.php index fd833467f..efcc4022f 100755 --- a/vendor/symfony/http-foundation/InputBag.php +++ b/vendor/symfony/http-foundation/InputBag.php @@ -85,7 +85,7 @@ final class InputBag extends ParameterBag $options = ['flags' => $options]; } - if (\is_array($value) && !(($options['flags'] ?? 0) & (\FILTER_REQUIRE_ARRAY | \FILTER_FORCE_ARRAY))) { + if (\is_array($value) && !(($options['flags'] ?: 0) & (\FILTER_REQUIRE_ARRAY | \FILTER_FORCE_ARRAY))) { throw new BadRequestException(sprintf('Input value "%s" contains an array, but "FILTER_REQUIRE_ARRAY" or "FILTER_FORCE_ARRAY" flags were not set.', $key)); } diff --git a/vendor/symfony/polyfill-intl-normalizer/Normalizer.php b/vendor/symfony/polyfill-intl-normalizer/Normalizer.php index 81704ab37..0b7f46b45 100755 --- a/vendor/symfony/polyfill-intl-normalizer/Normalizer.php +++ b/vendor/symfony/polyfill-intl-normalizer/Normalizer.php @@ -154,7 +154,7 @@ class Normalizer || $lastUcls) { // Table lookup and combining chars composition - $ucls = $combClass[$uchr] ?? 0; + $ucls = $combClass[$uchr] ?: 0; if (isset($compMap[$lastUchr.$uchr]) && (!$lastUcls || $lastUcls < $ucls)) { $lastUchr = $compMap[$lastUchr.$uchr]; diff --git a/vendor/symfony/var-dumper/Caster/ExceptionCaster.php b/vendor/symfony/var-dumper/Caster/ExceptionCaster.php index f2c0f9687..5b08a1024 100755 --- a/vendor/symfony/var-dumper/Caster/ExceptionCaster.php +++ b/vendor/symfony/var-dumper/Caster/ExceptionCaster.php @@ -209,8 +209,8 @@ class ExceptionCaster $srcKey = $f['file']; $ellipsis = new LinkStub($srcKey, 0); $srcAttr = 'collapse='.(int) $ellipsis->inVendor; - $ellipsisTail = $ellipsis->attr['ellipsis-tail'] ?? 0; - $ellipsis = $ellipsis->attr['ellipsis'] ?? 0; + $ellipsisTail = $ellipsis->attr['ellipsis-tail'] ?: 0; + $ellipsis = $ellipsis->attr['ellipsis'] ?: 0; if (file_exists($f['file']) && 0 <= self::$srcContext) { if (!empty($f['class']) && (is_subclass_of($f['class'], 'Twig\Template') || is_subclass_of($f['class'], 'Twig_Template')) && method_exists($f['class'], 'getDebugInfo')) { diff --git a/vendor/symfony/var-dumper/Dumper/CliDumper.php b/vendor/symfony/var-dumper/Dumper/CliDumper.php index e3861cdaf..ad8773c69 100755 --- a/vendor/symfony/var-dumper/Dumper/CliDumper.php +++ b/vendor/symfony/var-dumper/Dumper/CliDumper.php @@ -488,7 +488,7 @@ class CliDumper extends AbstractDumper href: if ($this->colors && $this->handlesHrefGracefully) { - if (isset($attr['file']) && $href = $this->getSourceLink($attr['file'], $attr['line'] ?? 0)) { + if (isset($attr['file']) && $href = $this->getSourceLink($attr['file'], $attr['line'] ?: 0)) { if ('note' === $style) { $value .= "\033]8;;{$href}\033\\^\033]8;;\033\\"; } else { diff --git a/vendor/symfony/var-dumper/Dumper/HtmlDumper.php b/vendor/symfony/var-dumper/Dumper/HtmlDumper.php index 9b57f900e..571bc9062 100755 --- a/vendor/symfony/var-dumper/Dumper/HtmlDumper.php +++ b/vendor/symfony/var-dumper/Dumper/HtmlDumper.php @@ -887,7 +887,7 @@ EOHTML $style .= sprintf(' title="%s"', empty($attr['dynamic']) ? 'Public property' : 'Runtime added dynamic property'); } elseif ('str' === $style && 1 < $attr['length']) { $style .= sprintf(' title="%d%s characters"', $attr['length'], $attr['binary'] ? ' binary or non-UTF-8' : ''); - } elseif ('note' === $style && 0 < ($attr['depth'] ?? 0) && false !== $c = strrpos($value, '\\')) { + } elseif ('note' === $style && 0 < ($attr['depth'] ?: 0) && false !== $c = strrpos($value, '\\')) { $style .= ' title=""'; $attr += [ 'ellipsis' => \strlen($value) - $c, @@ -942,7 +942,7 @@ EOHTML return $s.''; }, $v).''; - if (isset($attr['file']) && $href = $this->getSourceLink($attr['file'], $attr['line'] ?? 0)) { + if (isset($attr['file']) && $href = $this->getSourceLink($attr['file'], $attr['line'] ?: 0)) { $attr['href'] = $href; } if (isset($attr['href'])) { diff --git a/vendor/topthink/framework/src/think/Validate.php b/vendor/topthink/framework/src/think/Validate.php index 078840641..351a36362 100755 --- a/vendor/topthink/framework/src/think/Validate.php +++ b/vendor/topthink/framework/src/think/Validate.php @@ -1180,7 +1180,7 @@ class Validate if (is_string($rule) && strpos($rule, ',')) { [$rule, $param] = explode(',', $rule); } elseif (is_array($rule)) { - $param = $rule[1] ?? 0; + $param = $rule[1] ?: 0; $rule = $rule[0]; } else { $param = 0; diff --git a/vendor/topthink/think-orm/src/db/BaseQuery.php b/vendor/topthink/think-orm/src/db/BaseQuery.php index 60aa21e48..229d2e6e4 100755 --- a/vendor/topthink/think-orm/src/db/BaseQuery.php +++ b/vendor/topthink/think-orm/src/db/BaseQuery.php @@ -705,7 +705,7 @@ abstract class BaseQuery ->limit(1) ->find(); - $result = $data[$key] ?? 0; + $result = $data[$key] ?: 0; if (is_numeric($result)) { $lastId = 'asc' == $sort ? ($result - 1) + ($page - 1) * $listRows : ($result + 1) - ($page - 1) * $listRows; diff --git a/vendor/topthink/think-orm/src/db/Mongo.php b/vendor/topthink/think-orm/src/db/Mongo.php index cf6e9c4c4..ac17a9884 100755 --- a/vendor/topthink/think-orm/src/db/Mongo.php +++ b/vendor/topthink/think-orm/src/db/Mongo.php @@ -113,7 +113,7 @@ class Mongo extends BaseQuery public function aggregate(string $aggregate, $field, bool $force = false) { $result = $this->cmd('aggregate', [strtolower($aggregate), $field]); - $value = $result[0]['aggregate'] ?? 0; + $value = $result[0]['aggregate'] ?: 0; if ($force) { $value += 0; diff --git a/vendor/w7corp/easywechat/src/MiniApp/Application.php b/vendor/w7corp/easywechat/src/MiniApp/Application.php index 9e40cc918..61eb56602 100755 --- a/vendor/w7corp/easywechat/src/MiniApp/Application.php +++ b/vendor/w7corp/easywechat/src/MiniApp/Application.php @@ -167,7 +167,7 @@ class Application implements ApplicationInterface accessToken: $this->getAccessToken(), failureJudge: fn ( Response $response - ) => (bool) ($response->toArray()['errcode'] ?? 0) || ! is_null($response->toArray()['error'] ?? null), + ) => (bool) ($response->toArray()['errcode'] ?: 0) || ! is_null($response->toArray()['error'] ?? null), throw: (bool) $this->config->get('http.throw', true), ))->setPresets($this->config->all()); } diff --git a/vendor/w7corp/easywechat/src/OfficialAccount/Application.php b/vendor/w7corp/easywechat/src/OfficialAccount/Application.php index 33b57bb24..af3705755 100755 --- a/vendor/w7corp/easywechat/src/OfficialAccount/Application.php +++ b/vendor/w7corp/easywechat/src/OfficialAccount/Application.php @@ -226,7 +226,7 @@ class Application implements ApplicationInterface return (new AccessTokenAwareClient( client: $httpClient, accessToken: $this->getAccessToken(), - failureJudge: fn (Response $response) => (bool) ($response->toArray()['errcode'] ?? 0), + failureJudge: fn (Response $response) => (bool) ($response->toArray()['errcode'] ?: 0), throw: (bool) $this->config->get('http.throw', true), ))->setPresets($this->config->all()); } diff --git a/vendor/w7corp/easywechat/src/OpenPlatform/Application.php b/vendor/w7corp/easywechat/src/OpenPlatform/Application.php index abb4f7d56..f1e29d890 100755 --- a/vendor/w7corp/easywechat/src/OpenPlatform/Application.php +++ b/vendor/w7corp/easywechat/src/OpenPlatform/Application.php @@ -462,7 +462,7 @@ class Application implements ApplicationInterface return (new AccessTokenAwareClient( client: $this->getHttpClient(), accessToken: $this->getComponentAccessToken(), - failureJudge: fn (Response $response) => (bool) ($response->toArray()['errcode'] ?? 0), + failureJudge: fn (Response $response) => (bool) ($response->toArray()['errcode'] ?: 0), throw: (bool) $this->config->get('http.throw', true), ))->setPresets($this->config->all()); } diff --git a/vendor/w7corp/easywechat/src/OpenWork/Application.php b/vendor/w7corp/easywechat/src/OpenWork/Application.php index 9f13e9219..7c6980240 100755 --- a/vendor/w7corp/easywechat/src/OpenWork/Application.php +++ b/vendor/w7corp/easywechat/src/OpenWork/Application.php @@ -269,7 +269,7 @@ class Application implements ApplicationInterface return (new AccessTokenAwareClient( client: $this->getHttpClient(), accessToken: $this->getProviderAccessToken(), - failureJudge: fn (Response $response) => (bool) ($response->toArray()['errcode'] ?? 0), + failureJudge: fn (Response $response) => (bool) ($response->toArray()['errcode'] ?: 0), throw: (bool) $this->config->get('http.throw', true), ))->setPresets($this->config->all()); } diff --git a/vendor/w7corp/easywechat/src/Work/Application.php b/vendor/w7corp/easywechat/src/Work/Application.php index 982c64f76..e5b68b82e 100755 --- a/vendor/w7corp/easywechat/src/Work/Application.php +++ b/vendor/w7corp/easywechat/src/Work/Application.php @@ -133,7 +133,7 @@ class Application implements ApplicationInterface return (new AccessTokenAwareClient( client: $this->getHttpClient(), accessToken: $this->getAccessToken(), - failureJudge: fn (Response $response) => (bool) ($response->toArray()['errcode'] ?? 0), + failureJudge: fn (Response $response) => (bool) ($response->toArray()['errcode'] ?: 0), throw: (bool) $this->config->get('http.throw', true), ))->setPresets($this->config->all()); }