Commit ae4f7f04 authored by hujun's avatar hujun

修改财务-成交报告返回值

parent f38b4140
...@@ -128,7 +128,7 @@ class Finance extends Basic ...@@ -128,7 +128,7 @@ class Finance extends Basic
$bargain = new OBargainModel(); $bargain = new OBargainModel();
$data['data']['list'] = $bargain->getBargain($pageNo, $pageSize, $order, $fields, $where); $data['data']['list'] = $bargain->getBargain($pageNo, $pageSize, $order, $fields, $where);
$data['data']['total'] = $bargain->getBargainTotal($where); $data['data']['total'] = $bargain->getBargainTotal($where);
$data['data']['step'] = $this->params['check_status'];
return $this->response($data['code'], $data['msg'], $data['data']); return $this->response($data['code'], $data['msg'], $data['data']);
} }
...@@ -613,7 +613,7 @@ class Finance extends Basic ...@@ -613,7 +613,7 @@ class Finance extends Basic
} }
$m_fee = new OTaxes(); $m_fee = new OTaxes();
$field = 'a.id,a.total_fee,a.operation_date'; $field = 'a.id,a.total_fee,a.operation_date';
$data = $m_fee->getBargainFeeDetail($this->params['bargain_id'], 1, $field); $data = $m_fee->getBargainFeeDetail($this->params['bargain_id'], $field);
return $this->response("200", "request success", $data); return $this->response("200", "request success", $data);
} }
...@@ -753,7 +753,7 @@ class Finance extends Basic ...@@ -753,7 +753,7 @@ class Finance extends Basic
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize']; $pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
$fields = 'a.id,a.agent_id,sum(b.fee) as fee,sum(c.practical_fee) as practical_fee,sum(c.cash) as cash,'; $fields = 'a.id,a.agent_id,sum(b.fee) as fee,sum(c.practical_fee) as practical_fee,sum(c.cash) as cash,';
$fields .= 'sum(c.service_charge) as service_charge,sum(c.tallage) as tallage,sum(c.real_fee) as real_fee,'; $fields .= 'sum(c.service_charge) as service_charge,sum(b.fee) as fee,sum(c.real_fee) as real_fee,';
$fields .= 'd.name,d.phone'; $fields .= 'd.name,d.phone';
$where['c.is_del'] = 0; //订单状态 $where['c.is_del'] = 0; //订单状态
...@@ -803,12 +803,12 @@ class Finance extends Basic ...@@ -803,12 +803,12 @@ class Finance extends Basic
} }
if (isset($where_fee['operation_date'])) { if (isset($where_fee['operation_date'])) {
$m_fee = new OTaxes(); // $m_fee = new OTaxes();
$where_fee['type'] = 1; // $where_fee['type'] = 1;
$bargain_id = $m_fee->getFeeListColumn('bargain_id', $where_fee); // $bargain_id = $m_fee->getFeeListColumn('bargain_id', $where_fee);
if (!empty($bargain_id)) { // if (!empty($bargain_id)) {
$whereOr['a.id'] = implode(',',$bargain_id); // $whereOr['a.id'] = implode(',',$bargain_id);
} // }
} }
/**开票日期 end**/ /**开票日期 end**/
......
...@@ -636,7 +636,7 @@ class OBargainModel extends Model ...@@ -636,7 +636,7 @@ class OBargainModel extends Model
$data[$k]['district_store'] = $district_store['district_name'] .'-'. $district_store['store_name']; $data[$k]['district_store'] = $district_store['district_name'] .'-'. $district_store['store_name'];
} }
$data[$k]['tax_fee'] = $m_fee->where(['bargain_id'=>$v['id'], 'type'=>1])->sum('fee'); $data[$k]['tax_fee'] = $m_fee->where('bargain_id', $v['id'])->sum('fee');
} }
return $data; return $data;
......
...@@ -73,19 +73,17 @@ class OTaxes extends BaseModel ...@@ -73,19 +73,17 @@ class OTaxes extends BaseModel
* 根据成交报告-实收佣金 或 税费开票 查询详情 * 根据成交报告-实收佣金 或 税费开票 查询详情
* *
* @param int $bargain_id * @param int $bargain_id
* @param int $type
* @param string $field * @param string $field
* @return array * @return array
* @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException * @throws \think\exception\DbException
*/ */
public function getBargainFeeDetail(int $bargain_id, int $type = 0, string $field) { public function getBargainFeeDetail(int $bargain_id, string $field) {
$data = $this->field($field) $data = $this->field($field)
->alias('a') ->alias('a')
->join('o_bargain b', 'a.bargain_id = b.id', 'left') ->join('o_bargain b', 'a.bargain_id = b.id', 'left')
->where('bargain_id', $bargain_id) ->where('bargain_id', $bargain_id)
->where('type', $type)
->where('a.father_id', 0) ->where('a.father_id', 0)
->select(); ->select();
......
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