Browse Source

申请开票接口优化 新增金额字段

master
wanghongjun 2 years ago
parent
commit
7aa19f22df
  1. 1
      app/controller/api/InvoiceIssuance.php
  2. 5
      app/validate/InvoiceIssuanceValidate.php

1
app/controller/api/InvoiceIssuance.php

@ -44,6 +44,7 @@ class InvoiceIssuance extends Base
$data['expire_time'] = strtotime($params['expire_time']);
$data['mobile'] = $params['mobile'];
$data['email'] = $params['email'];
$data['amount'] = $params['amount'];
//验证 、 新建抬头、获取抬头id
validate(InvoiceHeadValidate::class)->scene('type')->check($data);

5
app/validate/InvoiceIssuanceValidate.php

@ -16,6 +16,7 @@ class InvoiceIssuanceValidate extends Validate
'expire_time|到期时间' => 'require',
'mobile|手机号' => 'require|mobile',
'email|邮箱' => 'require|email',
'amount|开票金额' => 'require',
'id|发票编号' => 'require|number'
];
@ -35,8 +36,8 @@ class InvoiceIssuanceValidate extends Validate
* 验证场景.
*/
protected $scene = [
'add' => ['project_id', 'merge', 'pucode_id', 'expire_time', 'mobile', 'email'],
'edit' => ['project_id', 'merge', 'pucode_id', 'expire_time', 'mobile', 'email', 'id'],
'add' => ['project_id', 'merge', 'pucode_id', 'expire_time', 'mobile', 'email', 'amount'],
'edit' => ['project_id', 'merge', 'pucode_id', 'expire_time', 'mobile', 'email', 'amount', 'id'],
'delete' => ['id']
];

Loading…
Cancel
Save