Commit e9d5cb4f authored by hujun's avatar hujun

已退款

parent 141fcd4b
......@@ -144,7 +144,8 @@ class Finance extends Basic
$data['data'] = [];
$bargain = new OBargainModel();
if (empty($this->params['id']) || empty($this->params['source']) || $this->params['status']) {
if (empty($this->params['id']) || empty($this->params['source']) || empty($this->params['status'])) {
$data['code'] = 101;
$data['msg'] = 'Id is null';
} else {
......@@ -412,9 +413,12 @@ class Finance extends Basic
}
/**
* 退款列表和已退款列表
* 退款列表
*
* @return \think\response\View
* @return \think\Response|\think\response\View
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function refundList() {
......@@ -422,8 +426,41 @@ class Finance extends Basic
return view('refundList');
}
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
$refund = new ORefundModel();
$field = '';
$where = [];
$data['data']['list'] = $refund->selectRefundByOrderNoPage($pageNo, $pageSize, 'id desc', $field, $where);
$data['data']['total'] = $refund->selectRefundByOrderNoPageTotal($where);
return $this->response("200", "request success", $data);
}
/**
* 已退款列表
*
* @return \think\Response|\think\response\View
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function refundOrderList() {
if (!$this->request->isAjax()) {
return view('refund_order_list');
}
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
$refund = new ORefundModel();
$field = 'a.id,a.agent_name,a.name,a.bank,a.card_no,a.create_time,a.refund_money,b.report_agent_name';
$where = [];
$refund->selectRefundByOrderNo();
$data['data']['list'] = $refund->selectRefundByOrderNoPage($pageNo, $pageSize, 'id desc', $field, $where);
$data['data']['total'] = $refund->selectRefundByOrderNoPageTotal($where);
return $this->response("200", "request success", $data);
}
}
\ No newline at end of file
{layout name="global/frame_tpl" /}
已退款列表
\ No newline at end of file
......@@ -109,6 +109,60 @@ class ORefundModel extends Model{
->select();
}
/**
* 查询退款记录带分页
*
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param string $field
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function selectRefundByOrderNoPage($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field = '', $params = '')
{
$where_ = [];
if (isset($params["report_id"])) {
$where_["report_id"] = $params["report_id"];
}
if (isset($params["order_no"])) {
$where_["order_no"] = $params["order_no"];
}
if (isset($params["order_id"])) {
$where_["order_id"] = $params["order_id"];
}
if (isset($params["agent_id"])) {
$where_["agent_id"] = $params["agent_id"];
}
return $this->db_
->field($field)
->alias('a')
->join('o_report b', 'a.report_id = b.id', 'left')
->where($params)
->limit($pageSize)
->page($pageNo)
->order($order_)
->select();
}
/**
* 查询退款记录带分页总数
*
* @param $params
* @return int|string
*/
public function selectRefundByOrderNoPageTotal($params) {
return $this->db_
->alias('a')
->join('o_report b', 'a.report_id = b.id', 'left')
->where($params)
->count();
}
public function getRefundByOrderId($field,$params){
$where_ = [];
if(isset($params["order_id"])){
......
......@@ -191,8 +191,11 @@ Route::group('index', [
'reportListStatement/:check_status' => ['index/Finance/reportList', [ 'method' => 'get' ] ,['check_status'=>4]], //财务 成交报告-已结单
'reportListBackout/:check_status' => ['index/Finance/reportList', [ 'method' => 'get' ] ,['check_status'=>5]], //财务 成交报告-待撤销
'reportListUndone/:check_status' => ['index/Finance/reportList', [ 'method' => 'get' ] ,['check_status'=>6]], //财务 成交报告-已撤销
'refundList/:status' => ['index/Finance/refundList', [ 'method' => 'get|post' ], ['status'=>1] ], //财务 退款
'refundedList/:status' => ['index/Finance/refundList', [ 'method' => 'get|post' ], ['status'=>2] ], //财务 已退款
'refundListAttache/:status' => ['index/Finance/refundList', [ 'method' => 'get|post' ], ['status'=>0] ], //退款列表-专员审核
'refundListManager/:status' => ['index/Finance/refundList', [ 'method' => 'get|post' ], ['status'=>1] ], //退款列表-财务经理
'refundListMajordomo/:status' => ['index/Finance/refundList', [ 'method' => 'get|post' ], ['status'=>2] ], //财务 退款
'refundListCashier/:status' => ['index/Finance/refundList', [ 'method' => 'get|post' ], ['status'=>3] ], //财务 退款
'refundOrderList' => ['index/Finance/refundOrderList', [ 'method' => 'get' ]], //财务 已退款
'checkReportAttache/:check_status' => ['index/Finance/checkReport', [ 'method' => 'post' ], ['check_status'=>0]], //审核成交报告-专员审核
'checkReportManager/:check_status' => ['index/Finance/checkReport', [ 'method' => 'post' ], ['check_status'=>1]], //审核成交报告-经理审核
'checkReportMajordomo/:check_status' => ['index/Finance/checkReport', [ 'method' => 'post' ], ['check_status'=>2]], //审核成交报告-总监审核
......
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