Commit 9f3c88bc authored by hujun's avatar hujun

删除收款 查询退款

parent 7986e4f3
......@@ -3557,6 +3557,11 @@ class Finance extends Basic
return $this->response($code, '存在调整,不能删除');
}
$m_refund = new ORefundModel();
$refund_id = $m_refund->getFind('id', ['pay_log_id'=>$this->params['pay_id']]);
if ($refund_id > 0) {
return $this->response($code, '存在退款,不能删除');
}
$num = $m_pay->updatePayLog(['is_del'=>1, 'id'=>$this->params['pay_id']]);
if ($num > 0) {
$m_pay_adjustment->updatePayLogAdjustment(['is_del'=>1,'id'=>$adjustment_num[0]['id']]);
......
......@@ -301,4 +301,18 @@ class ORefundModel extends Model{
->where($where)
->sum($field);
}
/**
* @param $field
* @param $where
* @return array|false|\PDOStatement|string|Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getFind($field, $where) {
return $this->db_->field($field)
->where($where)
->find();
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment