Commit dd4b8b77 authored by zw's avatar zw

日报周报 bug

parent 204f8e5c
...@@ -5,6 +5,7 @@ namespace app\api_broker\service; ...@@ -5,6 +5,7 @@ namespace app\api_broker\service;
use app\model\AAgents; use app\model\AAgents;
use app\model\FollowUpLogModel; use app\model\FollowUpLogModel;
use app\model\GHouses; use app\model\GHouses;
use app\model\OReportModel;
use app\model\Users; use app\model\Users;
/** /**
...@@ -21,6 +22,7 @@ class StatementService ...@@ -21,6 +22,7 @@ class StatementService
private $houseModel; private $houseModel;
private $userModel; private $userModel;
private $followUpModel; private $followUpModel;
private $reportModel;
const USER_LEVEL_FIST = 0; //经纪人 const USER_LEVEL_FIST = 0; //经纪人
const USER_LEVEL_SECOND = 1; //店长 const USER_LEVEL_SECOND = 1; //店长
...@@ -32,6 +34,7 @@ class StatementService ...@@ -32,6 +34,7 @@ class StatementService
$this->houseModel = new GHouses(); $this->houseModel = new GHouses();
$this->userModel = new Users(); $this->userModel = new Users();
$this->followUpModel = new FollowUpLogModel(); $this->followUpModel = new FollowUpLogModel();
$this->reportModel = new OReportModel();
} }
/** /**
...@@ -127,7 +130,8 @@ class StatementService ...@@ -127,7 +130,8 @@ class StatementService
$result["agent_total"] = $agent_total; $result["agent_total"] = $agent_total;
$result["house_num"] = $this->houseModel->getAddHouseNumByAgentId($conditions); $result["house_num"] = $this->houseModel->getAddHouseNumByAgentId($conditions);
$result["user_num"] = $this->userModel->getAddUserNumByAgentId($conditions); $result["user_num"] = $this->userModel->getAddUserNumByAgentId($conditions);
$result["follow_up_num"] = $this->followUpModel->getAddFollowUpNumByAgentId($conditions); //$result["follow_up_num"] = $this->followUpModel->getAddFollowUpNumByAgentId($conditions);
$result["follow_up_num"] = $this->reportModel->getAddFollowUpNumByAgentId($conditions);
//todo //todo
$result["store_list"] = $store_list; $result["store_list"] = $store_list;
......
...@@ -448,4 +448,22 @@ class OReportModel extends Model ...@@ -448,4 +448,22 @@ class OReportModel extends Model
->where($params) ->where($params)
->select(); ->select();
} }
/**
* 获取经纪人新增带看数量
* @param $params
* @return int|string
*/
public function getAddFollowUpNumByAgentId($params){
$where_ = [];
if(isset($params["agent_id"])){
$where_["report_agent_id"] = $params["agent_id"];
}
if(isset($params["create_time"])){
$where_["create_time"] = $params["create_time"];
}
return Db::name($this->table)
->where($where_)
->count();
}
} }
\ 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