提交 38e2ce65 authored 作者: chengye's avatar chengye

test

上级 bd1ed3cb
......@@ -29,7 +29,7 @@ class Payment
Log::record(date('Y-m-d H:i:s').' OA单号:'.$data['numb'].' 接口操作:单据状态更新');
return $this->update($data['numb'],$data['status'],$data['mes']);
} else {
return $this->dropNumb($data['numb']);
return $this->dropNumb($data['numb'],$data['status']);
}
}
......@@ -52,22 +52,14 @@ class Payment
}
//作废单据
private function dropNumb($numb)
private function dropNumb($numb,$status)
{
try {
$paymentFk = (new EmPaymentFk())->get(['oafk_numb' => $numb]);
$payment = (new PaymentModel())->get(['payment_id' => $paymentFk->payment_id]);
} catch (\Exception $e) {
return json([
'code' => 200,
'message' => '单号异常,或已经作废',
'data' => ''
]);
}
$paymentFk->delete();
$paymentFk = (new EmPaymentFk())->get(['oafk_numb' => $numb]);
$payment = (new PaymentModel())->get(['payment_id' => $paymentFk->payment_id]);
$payment->status = 9;
$paymentFk->delete();
$payment->status = $status;
$payment->save();
//删除payment_invoice表
......@@ -96,14 +88,4 @@ class Payment
return substr_replace($statusCode, $value, $index, 1);
}
public function test()
{
$account_id = 'ZH2020071609062';
$payment_id = 'JF2020071634700';
$res = (new WriteOff())->writeOffFromPayment($account_id, $payment_id);
return $res;
}
}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论