Commit 940a20f1 authored by hujun's avatar hujun

退款详情

parent 1511a9f4
......@@ -3593,6 +3593,15 @@ class Finance extends Basic
if (($refund_data[0]['status'] == 4) && ($this->params['status'] == 4)) {
return $this->response($code, '该退款已驳回');
}
if (($refund_data[0]['status'] == 3) && ($this->params['status'] == 3)) {
return $this->response($code, '该退款已审核');
}
if (($refund_data[0]['status'] == 2) && ($this->params['status'] == 2)) {
return $this->response($code, '已退款');
}
$m_refund_log = new ORefundLogModel();
$save_data['refund_id'] = $this->params['refund_id'];
......@@ -3632,4 +3641,54 @@ class Finance extends Basic
return $this->response($code, $msg);
}
/**
* 退款详情
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function refundDetail() {
if (empty($this->params['refund_id'])) {
return $this->response(101, '参数错误');
}
$code = 200;
$msg = '';
$m_refund = new ORefundModel();
$m_refund_log = new ORefundLogModel();
$m_pay_log = new OPayLogModel();
$field = 'id,refund_money,receipt_number,type,refund_cause,refund_way,card_no,bank,name,phone,agent_id,status,pay_log_id';
$refund_data = $m_refund->selectRefundByOrderNo($field, ['id'=>$this->params['id'], 'is_del'=>0]);
if (empty($refund_data[0])) {
return $this->response(101, '退款信息错误');
}
$data = $refund_data[0];
if ($data['agent_id']) {
$m_store = new AAgents();
$store_name = $m_store->getAgentsStoreById(['a.id'=>$data['agent_id']], 'a.name,b.store_name');
$data['store_name'] = $store_name['store_name'];
$data['agent_name'] = $store_name['name'];
} else {
$data['store_name'] = '';
$data['agent_name'] = '';
}
if ($data['pay_log_id']) {
$pay_data = $m_pay_log->getOrderHouse('a.income_time,c.internal_address as address', ['a.id'=>$data['pay_log_id']]);
$data['address'] = $pay_data[0]['address'];
$data['income_time'] = $pay_data[0]['income_time'];
} else {
$data['address'] = '';
$data['income_time'] = '';
}
$data['log'] = $m_refund_log->getListAll('operation_name,create_time,status', ['refund_id'=>$this->params['refund_id'], 'is_del'=>0]);
return $this->response($code, $msg, $data);
}
}
......@@ -22,11 +22,36 @@ class ORefundLogModel extends BaseModel
$this->db_=Db::name($this->table);
}
/**
* @param $data
* @return int|string
*/
public function insertData($data) {
return $this->db_->insert($data);
}
/**
* @param $data
* @param $where
* @return int|string
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function updateData($data, $where) {
return $this->db_->where($where)->update($data);
}
/**
* @param $field
* @param $where
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getListAll($field, $where) {
return $this->field($field)
->where($where)
->select();
}
}
\ No newline at end of file
......@@ -281,6 +281,7 @@ Route::group('index', [
'delPayLog' => ['index/Finance/delPayLog', ['method' => 'POST']],//删除收款
'refundPayLog' => ['index/Finance/refundPayLog', ['method' => 'POST']],//退款
'checkRefund' => ['index/Finance/checkRefund', ['method' => 'POST']],//退款审核
'refundDetail' => ['index/Finance/refundDetail', ['method' => 'GET']],//退款详情
'performanceInfo' => ['index/PerformanceInfo/performanceInfo', ['method' => 'post|get']],//业绩明细
'getPerformanceInfoExcel' => ['index/PerformanceInfo/getPerformanceInfoExcel', ['method' => 'post|get']],//业绩明细
......
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