修复异常

This commit is contained in:
yaooo 2023-12-11 17:38:48 +08:00
parent 84e58e0d28
commit 765b2c05bb
2 changed files with 62 additions and 62 deletions

View File

@ -41,14 +41,14 @@ class CustomContactsLogic extends BaseLogic
Db::startTrans();
try {
CustomContacts::create([
'custom_id' => $params['custom_id'],
'name' => $params['name'],
'position' => $params['position'],
'phone' => $params['phone'],
'telephone' => $params['telephone'],
'email' => $params['email'],
'notes' => $params['notes'],
'annex' => $params['annex'],
'custom_id' => $params['custom_id'] ?? 0,
'name' => $params['name'] ?? '',
'position' => $params['position'] ?? '',
'phone' => $params['phone'] ?? '',
'telephone' => $params['telephone'] ?? '',
'email' => $params['email'] ?? '',
'notes' => $params['notes'] ?? '',
'annex' => $params['annex'] ?? '',
]);
Db::commit();
@ -73,14 +73,14 @@ class CustomContactsLogic extends BaseLogic
Db::startTrans();
try {
CustomContacts::where('id', $params['id'])->update([
'custom_id' => $params['custom_id'],
'name' => $params['name'],
'position' => $params['position'],
'phone' => $params['phone'],
'telephone' => $params['telephone'],
'email' => $params['email'],
'notes' => $params['notes'],
'annex' => $params['annex'],
'custom_id' => $params['custom_id'] ?? 0,
'name' => $params['name'] ?? '',
'position' => $params['position'] ?? '',
'phone' => $params['phone'] ?? '',
'telephone' => $params['telephone'] ?? '',
'email' => $params['email'] ?? '',
'notes' => $params['notes'] ?? '',
'annex' => $params['annex'] ?? '',
]);
Db::commit();

View File

@ -41,30 +41,30 @@ class CustomLogic extends BaseLogic
Db::startTrans();
try {
Custom::create([
'name' => $params['name'],
'custom_type' => $params['custom_type'],
'parent_company' => $params['parent_company'],
'phone' => $params['phone'],
'credit_rating' => $params['credit_rating'],
'province' => $params['province'],
'city' => $params['city'],
'area' => $params['area'],
'address' => $params['address'],
'notes' => $params['notes'],
'master_name' => $params['master_name'],
'master_position' => $params['master_position'],
'master_phone' => $params['master_phone'],
'master_email' => $params['master_email'],
'master_telephone' => $params['master_telephone'],
'master_notes' => $params['master_notes'],
'company_name' => $params['company_name'],
'company_tin' => $params['company_tin'],
'bank_open_address' => $params['bank_open_address'],
'company_telephone' => $params['company_telephone'],
'bank_name' => $params['bank_name'],
'bank_account' => $params['bank_account'],
'name' => $params['name'] ?? '',
'custom_type' => $params['custom_type'] ?? 0,
'parent_company' => $params['parent_company'] ?? 0,
'phone' => $params['phone'] ?? '',
'credit_rating' => $params['credit_rating'] ?? 0,
'province' => $params['province'] ?? 0,
'city' => $params['city'] ?? 0,
'area' => $params['area'] ?? 0,
'address' => $params['address'] ?? '',
'notes' => $params['notes'] ?? '',
'master_name' => $params['master_name'] ?? '',
'master_position' => $params['master_position'] ?? '',
'master_phone' => $params['master_phone'] ?? '',
'master_email' => $params['master_email'] ?? '',
'master_telephone' => $params['master_telephone'] ?? '',
'master_notes' => $params['master_notes'] ?? '',
'company_name' => $params['company_name'] ?? '',
'company_tin' => $params['company_tin'] ?? '',
'bank_open_address' => $params['bank_open_address'] ?? '',
'company_telephone' => $params['company_telephone'] ?? '',
'bank_name' => $params['bank_name'] ?? '',
'bank_account' => $params['bank_account'] ?? '',
'other_contacts' => json_encode($params['other_contacts']),
'status' => $params['status']
'status' => $params['status'] ?? 0,
]);
Db::commit();
@ -89,30 +89,30 @@ class CustomLogic extends BaseLogic
Db::startTrans();
try {
Custom::where('id', $params['id'])->update([
'name' => $params['name'],
'custom_type' => $params['custom_type'],
'parent_company' => $params['parent_company'],
'phone' => $params['phone'],
'credit_rating' => $params['credit_rating'],
'province' => $params['province'],
'city' => $params['city'],
'area' => $params['area'],
'address' => $params['address'],
'notes' => $params['notes'],
'master_name' => $params['master_name'],
'master_position' => $params['master_position'],
'master_phone' => $params['master_phone'],
'master_email' => $params['master_email'],
'master_telephone' => $params['master_telephone'],
'master_notes' => $params['master_notes'],
'company_name' => $params['company_name'],
'company_tin' => $params['company_tin'],
'bank_open_address' => $params['bank_open_address'],
'company_telephone' => $params['company_telephone'],
'bank_name' => $params['bank_name'],
'bank_account' => $params['bank_account'],
'name' => $params['name'] ?? '',
'custom_type' => $params['custom_type'] ?? 0,
'parent_company' => $params['parent_company'] ?? 0,
'phone' => $params['phone'] ?? '',
'credit_rating' => $params['credit_rating'] ?? 0,
'province' => $params['province'] ?? 0,
'city' => $params['city'] ?? 0,
'area' => $params['area'] ?? 0,
'address' => $params['address'] ?? '',
'notes' => $params['notes'] ?? '',
'master_name' => $params['master_name'] ?? '',
'master_position' => $params['master_position'] ?? '',
'master_phone' => $params['master_phone'] ?? '',
'master_email' => $params['master_email'] ?? '',
'master_telephone' => $params['master_telephone'] ?? '',
'master_notes' => $params['master_notes'] ?? '',
'company_name' => $params['company_name'] ?? '',
'company_tin' => $params['company_tin'] ?? '',
'bank_open_address' => $params['bank_open_address'] ?? '',
'company_telephone' => $params['company_telephone'] ?? '',
'bank_name' => $params['bank_name'] ?? '',
'bank_account' => $params['bank_account'] ?? '',
'other_contacts' => json_encode($params['other_contacts']),
'status' => $params['status']
'status' => $params['status'] ?? 0,
]);
Db::commit();