Commit 61aa391e authored by clone's avatar clone

q

parent 771d3b71
......@@ -190,7 +190,8 @@ class OfficeReport extends Basic
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$field = "a.id,a.user_id,a.report_agent_name,a.report_agent_phone,a.user_phone,a.user_name,a.predict_see_time,a.create_time,b.id as order_id,b.order_no,b.house_id,b.house_title";
$field = "a.id,a.user_id,a.report_agent_name,a.report_agent_phone,a.user_phone,a.user_name,a.predict_see_time,
a.create_time,b.id as order_id,b.order_no,b.house_id,b.house_title";
if (isset($params["report_id"])) {
$params["a.id"] = $params["report_id"];
......
......@@ -168,7 +168,6 @@ class OfficeReportService
$sign_arr = $this->orderSign($ids_str);
$house_arr = $this->houseInfo($house_id_str);
foreach ($result as $k => $v) {
$result[$k]["sign"] = "";
foreach ($sign_arr as $value) {
......@@ -217,14 +216,13 @@ class OfficeReportService
$ids = "";
if (count($caseHouseId) > 0) {
foreach ($caseHouseId as $item) {
$ids .= $item["houses_id"] . ",";
$ids .= $item["house_id"] . ",";
}
}
$ids = rtrim($ids, ",");
$ids = $ids ? $ids : 0;
$params["house_ids"] = $ids;
$result = $this->reportModel->selectReportList($field, $params, $pageNo, $pageSize);
break;
default:
......
......@@ -2,6 +2,7 @@
# https://curl.haxx.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.
.haozu.com TRUE / FALSE 1559723045 hzucsso deleted
.haozu.com TRUE / FALSE 1559744645 haozu_user %7B%22index%22%3A3%2C%22name%22%3A%22haozu%22%2C%22value%22%3A%22haozu%22%2C%22opt_scope%22%3A2%7D
.haozu.com TRUE / FALSE 1559895845 citydomain sh
www.haozu.com FALSE / FALSE 1560838217 lookHouse 464034%2C101612%2C1103785%2C714981%2C1346697%2C1285245%2C555537%2C1107172%2C992988%2C1173150%2C583706%2C1272465%2C150430%2C583678%2C1278875%2C1012250%2C319832%2C1053143%2C583709%2C204470%2C1319631%2C1011854%2C1141554%2C1381407%2C595860%2C900389%2C1265538%2C342069%2C1121322%2C514219%2C1159068
.www.haozu.com TRUE / FALSE 1575785417 1houseView %5B%7B%22viewId%22%3A%221173150%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22178%22%2C%22streetId%22%3A%226081%22%2C%22districtId%22%3A%22191%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233406%7D%2C%7B%22viewId%22%3A%22992988%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22216%22%2C%22streetId%22%3A%226071%22%2C%22districtId%22%3A%22195%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233407%7D%2C%7B%22viewId%22%3A%221107172%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22226%22%2C%22streetId%22%3A%226039%22%2C%22districtId%22%3A%22200%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233408%7D%2C%7B%22viewId%22%3A%22555537%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22216%22%2C%22streetId%22%3A%226071%22%2C%22districtId%22%3A%22195%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233409%7D%2C%7B%22viewId%22%3A%221285245%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22216%22%2C%22streetId%22%3A%226071%22%2C%22districtId%22%3A%22195%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233410%7D%2C%7B%22viewId%22%3A%221346697%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22338%22%2C%22streetId%22%3A%227251%22%2C%22districtId%22%3A%22197%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233411%7D%2C%7B%22viewId%22%3A%22714981%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22216%22%2C%22streetId%22%3A%226071%22%2C%22districtId%22%3A%22195%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233412%7D%2C%7B%22viewId%22%3A%221103785%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22216%22%2C%22streetId%22%3A%226071%22%2C%22districtId%22%3A%22195%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233413%7D%2C%7B%22viewId%22%3A%22101612%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22338%22%2C%22streetId%22%3A%227251%22%2C%22districtId%22%3A%22197%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233414%7D%2C%7B%22viewId%22%3A%22464034%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22225%22%2C%22streetId%22%3A%226027%22%2C%22districtId%22%3A%22200%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233415%7D%5D
.haozu.com TRUE / FALSE 1560406217 citydomain sh
.haozu.com TRUE / FALSE 1560255017 haozu_user %7B%22index%22%3A3%2C%22name%22%3A%22haozu%22%2C%22value%22%3A%22haozu%22%2C%22opt_scope%22%3A2%7D
......@@ -439,7 +439,7 @@ class OfficeGRoom extends BaseModel
return $data = $this
->field($field)
->alias("a")
->join("office_g_building b","a.building_id=a.id")
->join("office_g_building b","a.building_id=b.id","left")
->where($params)
->find();
}
......@@ -457,10 +457,10 @@ class OfficeGRoom extends BaseModel
$result = Db::table($this->table)
->field($field)
->alias("a")
->join("office_g_building b","a.building_id=a.id")
->join("office_g_building b","a.building_id=b.id","left")
->where($params)
->select();
// echo $this->getLastSql();
return $result;
}
......
......@@ -939,6 +939,7 @@ Route::group('broker', [
Route::group('search', [
'search' => ['search/Search/search', ['method' => 'get|post']],
'getHaoZu' => ['search/Reptile/getHaoZu', ['method' => 'get|post']],
'index' => ['search/Reptile/index', ['method' => 'get|post']],
]);
......
<?php
namespace app\search\controller;
use app\search\extend\Basic;
use app\search\service\ReptileService;
use Think\Exception;
use think\Request;
/**
......@@ -10,18 +13,69 @@ use think\Request;
* Date: 2019/6/4
* Time: 11:08
*/
class Reptile extends Basic{
class Reptile extends Basic
{
private $service_;
public function __construct(Request $request = null)
{
parent::__construct($request);
$this->service_ = new ReptileService();
}
public function getHaoZu(){
$url = "https://cowork.haozu.com/sh/list/";
public function index()
{
return view("reptile/index");
}
public function getHaoZu()
{
set_time_limit(0); // 取消脚本运行时间的超时上限
$url = "https://www.haozu.com/sh/house-list/o2";
$result = $this->service_->getHaoZu($url);
return $this->response("200","success",$result);
//https://www.haozu.com/sh/house1281461/
preg_match_all("/www.haozu.com\\/\w+\\/house\d+/", $result, $matches);
$new_arr = array_unique($matches[0]);
foreach ($new_arr as $key) {
$params = [];
$body = $this->service_->getHaoZu($key);
$params["title"] = $this->getTitle($body);
$value = $this->getAddress($body);
$params["address"] = $value[10];
dump($params);
/* preg_match("/\d+/", $value[14], $match1);
$params["floor_total"] = $match1[0];*/
// echo $key;
}
//return $this->response("200","success",$result);
}
/**
* 获取标题
* @param $result
* @return string
*/
private function getTitle($result)
{
try {
preg_match("/(?<=\"h3-title\">)[^<>]+(?=<)/", $result, $match1);
} catch (Exception $e) {
$match1[0] = "";
}
return $match1[0];
}
private function getAddress($result){
//dump($result);
try {
preg_match_all("/(?<=\"s2\">)[^<>]+(?=<)/", $result, $match1);
} catch (Exception $e) {
$match1[0] = "";
}
dump($match1);
return $match1[0];
}
}
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>test</title>
</head>
<body>
<button id="action_add">获取数据</button>
<script src="/resource/lib/js/jquery-2.0.3.min.js"></script>
<script type="text/javascript">
$("#action_add").click(function(){
$.ajax({
type:'post',
url: '/search/getHaoZu',
success: function(data) {
//console.log(data)
// data = JSON.stringify(data)
console.log(data);
var p = document.createElement('p');
p.innerHTML = data;
var list = p.querySelectorAll('.h3-title');
// console.log(list[0])
list.forEach(function(v){
var a= v.val()
console.log(a);
});
}
});
});
</script>
</body>
</html>
\ No newline at end of file
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