Browse Source

失败后编辑修改为申请中 再次发起

master
wanghongjun 12 months ago
parent
commit
fc26caadeb
  1. 4
      app/controller/api/InvoiceIssuance.php
  2. 2
      app/controller/task/InvoiceIssuanceTask.php

4
app/controller/api/InvoiceIssuance.php

@ -166,6 +166,10 @@ class InvoiceIssuance extends Base
if ($id) {
validate(InvoiceIssuanceValidate::class)->scene('edit')->check($params);
$data['update_time'] = time();
$status = (new InvoiceIssuanceModel())->where('id', $id)->value('status');
if ($status == 2) {
$data['status'] = 1;
}
(new InvoiceIssuanceModel())->update($data, ['id' => $id]);
} else {

2
app/controller/task/InvoiceIssuanceTask.php

@ -37,7 +37,7 @@ class InvoiceIssuanceTask extends Base
public function runCancelInitiateAgain()
{
$limit = 100;
$where = ['status' => 2, 'delete_time' => 0];
$where = ['status' => 1, 'delete_time' => 0];
$InvoiceIssuanceData = (new InvoiceIssuanceModel())->where($where)->page(1, $limit)->select();
foreach ($InvoiceIssuanceData as $InvoiceIssuanceValue) {
(new InvoiceIssuanceService())->cancelInitiateAgain($InvoiceIssuanceValue);

Loading…
Cancel
Save