Commit ddb31b73 authored by clone's avatar clone

1

parent 380d15fc
...@@ -112,13 +112,13 @@ class Report extends Basic ...@@ -112,13 +112,13 @@ class Report extends Basic
public function reportList() public function reportList()
{ {
$params = $this->params; $params = $this->params;
/* $params = array( $params = array(
"agent_id" =>1, "agent_id" =>6562,
"type" => 2,//1表示全部 2表示进场 3 表示收款 4成交报告 "type" => 1,//1表示全部 2表示进场 3 表示收款 4成交报告
"is_all"=>1,//0搜索我自己的,1全部 "is_all"=>0,//0搜索我自己的,1全部
"page_no"=>1, "page_no"=>1,
"page_size"=>15 "page_size"=>15
);*/ );
if (!isset($params["agent_id"]) || !isset($params["type"])) { if (!isset($params["agent_id"]) || !isset($params["type"])) {
...@@ -140,6 +140,7 @@ class Report extends Basic ...@@ -140,6 +140,7 @@ class Report extends Basic
$check_type = 1; $check_type = 1;
if ($agents_data["level"] < 30) { if ($agents_data["level"] < 30) {
$check_type = $this->service_->getCheckType($this->agentId); $check_type = $this->service_->getCheckType($this->agentId);
echo $check_type;
if ($check_type == 0) { if ($check_type == 0) {
return $this->response(101, "暂无权限"); return $this->response(101, "暂无权限");
} }
......
...@@ -86,7 +86,7 @@ class ReportService ...@@ -86,7 +86,7 @@ class ReportService
foreach ($house_arr as $k => $v) { foreach ($house_arr as $k => $v) {
//todo 批量插入到数据库 //todo 批量插入到数据库
if($v <= 0){ if ($v <= 0) {
break; break;
} }
$order_no = $this->createOrderNumber(); $order_no = $this->createOrderNumber();
...@@ -112,9 +112,6 @@ class ReportService ...@@ -112,9 +112,6 @@ class ReportService
{ {
//todo 获取我报备的我的案场的, //todo 获取我报备的我的案场的,
//如果是店长则获取其下所有的经纪人 这里去掉了for190218 //如果是店长则获取其下所有的经纪人 这里去掉了for190218
$agentModel = new AAgents();
$agents_data = $agentModel->getAgentInfo('id,level', $params["agent_id"]);
if($agents_data["level"] == 30 || $agents_data["level"] == 40 ) {
$vModel = new VerifyService(); $vModel = new VerifyService();
$params["agent_id_s"] = array("in", $params["report_agent_id"]); $params["agent_id_s"] = array("in", $params["report_agent_id"]);
...@@ -126,15 +123,10 @@ class ReportService ...@@ -126,15 +123,10 @@ class ReportService
$ids .= $item["houses_id"] . ","; $ids .= $item["houses_id"] . ",";
} }
} }
$ids = rtrim($ids, ","); $ids = rtrim($ids, ",");
$ids = $ids ? $ids : 0; $ids = $ids ? $ids : 0;
$params["house_ids"] = $ids; $params["house_ids"] = $ids;
$result = $this->oReportModel->selectReportList($field, $params, $pageNo, $pageSize); $result = $this->oReportModel->selectReportList($field, $params, $pageNo, $pageSize);
}else{
$result = $this->oReportModel->selectReportListAll($field, $params, $pageNo, $pageSize,1);
}
return $this->returnResult($result); return $this->returnResult($result);
} }
...@@ -146,15 +138,16 @@ class ReportService ...@@ -146,15 +138,16 @@ class ReportService
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException * @throws \think\exception\DbException
*/ */
public function returnResult($result){ public function returnResult($result)
{
$ids_str = ""; $ids_str = "";
$house_id_str = ""; $house_id_str = "";
if (count($result) > 0) { if (count($result) > 0) {
foreach ($result as $k => $v) { foreach ($result as $k => $v) {
$order_id = 0; $order_id = 0;
if(isset($v["order_id"])){ if (isset($v["order_id"])) {
$order_id = $v["order_id"]; $order_id = $v["order_id"];
}else{ } else {
$order_id = $v["id"]; $order_id = $v["id"];
} }
$ids_str .= $order_id . ","; $ids_str .= $order_id . ",";
...@@ -184,6 +177,7 @@ class ReportService ...@@ -184,6 +177,7 @@ class ReportService
} }
return $result; return $result;
} }
/** /**
* 报备订单列表All * 报备订单列表All
* @param $field * @param $field
...@@ -194,7 +188,7 @@ class ReportService ...@@ -194,7 +188,7 @@ class ReportService
* @throws \think\db\exception\BindParamException * @throws \think\db\exception\BindParamException
* @throws \think\exception\PDOException * @throws \think\exception\PDOException
*/ */
public function orderListAll($field, $params, $pageNo, $pageSize,$check_type) public function orderListAll($field, $params, $pageNo, $pageSize, $check_type)
{ {
$vModel = new VerifyService(); $vModel = new VerifyService();
$result = []; $result = [];
...@@ -205,7 +199,7 @@ class ReportService ...@@ -205,7 +199,7 @@ class ReportService
case 2 : case 2 :
case 3 : case 3 :
$agentArr = $vModel->getAgentsByAgentIdAndType($params["report_agent_id"], $check_type); $agentArr = $vModel->getAgentsByAgentIdAndType($params["report_agent_id"], $check_type);
$params["agent_id_s"] = array( "in", $agentArr); $params["agent_id_s"] = array("in", $agentArr);
$params["report_agent_id"] = $agentArr; $params["report_agent_id"] = $agentArr;
$caseHouseId = $vModel->getPanpartyAndExclusiveHouseIdByAgentId($params["agent_id_s"]); $caseHouseId = $vModel->getPanpartyAndExclusiveHouseIdByAgentId($params["agent_id_s"]);
$ids = ""; $ids = "";
...@@ -243,8 +237,8 @@ class ReportService ...@@ -243,8 +237,8 @@ class ReportService
public function houseInfo($house_id_str) public function houseInfo($house_id_str)
{ {
$houseModel = new GHouses(); $houseModel = new GHouses();
$params["id"] = array("in",($house_id_str)); $params["id"] = array("in", ($house_id_str));
return $houseModel->getHouseInfo("id,internal_address",$params); return $houseModel->getHouseInfo("id,internal_address", $params);
} }
public function signTitle($type) public function signTitle($type)
...@@ -319,7 +313,7 @@ class ReportService ...@@ -319,7 +313,7 @@ class ReportService
private function orderBin($order_no, $f_id, $house_id) private function orderBin($order_no, $f_id, $house_id)
{ {
$houseModel = new GHouses(); $houseModel = new GHouses();
$houseResult = $houseModel->getHouseDetail("id,internal_title", [ "id" => $house_id ]); $houseResult = $houseModel->getHouseDetail("id,internal_title", ["id" => $house_id]);
$house_title = count($houseResult) > 0 && isset($houseResult["internal_title"]) ? $houseResult["internal_title"] : null; $house_title = count($houseResult) > 0 && isset($houseResult["internal_title"]) ? $houseResult["internal_title"] : null;
$param["order_no"] = $order_no; $param["order_no"] = $order_no;
$param["f_id"] = $f_id; $param["f_id"] = $f_id;
...@@ -339,15 +333,15 @@ class ReportService ...@@ -339,15 +333,15 @@ class ReportService
public function getCheckType($agent_id) public function getCheckType($agent_id)
{ {
$vip = new VipService(); $vip = new VipService();
if($vip->vip($agent_id, 'index/inspectionRecordAll/3') == 0){//代表公司 if ($vip->vip($agent_id, 'index/inspectionRecordAll/3') == 0) {//代表公司
return 1; return 1;
} }
if($vip->vip($agent_id, 'index/inspectionRecordDistrict/2') == 0){//代表部门 if ($vip->vip($agent_id, 'index/inspectionRecordDistrict/2') == 0) {//代表部门
return 2; return 2;
} }
if($vip->vip($agent_id, 'index/inspectionRecordStore/1') == 0){//代表门店 if ($vip->vip($agent_id, 'index/inspectionRecordStore/1') == 0) {//代表门店
return 3; return 3;
} }
return 0; return 0;
......
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