diff --git a/app/controller/api/InvoiceIssuance.php b/app/controller/api/InvoiceIssuance.php index 812430e..90b6554 100644 --- a/app/controller/api/InvoiceIssuance.php +++ b/app/controller/api/InvoiceIssuance.php @@ -33,6 +33,9 @@ class InvoiceIssuance extends Base if ($id) { $where[] = ['id', '!=', $id]; } + + Db::startTrans(); + $query_id = InvoiceIssuanceModel::where($data)->where($where)->value('id'); if ($query_id) { throw new \Exception('当前开票项目已申请开票'); @@ -42,7 +45,6 @@ class InvoiceIssuance extends Base $data['mobile'] = $params['mobile']; $data['email'] = $params['email']; - Db::startTrans(); //验证 、 新建抬头、获取抬头id validate(InvoiceHeadValidate::class)->scene('type')->check($data); validate(InvoiceHeadValidate::class)->scene('type'.$data['type'])->check($data);