Commit ae4f7f04 authored by hujun's avatar hujun

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

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