Commit ca217be1 authored by hujun's avatar hujun

退款详情

parent de285db4
......@@ -18,6 +18,7 @@ use app\model\OfficeOImg;
use app\model\OfficeOPayLogAdjustment;
use app\model\OfficeOPayLogModel;
use app\model\OfficeOrderModel;
use app\model\OfficeORefundLogModel;
use app\model\OfficeORefundModel;
use app\model\OfficeOReportModel;
use app\model\OfficeOTaxes;
......@@ -2107,4 +2108,64 @@ class OfficePayLog extends Basic
$export->exportTable('退款审核明细表', $excel_data, 11, '退款审核明细表 (退款总计:'.$total_money.')', $title);
return '';
}
/**
* 退款详情
*
* @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 OfficeORefundModel();
$m_refund_log = new OfficeORefundLogModel();
$m_pay_log = new OfficeOPayLogModel();
$m_img = new OfficeOImg();
$field = 'id,refund_money,receipt_number,type,refund_cause,refund_way,card_no,bank,name,phone,agent_id,status,pay_log_id,create_time';
$refund_data = $m_refund->selectRefundByOrderNo($field, ['id'=>$this->params['refund_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_field = 'a.income_time,d.address,a.create_time,a.order_id,b.house_id';
$pay_data = $m_pay_log->getOrderHouse($pay_field, ['a.id'=>$data['pay_log_id']]);
$data['address'] = $pay_data[0]['address'] ? $pay_data[0]['address'] : '';
$data['income_time'] = $pay_data[0]['income_time'];
$data['pay_create_time'] = $pay_data[0]['create_time'];
$data['order_id'] = $pay_data[0]['order_id'];
$data['house_id'] = $pay_data[0]['house_id'];
} else {
$data['address'] = '';
$data['income_time'] = '';
}
$img_where['img_id'] = $this->params['refund_id'];
$img_where['img_type'] = 3;
$img_where['img_status'] = 1;
$data['img'] = $m_img->getImgList($img_where);
$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);
}
}
\ No newline at end of file
......@@ -543,7 +543,8 @@ class OfficeOPayLogModel extends Model
return $this->db_->alias('a')
->field($field)
->join('o_order b', 'a.order_id=b.id', 'left')
->join('g_houses c', 'b.house_id=c.id', 'left')
->join('office_g_room c', 'b.house_id=c.id', 'left')
->join('office_g_building d', 'c.building_id=d.id', 'left')
->where($where)
->select();
}
......
<?php
/**
* Created by PhpStorm.
* User: 43897
* Date: 2018/12/25
* Time: 13:54
*/
namespace app\model;
use think\Db;
class OfficeORefundLogModel extends BaseModel
{
protected $table = "office_o_refund_log";
private $db_;
public function __construct($data = [])
{
parent::__construct($data);
$this->db_=Db::name($this->table);
}
/**
* @param $data
* @return int|string
*/
public function insertData($data) {
return $this->db_->insertGetId($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
......@@ -1060,6 +1060,7 @@ Route::group('office_index', [
'deleteReceiptImg' => ['index/officePayLog/deleteReceiptImg', ['method' => 'post|get']],//删除收款图片
'getPayLogData' => ['index/officePayLog/getPayLogData', ['method' => 'GET']], //收款各种详情
'adjustmentList' => ['index/officePayLog/adjustmentList', ['method' => 'GET']], //调整列表
'refundDetail' => ['index/officePayLog/refundDetail', ['method' => 'GET']], //退款详情
'inspectionRecordOur/:check_status' => ['index/OfficeReport/inspectionRecordAll', ['method' => 'GET'], ['check_status' => 0]], //我的约带看
'inspectionRecordStore/:check_status' => ['index/OfficeReport/inspectionRecordAll', ['method' => 'GET'], ['check_status' => 1]], //门店约带看
......
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