update
This commit is contained in:
parent
4a45ea83ef
commit
3fdce4ef4c
@ -120,4 +120,29 @@
|
||||
})->toArray();
|
||||
return $this->data($data);
|
||||
}
|
||||
|
||||
public function fdz(){
|
||||
$params = $this->request->post(['invoice_id']);
|
||||
if(empty($params['invoice_id'])){
|
||||
return $this->fail('参数错误');
|
||||
}
|
||||
$invoice = Db::name('oa_invoice')->where('id',$params['invoice_id'])->find();
|
||||
if(empty($invoice)){
|
||||
return $this->fail('开票信息不存在');
|
||||
}
|
||||
Db::startTrans();
|
||||
try {
|
||||
Db::name('oa_invoice_income')->where('inid',$params['invoice_id'])->delete();
|
||||
Db::name('oa_invoice')->where('id',$params['invoice_id'])->update([
|
||||
'enter_amount' => 0,
|
||||
'enter_time' => 0,
|
||||
'is_cash' => 0
|
||||
]);
|
||||
Db::commit();
|
||||
return $this->success('ok');
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
return $this->fail();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user