Commit 6a7dbb70 authored by hujun's avatar hujun

审核逻辑判断

parent f4eaac50
......@@ -3664,7 +3664,7 @@ class Finance extends Basic
break;
}
$refund_where['is_del'] = 0;
$refund_where['is_del'] = $status = 0;
$refund_data = $m_refund->selectRefundByOrderNo('id,status,order_id', $refund_where);
if (empty($refund_data[0]['id'])) {
......@@ -3698,20 +3698,19 @@ class Finance extends Basic
$log_where['status'] = 1;
$check_num = $m_refund_log->getTotal($log_where);
if ($check_num < 3) {
$save_data['status'] = 1; //审核中
} else {
$save_data['status'] = 3; //已审核
if ($check_num == 3) {
$status = 3; //已审核
}
$save_data['status'] = 1;
$num = $m_refund_log->insertData($save_data);
break;
case 2 :
$log_where['status'] = ['in', '1,3'];
$log_where['status'] = 1;
$check_num = $m_refund_log->getTotal($log_where);
$id = 0;
if ($check_num == 4) {
$save_data['status'] = 2; //已审核
$id = $m_refund_log->insertData($save_data);
$save_data['status'] = $status = 2; //已审核
$num = $id = $m_refund_log->insertData($save_data);
}
if ($id > 0 && is_array($this->params['img_arr'])) {
$m_img = new OImg();
......@@ -3719,14 +3718,14 @@ class Finance extends Basic
}
break;
case 4 :
$save_data['status'] = 4;
$save_data['status'] = $status = 4;
$m_refund_log->updateData(['is_del'=>1, 'status'=>1], ['refund_id'=>$this->params['refund_id']]);
$num = $m_refund_log->insertData($save_data);
}
if ($num) {
if ($refund_data[0]['status'] != $save_data['status']) {
$m_refund->updateData(['status'=> $save_data['status']], ['id'=>$this->params['refund_id']]);
if ($status) {
$m_refund->updateData(['status'=> $status], ['id'=>$this->params['refund_id']]);
}
$code = 200;
} else {
......
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