Commit 936579ba authored by clone's avatar clone Committed by hujun

bug

parent a04000bc
...@@ -383,14 +383,15 @@ class PerformanceService ...@@ -383,14 +383,15 @@ class PerformanceService
foreach ($list as $key => $item) { foreach ($list as $key => $item) {
if ($is_store == 2) { if ($is_store == 2) {
$fields = "a.name,b.store_name"; $fields = "a.name,b.store_name";
$where_["a.level"] = array('in', "20,40"); $where_["a.level"] = array( 'in', "20,40" );
$where_["a.store_id"] = $item["store_id"];
$where_["c.id"] = $item["agent_id"];
} else { } else {
$fields = "c.name,b.store_name"; $fields = "a.name,b.store_name";
$where_["a.id"] = $item["agent_id"];
} }
$where_["a.store_id"] = $item["store_id"]; $info = $this->agentModel->getStoreOrAgentInfo($fields, $where_, $is_store);
$where_["c.id"] = $item["agent_id"];
$info = $this->agentModel->getStoreOrAgentInfo($fields, $where_);
if (count($info) > 0) { if (count($info) > 0) {
$list[$key]["store_name"] = $info[0]["store_name"]; $list[$key]["store_name"] = $info[0]["store_name"];
$list[$key]["name"] = $info[0]["name"]; $list[$key]["name"] = $info[0]["name"];
...@@ -461,6 +462,7 @@ class PerformanceService ...@@ -461,6 +462,7 @@ class PerformanceService
return $params; return $params;
} }
/** /**
* 获取房源数据 * 获取房源数据
* @param $type * @param $type
...@@ -570,7 +572,6 @@ class PerformanceService ...@@ -570,7 +572,6 @@ class PerformanceService
} }
/** /**
* 获取收款数据 * 获取收款数据
* @param $agent_id * @param $agent_id
...@@ -596,7 +597,6 @@ class PerformanceService ...@@ -596,7 +597,6 @@ class PerformanceService
} }
/** /**
* 获取业绩数据 * 获取业绩数据
* @param $type * @param $type
...@@ -668,7 +668,7 @@ class PerformanceService ...@@ -668,7 +668,7 @@ class PerformanceService
return [ "code" => 200, "date" => $receivedList ]; return [ "code" => 200, "date" => $receivedList ];
} }
public function paylogListPcInfo($id,$type, $start_time, $end_time, $page_no, $page_size) public function paylogListPcInfo($id, $type, $start_time, $end_time, $page_no, $page_size)
{ {
$params = $this->getAgentIdPcInfo($id, $type, $start_time, $end_time); $params = $this->getAgentIdPcInfo($id, $type, $start_time, $end_time);
...@@ -693,7 +693,7 @@ class PerformanceService ...@@ -693,7 +693,7 @@ class PerformanceService
* @param $page_size * @param $page_size
* @return array * @return array
*/ */
public function marchInListPcInfo($id,$type, $start_time, $end_time, $page_no, $page_size) public function marchInListPcInfo($id, $type, $start_time, $end_time, $page_no, $page_size)
{ {
$params = $this->getAgentIdPcInfo($id, $type, $start_time, $end_time); $params = $this->getAgentIdPcInfo($id, $type, $start_time, $end_time);
...@@ -705,10 +705,10 @@ class PerformanceService ...@@ -705,10 +705,10 @@ class PerformanceService
$addMarchInListTotal = $this->marchInModel->getAddMarchInListPcInfoTotal($params, $field); $addMarchInListTotal = $this->marchInModel->getAddMarchInListPcInfoTotal($params, $field);
//获取图片信息 //获取图片信息
foreach ($addMarchInList as $key => $val) { foreach ($addMarchInList as $key => $val) {
$addMarchInList[$key]["user_name"] = $val["user_name"]?$val["user_name"]:''; $addMarchInList[$key]["user_name"] = $val["user_name"] ? $val["user_name"] : '';
$addMarchInList[$key]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/', '$1****$2', $val["user_phone"]); $addMarchInList[$key]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/', '$1****$2', $val["user_phone"]);
} }
return [ "code" => 200, "date" => $addMarchInList , "total" => $addMarchInListTotal ]; return [ "code" => 200, "date" => $addMarchInList, "total" => $addMarchInListTotal ];
} }
...@@ -722,7 +722,7 @@ class PerformanceService ...@@ -722,7 +722,7 @@ class PerformanceService
* @param $page_size * @param $page_size
* @return array * @return array
*/ */
public function getUserResourceListPcInfo($id,$type, $start_time, $end_time, $page_no, $page_size) public function getUserResourceListPcInfo($id, $type, $start_time, $end_time, $page_no, $page_size)
{ {
$params = $this->getAgentIdPcInfo($id, $type, $start_time, $end_time); $params = $this->getAgentIdPcInfo($id, $type, $start_time, $end_time);
...@@ -756,7 +756,7 @@ class PerformanceService ...@@ -756,7 +756,7 @@ class PerformanceService
* @param $page_size * @param $page_size
* @return array * @return array
*/ */
public function getHousingResourceListPcInfo($id,$type, $start_time, $end_time, $page_no, $page_size) public function getHousingResourceListPcInfo($id, $type, $start_time, $end_time, $page_no, $page_size)
{ {
$params = $this->getAgentIdPcInfo($id, $type, $start_time, $end_time); $params = $this->getAgentIdPcInfo($id, $type, $start_time, $end_time);
...@@ -793,7 +793,7 @@ class PerformanceService ...@@ -793,7 +793,7 @@ class PerformanceService
* @param $page_size * @param $page_size
* @return array * @return array
*/ */
public function getFollowListPcInfo($id,$type, $start_time, $end_time, $page_no, $page_size) public function getFollowListPcInfo($id, $type, $start_time, $end_time, $page_no, $page_size)
{ {
$params = $this->getAgentIdPcInfo($id, $type, $start_time, $end_time); $params = $this->getAgentIdPcInfo($id, $type, $start_time, $end_time);
...@@ -803,11 +803,11 @@ class PerformanceService ...@@ -803,11 +803,11 @@ class PerformanceService
$reportList = $this->reportModel->getAddReportListPcInfo($params, $field, $page_no, $page_size); $reportList = $this->reportModel->getAddReportListPcInfo($params, $field, $page_no, $page_size);
$reportListTotal = $this->reportModel->getAddReportListPcInfoTotal($params, $field); $reportListTotal = $this->reportModel->getAddReportListPcInfoTotal($params, $field);
foreach ($reportList as $key => $val) { foreach ($reportList as $key => $val) {
$reportList[$key]["user_name"] = $val["user_name"]?$val["user_name"]:''; $reportList[$key]["user_name"] = $val["user_name"] ? $val["user_name"] : '';
$reportList[$key]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/', '$1****$2', $val["user_phone"]); $reportList[$key]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/', '$1****$2', $val["user_phone"]);
} }
//return [ "code" => 200, "date" => $reportList ]; //return [ "code" => 200, "date" => $reportList ];
return [ "code" => 200, "date" => $reportList , "total" => $reportListTotal ]; return [ "code" => 200, "date" => $reportList, "total" => $reportListTotal ];
} }
...@@ -821,23 +821,23 @@ class PerformanceService ...@@ -821,23 +821,23 @@ class PerformanceService
* @param $page_size * @param $page_size
* @return array * @return array
*/ */
public function getTeamNumPcInfo($id,$type, $start_time, $end_time, $page_no, $page_size) public function getTeamNumPcInfo($id, $type, $start_time, $end_time, $page_no, $page_size)
{ {
if($type == 2){ if ($type == 2) {
$params["a.store_id"] = $id; $params["a.store_id"] = $id;
}else{ } else {
$params["a.district_id"] = $id; $params["a.district_id"] = $id;
} }
//$params['a.create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) ); //$params['a.create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
$field = "a.id,a.level,a.name,a.phone,a.create_time,b.store_name"; $field = "a.id,a.level,a.name,a.phone,a.create_time,b.store_name";
$list = $this->agentModel->searchAgentsByKeywordPcInfo($field, $params,$page_size,$page_no); $list = $this->agentModel->searchAgentsByKeywordPcInfo($field, $params, $page_size, $page_no);
foreach ($list as $key => $val) { foreach ($list as $key => $val) {
$follow = new UPhoneFollowPp(); $follow = new UPhoneFollowPp();
$res = $follow->getLastPhoneFollowTime($val['id']); $res = $follow->getLastPhoneFollowTime($val['id']);
$list[$key]["user_name"] = $val["user_name"]?$val["user_name"]:''; $list[$key]["user_name"] = $val["user_name"] ? $val["user_name"] : '';
$list[$key]["last_phone_follow_time"] = $res[0]['create_time'] ? $res[0]['create_time'] : '暂无!'; $list[$key]["last_phone_follow_time"] = $res[0]['create_time'] ? $res[0]['create_time'] : '暂无!';
} }
return [ "code" => 200, "date" => $list ]; return [ "code" => 200, "date" => $list ];
...@@ -853,7 +853,7 @@ class PerformanceService ...@@ -853,7 +853,7 @@ class PerformanceService
* @param $page_size * @param $page_size
* @return array * @return array
*/ */
public function getBargainSumPcInfo($id,$type, $start_time, $end_time, $page_no, $page_size,$request_source_type) public function getBargainSumPcInfo($id, $type, $start_time, $end_time, $page_no, $page_size, $request_source_type)
{ {
$params = $this->getAgentIdPcInfo($id, $type, $start_time, $end_time); $params = $this->getAgentIdPcInfo($id, $type, $start_time, $end_time);
...@@ -862,14 +862,13 @@ class PerformanceService ...@@ -862,14 +862,13 @@ class PerformanceService
$field = "a.id,a.create_time,a.trade_type,a.scale_fee,c.landmark,d.user_phone,d.user_name,b.id as order_id"; $field = "a.id,a.create_time,a.trade_type,a.scale_fee,c.landmark,d.user_phone,d.user_name,b.id as order_id";
$m_bargain = new OBargainModel(); $m_bargain = new OBargainModel();
$list = $m_bargain->getBargainSumList($field, $params,$page_size,$page_no,$request_source_type); $list = $m_bargain->getBargainSumList($field, $params, $page_size, $page_no, $request_source_type);
foreach ($list as $key => $val) { foreach ($list as $key => $val) {
$list[$key]["user_name"] = $val["user_name"]?$val["user_name"]:''; $list[$key]["user_name"] = $val["user_name"] ? $val["user_name"] : '';
$list[$key]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/', '$1****$2', $val["user_phone"]); $list[$key]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/', '$1****$2', $val["user_phone"]);
} }
return [ "code" => 200, "date" => $list ]; return [ "code" => 200, "date" => $list ];
} }
} }
\ No newline at end of file
...@@ -692,13 +692,15 @@ class AAgents extends BaseModel ...@@ -692,13 +692,15 @@ class AAgents extends BaseModel
/** /**
* @param $field * @param $field
* @param $params * @param $params
* @param $is_store
* @return false|\PDOStatement|string|\think\Collection * @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException * @throws \think\exception\DbException
*/ */
public function getStoreOrAgentInfo($field, $params) public function getStoreOrAgentInfo($field, $params,$is_store)
{ {
if($is_store == 2){
$result = Db::table($this->table) $result = Db::table($this->table)
->field($field) ->field($field)
->alias("a") ->alias("a")
...@@ -706,6 +708,15 @@ class AAgents extends BaseModel ...@@ -706,6 +708,15 @@ class AAgents extends BaseModel
->join("a_agents c", "a.store_id = c.store_id", "left") ->join("a_agents c", "a.store_id = c.store_id", "left")
->where($params) ->where($params)
->select(); ->select();
}else{
$result = Db::table($this->table)
->field($field)
->alias("a")
->join("a_store b", "a.store_id = b.id", "left")
->where($params)
->select();
}
// echo $this->getLastSql(); // echo $this->getLastSql();
return $result; return $result;
} }
......
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