Commit 33675822 authored by zhuwei's avatar zhuwei

店长日报

parent 17ca0aea
......@@ -236,7 +236,7 @@ class Statement extends Basic
header('Access-Control-Allow-Origin:*');
$params = $this->params;
// $params = array(
// "agent_id" => 5741,
// "agent_id" => 5740,
// "type" => 1,//0 日报 1 周报
// );
......@@ -254,7 +254,7 @@ class Statement extends Basic
$store_id = $agent_result[0]["store_id"];
$district_id = $agent_result[0]["district_id"];
dump($agent_result[0]["level"]);
if ($agent_result[0]["level"] == 10) {
#业务员
$agent_level = 0;
......@@ -264,7 +264,7 @@ class Statement extends Basic
$agent_level = 1;
if($params["type"] == 0 ) {
#日报
$result = $this->service_->selectStatementForStoreWithDay($params["agent_id"], $agent_level, $store_id,$district_id);
$result = $this->service_->selectStatementForStoreWithDay($params["agent_id"], $agent_level, $store_id,$district_id,$this->siteId);
}else{
#周报
$result = $this->service_->selectStatementForStoreWithWeek($params["agent_id"], $agent_level, $store_id,$district_id);
......
......@@ -627,7 +627,7 @@ class StatementService
* @return mixed user 朱伟
* http://showdoc.tonglianjituan.com/index.php?s=/1&page_id=698
*/
public function selectStatementForStoreWithDay($agent_id, $agent_level, $store_id, $district_id)
public function selectStatementForStoreWithDay($agent_id, $agent_level, $store_id, $district_id,$site_id)
{
$time_ = date("Y-m-d", time());
......@@ -638,43 +638,64 @@ class StatementService
$conditions['create_time'] = array( 'between', array( $time_ . " 00:00:00", $time_ . " 23:59:59" ) );
// 房源
$result["house_num"] = $this->housesToAgents->getAddHouseNumByAgentId($conditions);
$result["team_house_num"] = $this->housesToAgents->getAddHouseNumByAgentId($conditions);
// 客源
$result["user_num"] = $this->userModel->getAddUserNumByAgentId($conditions);
$result["team_user_num"] = $this->userModel->getAddUserNumByAgentId($conditions);
// 带看 (报备)
$addMarchInNum = $this->marchInModel->getAddMarchInNum($conditions);
$result["follow_up_num"] = isset($addMarchInNum[0]["num"]) ? $addMarchInNum[0]["num"] : 0;
$result["team_follow_up_num"] = isset($addMarchInNum[0]["num"]) ? $addMarchInNum[0]["num"] : 0;
// 业绩
$performanceSum = $this->bargainModel->getAddBargainNum($conditions, 1);//1表示业绩 2表示实收
$result["performance"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
$result["team_performance"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
// 实收666666666666
$performanceSum = $this->bargainModel->getAddBargainNum($conditions, 2);//1表示业绩 2表示实收
$result["team_real_performance"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
// 本月-业绩
$start_time = date("Y-m-01", time());
$end_time = date("Y-m-d", time());
$conditions['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
// 房源
$result["team_month_house_num"] = $this->housesToAgents->getAddHouseNumByAgentId($conditions);
// 客源
$result["team_month_user_num"] = $this->userModel->getAddUserNumByAgentId($conditions);
// 带看 (报备)
$addMarchInNum = $this->marchInModel->getAddMarchInNum($conditions);
$result["team_month_follow_up_num"] = isset($addMarchInNum[0]["num"]) ? $addMarchInNum[0]["num"] : 0;
// 业绩
$performanceSum = $this->bargainModel->getAddBargainNum($conditions, 1);//1表示业绩 2表示实收
$result["performance_for_month"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
$result["team_month_performance"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
// 实收666666666666
$performanceSum = $this->bargainModel->getAddBargainNum($conditions, 2);//1表示业绩 2表示实收
$result["team_month_real_performance"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
// 本月-成交单数
$performanceSum = $this->bargainModel->getAddBargainNumV2($conditions, 3);//1表示业绩 2表示实收
$result["bargain_sum_for_month"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
$result["team_month_bargain_sum"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
/**查询店长个人数据**/
#店长个人带看(报备)
#店长个人
$time_ = date("Y-m-d", time());
$conditions['agent_id'] = $agent_id;
$conditions['create_time'] = array( 'between', array( $time_ . " 00:00:00", $time_ . " 23:59:59" ) );
//房源
$result["self_house_num"] = $this->housesToAgents->getAddHouseNumByAgentId($conditions);
//客源
$result["self_user_num"] = $this->userModel->getAddUserNumByAgentId($conditions);
//带看(报备)
$addMarchInNum = $this->marchInModel->getAddMarchInNum($conditions);
$result["follow_up_num_by_self"] = isset($addMarchInNum[0]["num"]) ? $addMarchInNum[0]["num"] : 0;
$result["self_follow_up_num"] = isset($addMarchInNum[0]["num"]) ? $addMarchInNum[0]["num"] : 0;
#店长个人 成交单数
$performanceSum = $this->bargainModel->getAddBargainNumV2($conditions, 3);//1表示业绩 2表示实收
$result["bargain_sum_by_self"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
//跟进数
$m_phone_follow_up = new UPhoneFollowUpTemporary($site_id);
$result["self_phone_follow_up_num"] = $m_phone_follow_up->getFollowTotal($conditions);
#成交单数
// $performanceSum = $this->bargainModel->getAddBargainNumV2($conditions, 3);//1表示业绩 2表示实收 3成交单数
// $result["bargain_sum_by_self"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
/**查询店长旗下业务员数据**/
$result["store_list"] = $agent_res['store_list'];
......
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