|
|
|
@ -7,6 +7,7 @@ use app\model\InvoiceIssuance as InvoiceIssuanceModel; |
|
|
|
use app\util\ReturnCode; |
|
|
|
use app\validate\InvoiceHeadValidate; |
|
|
|
use app\validate\InvoiceIssuanceValidate; |
|
|
|
use think\facade\Db; |
|
|
|
|
|
|
|
class InvoiceIssuance extends Base |
|
|
|
{ |
|
|
|
@ -41,6 +42,7 @@ 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); |
|
|
|
@ -62,8 +64,10 @@ class InvoiceIssuance extends Base |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Db::commit(); |
|
|
|
return $this->buildSuccess(); |
|
|
|
} catch (\Exception $e) { |
|
|
|
Db::rollback(); |
|
|
|
return $this->buildFailed(ReturnCode::INVALID, $e->getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
|