修复异常
This commit is contained in:
parent
b1b44bb0f3
commit
84e58e0d28
@ -41,16 +41,16 @@ class CustomFollowLogic extends BaseLogic
|
|||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
try {
|
try {
|
||||||
CustomFollow::create([
|
CustomFollow::create([
|
||||||
'custom_id' => $params['custom_id'],
|
'custom_id' => $params['custom_id'] ?? 0,
|
||||||
'contacts' => $params['contacts'],
|
'contacts' => $params['contacts'] ?? '',
|
||||||
'date' => strtotime($params['date']),
|
'date' => strtotime($params['date']),
|
||||||
'types' => $params['types'],
|
'types' => $params['types'] ?? 0,
|
||||||
'admin_id' => $params['admin_id'],
|
'admin_id' => $params['admin_id'] ?? 0,
|
||||||
'description' => $params['description'],
|
'description' => $params['description'] ?? '',
|
||||||
'annex' => $params['annex'],
|
'annex' => $params['annex'] ?? '',
|
||||||
'coordinate' => $params['coordinate'],
|
'coordinate' => $params['coordinate'] ?? 0,
|
||||||
'next_follow_date' => strtotime($params['next_follow_date']),
|
'next_follow_date' => strtotime($params['next_follow_date']),
|
||||||
'status' => $params['status']
|
'status' => $params['status'] ?? 0
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Db::commit();
|
Db::commit();
|
||||||
@ -75,16 +75,16 @@ class CustomFollowLogic extends BaseLogic
|
|||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
try {
|
try {
|
||||||
CustomFollow::where('id', $params['id'])->update([
|
CustomFollow::where('id', $params['id'])->update([
|
||||||
'custom_id' => $params['custom_id'],
|
'custom_id' => $params['custom_id'] ?? 0,
|
||||||
'contacts' => $params['contacts'],
|
'contacts' => $params['contacts'] ?? '',
|
||||||
'date' => strtotime($params['date']),
|
'date' => strtotime($params['date']),
|
||||||
'types' => $params['types'],
|
'types' => $params['types'] ?? 0,
|
||||||
'admin_id' => $params['admin_id'],
|
'admin_id' => $params['admin_id'] ?? 0,
|
||||||
'description' => $params['description'],
|
'description' => $params['description'] ?? '',
|
||||||
'annex' => $params['annex'],
|
'annex' => $params['annex'] ?? '',
|
||||||
'coordinate' => $params['coordinate'],
|
'coordinate' => $params['coordinate'] ?? 0,
|
||||||
'next_follow_date' => strtotime($params['next_follow_date']),
|
'next_follow_date' => strtotime($params['next_follow_date']),
|
||||||
'status' => $params['status']
|
'status' => $params['status'] ?? 0
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Db::commit();
|
Db::commit();
|
||||||
|
@ -41,20 +41,20 @@ class CustomServiceLogic extends BaseLogic
|
|||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
try {
|
try {
|
||||||
CustomService::create([
|
CustomService::create([
|
||||||
'project_id' => $params['project_id'],
|
'project_id' => $params['project_id'] ?? 0,
|
||||||
'custom_id' => $params['custom_id'],
|
'custom_id' => $params['custom_id'] ?? 0,
|
||||||
'approve_id' => $params['approve_id'],
|
'approve_id' => $params['approve_id'] ?? 0,
|
||||||
'contacts' => $params['contacts'],
|
'contacts' => $params['contacts'] ?? '',
|
||||||
'phone' => $params['phone'],
|
'phone' => $params['phone'] ?? '',
|
||||||
'date' => strtotime($params['date']),
|
'date' => strtotime($params['date']),
|
||||||
'classification' => $params['classification'],
|
'classification' => $params['classification'] ?? 0,
|
||||||
'urgency' => $params['urgency'],
|
'urgency' => $params['urgency'] ?? 0,
|
||||||
'receiver' => $params['receiver'],
|
'receiver' => $params['receiver'] ?? '',
|
||||||
'processed_admin_id' => $params['processed_admin_id'],
|
'processed_admin_id' => $params['processed_admin_id'] ?? 0,
|
||||||
'name' => $params['name'],
|
'name' => $params['name'] ?? '',
|
||||||
'description' => $params['description'],
|
'description' => $params['description'] ?? 0,
|
||||||
'notes' => $params['notes'],
|
'notes' => $params['notes'] ?? '',
|
||||||
'annex' => $params['annex']
|
'annex' => $params['annex'] ?? ''
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Db::commit();
|
Db::commit();
|
||||||
@ -79,20 +79,20 @@ class CustomServiceLogic extends BaseLogic
|
|||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
try {
|
try {
|
||||||
CustomService::where('id', $params['id'])->update([
|
CustomService::where('id', $params['id'])->update([
|
||||||
'project_id' => $params['project_id'],
|
'project_id' => $params['project_id'] ?? 0,
|
||||||
'custom_id' => $params['custom_id'],
|
'custom_id' => $params['custom_id'] ?? 0,
|
||||||
'approve_id' => $params['approve_id'],
|
'approve_id' => $params['approve_id'] ?? 0,
|
||||||
'contacts' => $params['contacts'],
|
'contacts' => $params['contacts'] ?? '',
|
||||||
'phone' => $params['phone'],
|
'phone' => $params['phone'] ?? '',
|
||||||
'date' => strtotime($params['date']),
|
'date' => strtotime($params['date']),
|
||||||
'classification' => $params['classification'],
|
'classification' => $params['classification'] ?? 0,
|
||||||
'urgency' => $params['urgency'],
|
'urgency' => $params['urgency'] ?? 0,
|
||||||
'receiver' => $params['receiver'],
|
'receiver' => $params['receiver'] ?? '',
|
||||||
'processed_admin_id' => $params['processed_admin_id'],
|
'processed_admin_id' => $params['processed_admin_id'] ?? 0,
|
||||||
'name' => $params['name'],
|
'name' => $params['name'] ?? '',
|
||||||
'description' => $params['description'],
|
'description' => $params['description'] ?? 0,
|
||||||
'notes' => $params['notes'],
|
'notes' => $params['notes'] ?? '',
|
||||||
'annex' => $params['annex']
|
'annex' => $params['annex'] ?? ''
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Db::commit();
|
Db::commit();
|
||||||
|
@ -42,20 +42,20 @@ class QuotationLogic extends BaseLogic
|
|||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
try {
|
try {
|
||||||
$quotation = Quotation::create([
|
$quotation = Quotation::create([
|
||||||
'customer_id' => $params['customer_id'],
|
'customer_id' => $params['customer_id'] ?? 0,
|
||||||
'approve_id' => $params['approve_id'],
|
'approve_id' => $params['approve_id'] ?? 0,
|
||||||
'quotation_date' => $params['quotation_date'],
|
'quotation_date' => $params['quotation_date'] ?? '',
|
||||||
'contacts' => $params['contacts'],
|
'contacts' => $params['contacts'] ?? '',
|
||||||
'contacts_phone' => $params['contacts_phone'],
|
'contacts_phone' => $params['contacts_phone'] ?? '',
|
||||||
'create_user' => $params['create_user'],
|
'create_user' => $params['create_user'] ?? '',
|
||||||
'invoice_type' => $params['invoice_type'],
|
'invoice_type' => $params['invoice_type'] ?? 0,
|
||||||
'amount_including_tax' => $params['amount_including_tax'],
|
'amount_including_tax' => $params['amount_including_tax'] ?? 0,
|
||||||
'freight' => $params['freight'],
|
'freight' => $params['freight'] ?? 0,
|
||||||
'other_fee' => $params['other_fee'],
|
'other_fee' => $params['other_fee'] ?? 0,
|
||||||
'total_amount' => $params['total_amount'],
|
'total_amount' => $params['total_amount'] ?? 0,
|
||||||
'customer_require' => $params['customer_require'],
|
'customer_require' => $params['customer_require'] ?? '',
|
||||||
'remark' => $params['remark'],
|
'remark' => $params['remark'] ?? '',
|
||||||
'annex' => $params['annex']
|
'annex' => $params['annex'] ?? '',
|
||||||
]);
|
]);
|
||||||
foreach ($params['product'] as $item)
|
foreach ($params['product'] as $item)
|
||||||
{
|
{
|
||||||
@ -89,20 +89,20 @@ class QuotationLogic extends BaseLogic
|
|||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
try {
|
try {
|
||||||
Quotation::where('id', $params['id'])->update([
|
Quotation::where('id', $params['id'])->update([
|
||||||
'customer_id' => $params['customer_id'],
|
'customer_id' => $params['customer_id'] ?? 0,
|
||||||
'approve_id' => $params['approve_id'],
|
'approve_id' => $params['approve_id'] ?? 0,
|
||||||
'quotation_date' => $params['quotation_date'],
|
'quotation_date' => $params['quotation_date'] ?? '',
|
||||||
'contacts' => $params['contacts'],
|
'contacts' => $params['contacts'] ?? '',
|
||||||
'contacts_phone' => $params['contacts_phone'],
|
'contacts_phone' => $params['contacts_phone'] ?? '',
|
||||||
'create_user' => $params['create_user'],
|
'create_user' => $params['create_user'] ?? '',
|
||||||
'invoice_type' => $params['invoice_type'],
|
'invoice_type' => $params['invoice_type'] ?? 0,
|
||||||
'amount_including_tax' => $params['amount_including_tax'],
|
'amount_including_tax' => $params['amount_including_tax'] ?? 0,
|
||||||
'freight' => $params['freight'],
|
'freight' => $params['freight'] ?? 0,
|
||||||
'other_fee' => $params['other_fee'],
|
'other_fee' => $params['other_fee'] ?? 0,
|
||||||
'total_amount' => $params['total_amount'],
|
'total_amount' => $params['total_amount'] ?? 0,
|
||||||
'customer_require' => $params['customer_require'],
|
'customer_require' => $params['customer_require'] ?? '',
|
||||||
'remark' => $params['remark'],
|
'remark' => $params['remark'] ?? '',
|
||||||
'annex' => $params['annex']
|
'annex' => $params['annex'] ?? '',
|
||||||
]);
|
]);
|
||||||
QuotationDetail::where('quotation_id', $params['id'])->delete();
|
QuotationDetail::where('quotation_id', $params['id'])->delete();
|
||||||
foreach ($params['product'] as $item)
|
foreach ($params['product'] as $item)
|
||||||
|
@ -32,6 +32,7 @@ class CustomFollowValidate extends BaseValidate
|
|||||||
*/
|
*/
|
||||||
protected $rule = [
|
protected $rule = [
|
||||||
'id' => 'require',
|
'id' => 'require',
|
||||||
|
'custom_id' => 'require',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
@ -64,7 +65,7 @@ class CustomFollowValidate extends BaseValidate
|
|||||||
*/
|
*/
|
||||||
public function sceneEdit()
|
public function sceneEdit()
|
||||||
{
|
{
|
||||||
return $this->only(['id']);
|
return $this->only(['id', 'custom_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,6 +32,12 @@ class CustomServiceValidate extends BaseValidate
|
|||||||
*/
|
*/
|
||||||
protected $rule = [
|
protected $rule = [
|
||||||
'id' => 'require',
|
'id' => 'require',
|
||||||
|
'project_id' => 'require',
|
||||||
|
'custom_id' => 'require',
|
||||||
|
'approve_id' => 'require',
|
||||||
|
'receiver' => 'require',
|
||||||
|
'processed_admin_id' => 'require',
|
||||||
|
'name' => 'require',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,6 +32,8 @@ class QuotationValidate extends BaseValidate
|
|||||||
*/
|
*/
|
||||||
protected $rule = [
|
protected $rule = [
|
||||||
'id' => 'require',
|
'id' => 'require',
|
||||||
|
'customer_id' => 'require',
|
||||||
|
'approve_id' => 'require',
|
||||||
'product' => 'require|array|checkProduct',
|
'product' => 'require|array|checkProduct',
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -56,7 +58,6 @@ class QuotationValidate extends BaseValidate
|
|||||||
return $this->remove('id', true);
|
return $this->remove('id', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @notes 编辑场景
|
* @notes 编辑场景
|
||||||
* @return QuotationValidate
|
* @return QuotationValidate
|
||||||
@ -65,7 +66,7 @@ class QuotationValidate extends BaseValidate
|
|||||||
*/
|
*/
|
||||||
public function sceneEdit()
|
public function sceneEdit()
|
||||||
{
|
{
|
||||||
return $this->only(['id', 'product']);
|
return $this->only(['id', 'customer_id', 'approve_id', 'product']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,5 +30,10 @@ class CustomFollow extends BaseModel
|
|||||||
protected $name = 'custom_follow';
|
protected $name = 'custom_follow';
|
||||||
protected $deleteTime = 'delete_time';
|
protected $deleteTime = 'delete_time';
|
||||||
|
|
||||||
|
public function getDateAttr($value)
|
||||||
|
{
|
||||||
|
return empty($value) ? '' : date('Y-m-d H:i:s', $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -30,5 +30,9 @@ class CustomService extends BaseModel
|
|||||||
protected $name = 'custom_service';
|
protected $name = 'custom_service';
|
||||||
protected $deleteTime = 'delete_time';
|
protected $deleteTime = 'delete_time';
|
||||||
|
|
||||||
|
public function getDateAttr($value)
|
||||||
|
{
|
||||||
|
return empty($value) ? '' : date('Y-m-d H:i:s', $value);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user