|
@@ -46,7 +46,9 @@ class PayInvoice extends Base
|
|
|
if ($model->invType==4){
|
|
|
$ticket= InvoiceInfo::where("payNo",$model->payNo)->findOrEmpty();
|
|
|
if (!$ticket->isEmpty() && !empty($ticket->item_list)){
|
|
|
- (new InvoiceItem)->saveAll(array_map(function ($item)use($model) {
|
|
|
+ $bool = true;
|
|
|
+ (new InvoiceItem)->saveAll(array_map(function ($item)use($model,&$bool) {
|
|
|
+ if($item['amount']<0) $bool=false;
|
|
|
return [
|
|
|
'invoiceCode'=>$model->hpNo,
|
|
|
'order_type'=>2,
|
|
@@ -65,6 +67,10 @@ class PayInvoice extends Base
|
|
|
|
|
|
$ticket->hpNo= $model->hpNo;
|
|
|
$ticket->save();
|
|
|
+ if($bool==false){
|
|
|
+ $model->status=14;
|
|
|
+ $model->save();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|