Commit e0388a11 authored by zhuwei's avatar zhuwei

bug

parent 1c55606c
......@@ -28,7 +28,7 @@ class PerformanceInfo extends Basic
*/
public function performanceInfo() {
if ($this->request->isAjax()) {
if (!$this->request->isAjax()) {
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
......@@ -88,9 +88,10 @@ class PerformanceInfo extends Basic
$field .= 'Houses.landmark,';
$field .= 'Oorder.house_id';
$return = $this->oBargainModel->performancelInfo($where,$field,$pageSize,$pageNo);
$return_total = $this->oBargainModel->performancelInfoTotal($where,$field);
$field = 'sum(Obargain.scale_fee) as scale_fee_sum';
$return_sum = $this->oBargainModel->performancelInfo($where,$field,$pageSize,$pageNo);
return $this->response(200, '', ['scale_fee_sum'=>$return_sum[0]['scale_fee_sum'],'data'=>$return]);
return $this->response(200, '', ['scale_fee_sum'=>$return_sum[0]['scale_fee_sum'],'data'=>$return,'total'=>$return_total]);
} else {
return view('performanceInfo');
}
......
......@@ -1249,4 +1249,20 @@ class OBargainModel extends Model
// echo $this->db_->getLastSql();
return $result;
}
public function performancelInfoTotal($where,$filed){
$result = $this->db_
->field($filed)
->alias("Obargain")
->join("o_report Oreport", "Obargain.report_id = Oreport.id", "left")
->join("o_order Oorder", "Obargain.order_id = Oorder.id", "left")
->join("g_houses Houses", "Oorder.house_id = Houses.id", "left")
->join("a_agents Agent", "Obargain.agent_id = Agent.id", "left")
->join('a_store Store', 'Agent.store_id = Store.id', 'left')
->join('a_district District', 'Agent.district_id = District.id', 'left')
->where($where)
->count();
// echo $this->db_->getLastSql();
return $result;
}
}
\ No newline at end of file
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