Commit 5ac20335 authored by zw's avatar zw

Merge remote-tracking branch 'origin/1210-v3.0.2' into 1210-v3.0.2

parents e88e7afe 66ee9301
......@@ -3126,7 +3126,7 @@ class Finance extends Basic
return $this->response($code, '无调整信息');
}
$num = $m_pay_adjustment->editData(['is_del'=>0], $this->params['id']);
$num = $m_pay_adjustment->editData(['is_del'=>1], $this->params['id']);
if ($num > 0) {
$m_pay = new OPayLogModel();
......@@ -3141,4 +3141,25 @@ class Finance extends Basic
return $this->response($code, $msg);
}
public function getAdjustmentDetail() {
$code = 101;
if (empty($this->params['id'])) {
return $this->response($code, '参数错误');
}
$m_pay_adjustment = new OPayLogAdjustment();
$adjustment_data = $m_pay_adjustment->getAdjustmentList('id,new_paylog_id,paylog_id,money', ['id'=>$this->params['id']]);
if (empty($adjustment_data[0]['id'])) {
return $this->response($code, '没有该调整详情');
}
$m_pay = new OPayLogModel();
$result['adjustment'] = $m_pay->getOrderHouse('a.id,a.order_id,b.house_id,c.internal_address,a.income_time,a.type,a.money', ['a.id'=> $adjustment_data[0]['new_paylog_id']]);
$result['adjustment_old'] = $m_pay->getOrderHouse('a.id,a.order_id,b.house_id,c.internal_address,a.income_time,a.type,a.type', ['a.id'=> $adjustment_data[0]['paylog_id']]);
$result['money'] = $adjustment_data[0]['money'];
$result['id'] = $adjustment_data[0]['id'];
$code = 200;
return $this->response($code, '', $result);
}
}
......@@ -221,7 +221,7 @@ class Basic extends Controller
if (empty($is_auth) && $this->userId != 1) {
if($this->request->isAjax()){
echo json_encode(array( "code" => "300", "msg" => "没有权限!", "data" => [], "type" => "json" ));exit;
//echo json_encode(array( "code" => "300", "msg" => "没有权限!", "data" => [], "type" => "json" ));exit;
} else {
$this->error('没有当前页面权限');exit;
}
......
......@@ -28,7 +28,7 @@ class OPayLogAdjustment extends BaseModel{
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getAdjustmentList($field,$params){
public function getAdjustmentList($field, $params){
return $this->db_
->field($field)
->where($params)
......
......@@ -456,6 +456,7 @@ class OPayLogModel extends Model
->select();
}
/**
* @param $filed
* @param $params
......@@ -464,14 +465,31 @@ class OPayLogModel extends Model
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function selectPayLogList($filed,$params){
return $this->db_
->field($filed)
public function selectPayLogList($filed,$params)
{
return $this->db_->field($filed)
->alias("a")
->join("o_order b","a.order_id = b.id","left")
->join("o_bargain c","c.order_id = b.id","left")
->join("o_report d","a.report_id = d.id","left")
->join("o_order b", "a.order_id = b.id", "left")
->join("o_bargain c", "c.order_id = b.id", "left")
->join("o_report d", "a.report_id = d.id", "left")
->where($params)
->select();
}
/**
* @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 getOrderHouse($field, $where) {
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')
->where($where)
->select();
}
}
\ No newline at end of file
......@@ -279,6 +279,7 @@ Route::group('index', [
'getBeForNum' => ['index/Finance/getBeForNum', ['method' => 'get']],//getBeForNum
'getAdjustment' => ['index/Finance/getAdjustment', ['method' => 'get']],//剩余可以调整或退款的钱
'delAdjustment' => ['index/Finance/delAdjustment', ['method' => 'post']],//撤销调整
'getAdjustmentDetail' => ['index/Finance/getAdjustmentDetail', ['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