update
This commit is contained in:
parent
e36b200806
commit
ea0608fadd
@ -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);
|
||||
}
|
||||
|
@ -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'] ?? '';
|
||||
|
@ -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'] ?? '',
|
||||
|
@ -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'] ?? '',
|
||||
|
@ -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) {
|
||||
|
@ -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'],
|
||||
|
@ -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)) {
|
||||
|
@ -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'] ?? '',
|
||||
|
@ -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,
|
||||
|
@ -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(),
|
||||
]);
|
||||
|
@ -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'],
|
||||
|
@ -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();
|
||||
|
@ -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'] ?? '',
|
||||
|
@ -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'] ?? '',
|
||||
|
@ -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'] ?? '',
|
||||
|
@ -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'] ?? '',
|
||||
|
@ -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,
|
||||
|
@ -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();
|
||||
|
@ -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'] ?? '',
|
||||
|
@ -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();
|
||||
|
@ -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
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -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'] ?? '',
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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'] ?? ''
|
||||
]);
|
||||
|
@ -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()
|
||||
|
@ -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('通知配置不存在');
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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'],
|
||||
|
@ -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(),
|
||||
]);
|
||||
|
@ -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']),
|
||||
|
@ -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(),
|
||||
|
@ -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'] ?? '',
|
||||
]);
|
||||
|
@ -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'] ?? '',
|
||||
|
@ -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'] ?? '',
|
||||
];
|
||||
|
@ -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,
|
||||
|
@ -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(),
|
||||
]);
|
||||
|
@ -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'],
|
||||
];
|
||||
|
@ -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'],
|
||||
|
@ -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']
|
||||
];
|
||||
|
@ -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];
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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'];
|
||||
|
||||
|
2
vendor/guzzlehttp/guzzle/src/Utils.php
vendored
2
vendor/guzzlehttp/guzzle/src/Utils.php
vendored
@ -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_';
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -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([
|
||||
|
@ -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),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -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])) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
@ -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]);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
2
vendor/symfony/cache/Traits/RedisTrait.php
vendored
2
vendor/symfony/cache/Traits/RedisTrait.php
vendored
@ -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) {
|
||||
|
@ -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']);
|
||||
|
||||
|
@ -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)])) {
|
||||
|
@ -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']));
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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'],
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
2
vendor/symfony/http-foundation/InputBag.php
vendored
2
vendor/symfony/http-foundation/InputBag.php
vendored
@ -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));
|
||||
}
|
||||
|
||||
|
@ -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];
|
||||
|
@ -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')) {
|
||||
|
@ -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 {
|
||||
|
@ -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.'</span>';
|
||||
}, $v).'</span>';
|
||||
|
||||
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'])) {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
2
vendor/topthink/think-orm/src/db/Mongo.php
vendored
2
vendor/topthink/think-orm/src/db/Mongo.php
vendored
@ -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;
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user