Commit b930de1c authored by clone's avatar clone

修改老数据

parent 87ecfb5f
......@@ -297,7 +297,7 @@ class GHouses extends BaseModel
foreach ($data as $k => $v) {
$house_id[$k] = $v['id'];
$v->create_time = date('Y-m-d', strtotime($v->create_time));
$data[$k]['last_follow_up'] = $house_follow_up->where('house_id',$v['id'])->value('create_time');
$data[$k]['last_follow_up'] = $house_follow_up->where('house_id', $v['id'])->value('create_time');
}
$result = array();
......@@ -547,7 +547,8 @@ class GHouses extends BaseModel
* @param int $agent_id
* @return int|mixed|string
*/
public function addHouse(array $data, int $agent_id) {
public function addHouse(array $data, int $agent_id)
{
$save_data = [];
$house_id = 0;
//楼盘名针对内部
......@@ -738,16 +739,16 @@ class GHouses extends BaseModel
//商铺对外名称
if ($save_data['shop_type'] == 1) {
$save_data['external_title'] = $save_data['disc'].$save_data['business_name'].$save_data['shop_area_start'].'㎡'.$save_data['industry_type'];//街铺
$save_data['external_title'] = $save_data['disc'] . $save_data['business_name'] . $save_data['shop_area_start'] . '㎡' . $save_data['industry_type'];//街铺
} else {
$save_data['external_title'] = $save_data['disc'].$save_data['business_name'].$save_data['shop_area_start'].'-'.$save_data['shop_area_end'].'㎡';
$save_data['external_title'] = $save_data['disc'] . $save_data['business_name'] . $save_data['shop_area_start'] . '-' . $save_data['shop_area_end'] . '㎡';
}
//楼盘地址(对外)
if (empty($save_data['internal_address'])) {
$save_data['external_address'] = $save_data['city'].$save_data['disc'];
$save_data['external_address'] = $save_data['city'] . $save_data['disc'];
} else {
$save_data['external_address'] = $save_data['city'].$save_data['disc'];
$save_data['external_address'] = $save_data['city'] . $save_data['disc'];
}
if (empty($data['id'])) {
......@@ -1181,6 +1182,30 @@ class GHouses extends BaseModel
return $result;
}
/**
* 根据时间获取楼盘信息
* @param $field
* @param $params
* @param $page_no
* @param $page_size
* @return false|\PDOStatement|string|\think\Collection
*/
public function getShopList($field, $params, $page_no, $page_size)
{
$where_ = [];
if (isset($params["status"])) {
$where_["status"] = $params["status"];
}
$result = Db::table($this->table)
->field($field)
->where($where_)
->page($page_no)
->limit($page_size)
->select();
return $result;
}
/**
* 根据获取上架状态的楼盘数量为0 的数据
* @param $field
......@@ -1441,7 +1466,7 @@ class GHouses extends BaseModel
->field($field)
->where($params)
->select();
if($result){
if ($result) {
$houseids = "";
foreach ($result as $key1 => $value1) {
$houseids .= $value1["id"] . ',';
......
......@@ -438,7 +438,10 @@ Route::group('task', [
'rongBilledInformUrl' => [ 'task/PrivacyNumber/rongBilledInformUrl', [ 'method' => 'post | get' ] ],//隐私号码回调[话单通知]
'rongRecordingInformUrl' => [ 'task/PrivacyNumber/rongRecordingInformUrl', [ 'method' => 'post | get' ] ],//隐私号码回调[录音通知]
'rongStatusInformUrl' => [ 'task/PrivacyNumber/rongStatusInformUrl', [ 'method' => 'post | get' ] ],//隐私号码回调[状态通知]
'defaultFollowUp' => [ 'task/PrivacyNumber/defaultFollowUp', [ 'method' => 'post | get' ] ] //默认跟进
'defaultFollowUp' => [ 'task/PrivacyNumber/defaultFollowUp', [ 'method' => 'post | get' ] ], //默认跟进
'updateShopTask' => [ 'task/JobTask/updateShopTask', [ 'method' => 'post | get' ] ] //默认跟进
]);
Route::group('broker', [
......
<?php
namespace app\task\controller;
use app\model\GHouses;
/**
......@@ -10,10 +11,10 @@ use app\model\GHouses;
* Time : 10:37
* Intro:
*/
class JobTask
{
private $gHouseModel;
public function __construct()
{
$this->gHouseModel = new GHouses();
......@@ -21,18 +22,41 @@ class JobTask
public function updateShopTask()
{
//todo 1.先查询出所有上架街铺,2.修改标题地址和业态
$field = "id";
set_time_limit(0); // 取消脚本运行时间的超时上限
$field = "id,disc,business_district_id,shop_area_start,shop_area_end,industry_type,shop_type,update_time";
$params = [];
$params["status"] = 1;
$houseList = $this->gHouseModel->getShopListByTime($field,$params);
$total = $this->gHouseModel->getHouseListTotal($params);
$pageSize = 200;
$pageTotal = ceil($total / $pageSize);
for ($pageNo = 1; $pageNo <= $pageTotal; $pageNo++) {
$houseList = $this->gHouseModel->getShopList($field, $params, $pageNo, $pageSize);
$houseArr = [];
foreach ($houseList as $item) {
$houseBin["id"] = $item["id"];
$industry_type = $item["industry_type"];
if ($item["business_district_id"] == 0) {
$area = $item["shop_type"] == 1 ? $item["shop_area_start"] . '㎡' . $industry_type :
$item["shop_area_start"] . '-' . $item["shop_area_end"] . '㎡';
$houseBin["external_title"] = $item["disc"] . $area;
}
if ($item["shop_type"] == 1) {
$industry_type = preg_replace("/餐饮美食/", "沿街餐饮", $industry_type);
} else {
$industry_type = preg_replace("/餐饮美食/", "商场美食", $industry_type);
}
$industry_type = preg_replace("/服装/", "服装鞋包", $industry_type);
$industry_type = preg_replace("/百货零售/", "百货超市", $industry_type);
private function updateIndustryType(){
$houseBin["industry_type"] = $industry_type;
$houseBin["update_time"] = $item["update_time"];
array_push($houseArr, $houseBin);
}
$this->gHouseModel->updateHouse($houseArr);
}
}
}
\ 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