update
This commit is contained in:
parent
5e24f88d76
commit
6c82588e34
@ -1,19 +1,20 @@
|
||||
<?php
|
||||
namespace app\adminapi\controller\zjzx_finance;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\zjzx_finance\ZjzxInvoiceLists;
|
||||
use app\adminapi\logic\zjzx_finance\ZjzxInvoiceLogic;
|
||||
use app\adminapi\validate\zjzx_finance\ZjzxInvoiceValidate;
|
||||
namespace app\adminapi\controller\zjzx_finance;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\zjzx_finance\ZjzxInvoiceLists;
|
||||
use app\adminapi\logic\zjzx_finance\ZjzxInvoiceLogic;
|
||||
use app\adminapi\validate\zjzx_finance\ZjzxInvoiceValidate;
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* 造价咨询--开票台账控制器
|
||||
* Class ZjzxInvoiceController
|
||||
* @package app\adminapi\controller\zjzx_finance
|
||||
*/
|
||||
class ZjzxInvoiceController extends BaseAdminController
|
||||
{
|
||||
class ZjzxInvoiceController extends BaseAdminController
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
@ -71,9 +72,12 @@ class ZjzxInvoiceController extends BaseAdminController
|
||||
public function delete()
|
||||
{
|
||||
$params = (new ZjzxInvoiceValidate())->post()->goCheck('delete');
|
||||
ZjzxInvoiceLogic::delete($params);
|
||||
$result = ZjzxInvoiceLogic::delete($params);
|
||||
if (true === $result) {
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(ZjzxInvoiceLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@ -93,4 +97,4 @@ class ZjzxInvoiceController extends BaseAdminController
|
||||
{
|
||||
return $this->data(ZjzxInvoiceLogic::datas());
|
||||
}
|
||||
}
|
||||
}
|
@ -107,6 +107,11 @@
|
||||
*/
|
||||
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']);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user