This commit is contained in:
weiz 2024-02-03 11:43:56 +08:00
parent 6f7774cb56
commit cc3f65ded8
41 changed files with 372 additions and 372 deletions

View File

@ -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);
}

View File

@ -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'] ?? '';

View File

@ -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'] ?? '',

View File

@ -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'] ?? '',

View File

@ -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) {

View File

@ -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'],

View File

@ -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)) {

View File

@ -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'] ?? '',

View File

@ -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,

View File

@ -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(),
]);

View File

@ -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'],

View File

@ -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();

View File

@ -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'] ?? '',

View File

@ -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'] ?? '',

View File

@ -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'] ?? '',

View File

@ -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'] ?? '',

View File

@ -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,

View File

@ -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();

View File

@ -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'] ?? '',

View File

@ -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();

View File

@ -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
]);
}

View File

@ -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'] ?? '',

View File

@ -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) {

View File

@ -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;

View File

@ -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'] ?? ''
]);

View File

@ -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()

View File

@ -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('通知配置不存在');

View File

@ -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;
}

View File

@ -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,

View File

@ -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'],

View File

@ -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(),
]);

View File

@ -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']),

View File

@ -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(),

View File

@ -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'] ?? '',
]);

View File

@ -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'] ?? '',

View File

@ -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'] ?? '',
];

View File

@ -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,

View File

@ -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(),
]);

View File

@ -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'],
];

View File

@ -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'],

View File

@ -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']
];