Commit aac5e26f authored by hujun's avatar hujun

判断

parent be085a00
......@@ -3668,7 +3668,7 @@ class Finance extends Basic
$refund_data = $m_refund->selectRefundByOrderNo('id,status,order_id', $refund_where);
if (empty($refund_data[0]['id'])) {
return $this->response($code, '没有该退款详情');
return $this->response($code, '没有该退款详情或审核完成');
}
if (($refund_data[0]['status'] == 4) && ($this->params['status'] == 4)) {
......@@ -3691,6 +3691,7 @@ class Finance extends Basic
$save_data['operation_name'] = $this->userName;
$save_data['order_id'] = $refund_data[0]['order_id'];
$log_where['is_del'] = 0;
$log_where['refund_id'] = $this->params['refund_id'];
$num = 0;
switch ($this->params['status']) {
case 1 :
......@@ -3705,20 +3706,22 @@ class Finance extends Basic
$num = $m_refund_log->insertData($save_data);
break;
case 2 :
$log_where['status'] = ['in', '1,3'];
$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);
}
if ($id > 0 && is_array($this->params['img_arr'])) {
$m_img = new OImg();
$m_img->addImgAll($id, 4, $this->params['img_arr']);
}
break;
case 4 :
$check_num = $m_refund_log->getTotal($log_where);
if ($check_num == 4) {
$save_data['status'] = 4;
$num = $m_refund_log->insertData($save_data);
}
}
if ($num) {
......
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