Commit 4cb9946c authored by zhuwei's avatar zhuwei

1

parent 1cd1dc6d
...@@ -110,6 +110,18 @@ class SquareService ...@@ -110,6 +110,18 @@ class SquareService
$agent = $this->redis->getRedisCache(2, $val['agent_id']) ; $agent = $this->redis->getRedisCache(2, $val['agent_id']) ;
$res[$key]['name'] = $agent['name']; $res[$key]['name'] = $agent['name'];
$res[$key]['image_path'] = AGENTHEADERIMGURL . $agent['img']; $res[$key]['image_path'] = AGENTHEADERIMGURL . $agent['img'];
//部门标签
$res[$key]['district_lable_name'] = '一部';
foreach ($this->getDistrictLable() as $key1 => $val1) {
if($res[$key1]['district_lable_id'] == $val1['id']){
$res[$key1]['district_lable_name'] = $val1['name'];
continue;
}
}
//评论数
$res[$key]['comment_num'] = $this->getCommenNum($val['id']);
} }
return [ 'data' => $res, 'total' => $res_total ]; return [ 'data' => $res, 'total' => $res_total ];
...@@ -137,9 +149,9 @@ class SquareService ...@@ -137,9 +149,9 @@ class SquareService
$res[$key]['img'] = AGENTHEADERIMGURL . $agent['img']; $res[$key]['img'] = AGENTHEADERIMGURL . $agent['img'];
$get_params = []; $get_params = [];
$list = [];
$field = 'CommentExt.id,CommentExt.level,CommentExt.comment,CommentExt.agent_id_a,CommentExt.agent_id_b';// $field = 'CommentExt.id,CommentExt.level,CommentExt.comment,CommentExt.agent_id_a,CommentExt.agent_id_b';//
$get_params['CommentExt.comment_id'] = $val['id']; $get_params['CommentExt.comment_id'] = $val['id'];
$get_params['CommentExt.is_del'] = 0;
$res[$key]['comment_ext']['total']= $this->m_coment_ext->getSquareCommentExtListTotal($field,$get_params); $res[$key]['comment_ext']['total']= $this->m_coment_ext->getSquareCommentExtListTotal($field,$get_params);
$list = $this->m_coment_ext->getSquareCommentExtList(1, 2, $field, $get_params); $list = $this->m_coment_ext->getSquareCommentExtList(1, 2, $field, $get_params);
...@@ -336,4 +348,15 @@ class SquareService ...@@ -336,4 +348,15 @@ class SquareService
return [ 'data' => $res, 'total' => $res_total ]; return [ 'data' => $res, 'total' => $res_total ];
} }
/**
* 开盘广场列表 评论数
* @param $id
* @return int|string
*/
public function getCommenNum($id){
$get_params['square_id'] = $id;
$get_params['is_del'] = 0;
$res = $this->m_coment->getCommenNum($get_params);
return $res;
}
} }
\ No newline at end of file
...@@ -296,7 +296,7 @@ class StatementService ...@@ -296,7 +296,7 @@ class StatementService
//todo 上周业绩 //todo 上周业绩
$where_ = []; $where_ = [];
$start_time = date("Y-m-d", strtotime("-14 day")); $start_time = date("Y-m-d", strtotime("-13 day"));
$end_time = date("Y-m-d", strtotime("-7 day")); $end_time = date("Y-m-d", strtotime("-7 day"));
// $where_["district_id"] = $district_id; // $where_["district_id"] = $district_id;
$where_["agent_id"] = $conditions["agent_id"]; $where_["agent_id"] = $conditions["agent_id"];
...@@ -305,6 +305,7 @@ class StatementService ...@@ -305,6 +305,7 @@ class StatementService
$performanceSum = $this->bargainModel->getAddBargainNum($where_, 1);//1表示业绩 2表示实收 $performanceSum = $this->bargainModel->getAddBargainNum($where_, 1);//1表示业绩 2表示实收
$result["director_last_week_performance_num"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0; $result["director_last_week_performance_num"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
big_log($result["director_last_week_performance_num"]);
//todo 本周周业绩 //todo 本周周业绩
$where_ = []; $where_ = [];
$start_time = date("Y-m-d", strtotime("-7 day")); $start_time = date("Y-m-d", strtotime("-7 day"));
......
...@@ -67,4 +67,13 @@ class BComment extends Model ...@@ -67,4 +67,13 @@ class BComment extends Model
return $result; return $result;
} }
public function getCommenNum($params)
{
$result = Db::table($this->table)
->where($params)
->count();
// dump($this->getLastSql());
return $result;
}
} }
...@@ -56,7 +56,7 @@ class BSquare extends Model ...@@ -56,7 +56,7 @@ class BSquare extends Model
->page($pageNo) ->page($pageNo)
->order($order) ->order($order)
->select(); ->select();
//dump($this->getLastSql()); // dump($this->getLastSql());
return $result; return $result;
} }
......
...@@ -786,8 +786,7 @@ class OBargainModel extends Model ...@@ -786,8 +786,7 @@ class OBargainModel extends Model
->join($join) ->join($join)
->where($where_) ->where($where_)
->select(); ->select();
/*echo $this->getLastSql(); big_log($this->getLastSql());
echo '------------------';*/
return $return; return $return;
} }
public function getAddBargainNumV2($params, $type) public function getAddBargainNumV2($params, $type)
......
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