update
This commit is contained in:
parent
5e24f88d76
commit
6c82588e34
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace app\adminapi\controller\zjzx_finance;
|
namespace app\adminapi\controller\zjzx_finance;
|
||||||
|
|
||||||
use app\adminapi\controller\BaseAdminController;
|
use app\adminapi\controller\BaseAdminController;
|
||||||
@ -71,9 +72,12 @@ class ZjzxInvoiceController extends BaseAdminController
|
|||||||
public function delete()
|
public function delete()
|
||||||
{
|
{
|
||||||
$params = (new ZjzxInvoiceValidate())->post()->goCheck('delete');
|
$params = (new ZjzxInvoiceValidate())->post()->goCheck('delete');
|
||||||
ZjzxInvoiceLogic::delete($params);
|
$result = ZjzxInvoiceLogic::delete($params);
|
||||||
|
if (true === $result) {
|
||||||
return $this->success('删除成功', [], 1, 1);
|
return $this->success('删除成功', [], 1, 1);
|
||||||
}
|
}
|
||||||
|
return $this->fail(ZjzxInvoiceLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -107,6 +107,11 @@
|
|||||||
*/
|
*/
|
||||||
public static function delete(array $params): bool
|
public static function delete(array $params): bool
|
||||||
{
|
{
|
||||||
|
$data = ZjzxRefund::where('invoice_id', 'in', $params['id'])->findOrEmpty();
|
||||||
|
if (!$data->isEmpty()) {
|
||||||
|
self::setError('此数据关联了到账台账信息');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return ZjzxInvoice::destroy($params['id']);
|
return ZjzxInvoice::destroy($params['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user