更新开票及状态处理

This commit is contained in:
yaooo 2023-11-04 11:17:50 +08:00
parent 650f764617
commit 2c6877f293
1 changed files with 2 additions and 6 deletions

View File

@ -12,6 +12,7 @@ namespace app\api\controller;
use app\api\ApiController;
use app\api\middleware\Auth;
use app\finance\model\Invoice as InvoiceList;
use app\finance\model\InvoiceIncome;
use app\finance\validate\InvoiceCheck;
use think\exception\ValidateException;
use think\facade\Db;
@ -494,9 +495,7 @@ class FinanceInvoice extends ApiController
if (empty($param['id'])) {
$this->apiError("id不能为空");
}
if (empty($param['check_status'])) {
$this->apiError("发票状态不能为空");
}
$param['check_status'] = 10;
if ($param['check_status'] == 10) {
$count = InvoiceIncome::where(['inid'=>$param['id'],'status'=>1])->count();
if($count>0){
@ -526,9 +525,6 @@ class FinanceInvoice extends ApiController
}
if (empty($param['id'])) {
$this->apiError("id不能为空");
}
if (empty($param['check_status'])) {
$this->apiError("发票状态不能为空");
}
$param['check_status'] = 5;
$param['update_time'] = time();