Commit 0295c66a authored by zhuwei's avatar zhuwei

1

parent 98db8f30
......@@ -10,6 +10,7 @@ use app\model\GHousesImgs;
use app\model\GHousesToAgents;
use app\model\OBargainModel;
use app\model\OfficeGRoomToAgent;
use app\model\OfficeOMarchInModel;
use app\model\OfficeOPayLogModel;
use app\model\OfficeORefundModel;
use app\model\OfficeOReportModel;
......@@ -49,13 +50,69 @@ class OfficePerformanceService
$this->houseModel = new GHouses();
$this->userModel = new Users();
$this->bargainModel = new OBargainModel();
$this->reportModel = new OReportModel();
$this->marchInModel = new OMarchInModel();
$this->payLogModel = new OPayLogModel();
$this->reportModel = new OfficeOReportModel();
$this->marchInModel = new OfficeOMarchInModel();
$this->payLogModel = new OfficeOPayLogModel();
$this->gHousesImgModel = new GHousesImgs();
$this->superviseModel = new ASuperviseModel();
}
/**
* 进场
* @param $id
* @param $type
* @param $start_time
* @param $end_time
* @param $page_no
* @param $page_size
* @return array
*/
public function marchInListPcInfo($id, $type, $start_time, $end_time, $page_no, $page_size)
{
$params = $this->getAgentIdPcInfo($id, $type, $start_time, $end_time);
//dump($params);
Log::write($params, 'marchInListPcInfo'); //记录日志
if (!$params)
return [ "code" => 101, "date" => "传入的参数错误" ];
$field = "a.id,c.user_name,c.user_phone,c.predict_see_time,c.report_agent_name,b.house_title,b.create_time,e.store_name,b.id as order_id";
$addMarchInList = $this->marchInModel->getAddMarchInListPcInfo($params, $field, $page_no, $page_size);
$addMarchInListTotal = $this->marchInModel->getAddMarchInListPcInfoTotal($params, $field);
//获取图片信息
foreach ($addMarchInList as $key => $val) {
$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"]);
}
return [ "code" => 200, "date" => $addMarchInList, "total" => $addMarchInListTotal ];
}
/**
* 报备
* @param $id
* @param $type
* @param $start_time
* @param $end_time
* @param $page_no
* @param $page_size
* @return array
*/
public function getFollowListPcInfo($id, $type, $start_time, $end_time, $page_no, $page_size)
{
$params = $this->getAgentIdPcInfo($id, $type, $start_time, $end_time);
if (!$params)
return [ "code" => 101, "date" => "传入的参数错误" ];
$field = "a.id,a.user_name,a.user_phone,a.predict_see_time,a.create_time,a.report_agent_name,c.internal_title as house_title,c.shop_type,e.store_name,b.id as order_id";
$reportList = $this->reportModel->getAddReportListPcInfo($params, $field, $page_no, $page_size);
$reportListTotal = $this->reportModel->getAddReportListPcInfoTotal($params, $field);
foreach ($reportList as $key => $val) {
$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"]);
}
//return [ "code" => 200, "date" => $reportList ];
return [ "code" => 200, "date" => $reportList, "total" => $reportListTotal ];
}
/**
* @param $agent_id
* @param $type
......@@ -710,34 +767,7 @@ class OfficePerformanceService
return [ "code" => 200, "date" => $payLogList ];
}
/**
* 进场
* @param $id
* @param $type
* @param $start_time
* @param $end_time
* @param $page_no
* @param $page_size
* @return array
*/
public function marchInListPcInfo($id, $type, $start_time, $end_time, $page_no, $page_size)
{
$params = $this->getAgentIdPcInfo($id, $type, $start_time, $end_time);
//dump($params);
Log::write($params, 'marchInListPcInfo'); //记录日志
if (!$params)
return [ "code" => 101, "date" => "传入的参数错误" ];
$field = "a.id,c.user_name,c.user_phone,c.predict_see_time,c.report_agent_name,b.house_title,b.create_time,e.store_name,b.id as order_id";
$addMarchInList = $this->marchInModel->getAddMarchInListPcInfo($params, $field, $page_no, $page_size);
$addMarchInListTotal = $this->marchInModel->getAddMarchInListPcInfoTotal($params, $field);
//获取图片信息
foreach ($addMarchInList as $key => $val) {
$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"]);
}
return [ "code" => 200, "date" => $addMarchInList, "total" => $addMarchInListTotal ];
}
/**
......@@ -813,32 +843,7 @@ class OfficePerformanceService
}
/**
* 报备
* @param $id
* @param $type
* @param $start_time
* @param $end_time
* @param $page_no
* @param $page_size
* @return array
*/
public function getFollowListPcInfo($id, $type, $start_time, $end_time, $page_no, $page_size)
{
$params = $this->getAgentIdPcInfo($id, $type, $start_time, $end_time);
if (!$params)
return [ "code" => 101, "date" => "传入的参数错误" ];
$field = "a.id,a.user_name,a.user_phone,a.predict_see_time,a.create_time,a.report_agent_name,c.internal_title as house_title,c.shop_type,e.store_name,b.id as order_id";
$reportList = $this->reportModel->getAddReportListPcInfo($params, $field, $page_no, $page_size);
$reportListTotal = $this->reportModel->getAddReportListPcInfoTotal($params, $field);
foreach ($reportList as $key => $val) {
$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"]);
}
//return [ "code" => 200, "date" => $reportList ];
return [ "code" => 200, "date" => $reportList, "total" => $reportListTotal ];
}
/**
......@@ -890,8 +895,7 @@ class OfficePerformanceService
return [ "code" => 101, "date" => "传入的参数错误" ];
$field = "a.id,a.father_id,a.create_time,a.trade_type,a.scale_fee,a.agent_id,c.internal_address,d.user_phone,d.user_name,b.id as order_id";
$m_bargain = new OBargainModel();
$list = $m_bargain->getBargainSumList($field, $params, $page_size, $page_no, $request_source_type);
$list = $this->bargainModel->getBargainSumList($field, $params, $page_size, $page_no, $request_source_type);
foreach ($list as $key => $val) {
$list[$key]['bargain_id'] = $val["father_id"] == 0 ? $val["id"] : $val["father_id"];//成交报告ID
$list[$key]["internal_address"] = $val["internal_address"] ? $val["internal_address"] : '';
......
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