Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
U
User
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhangjun
User
Commits
161b2451
Commit
161b2451
authored
Jul 01, 2024
by
fangliyan
Browse files
Options
Browse Files
Download
Plain Diff
合并分支 'subscribe2.0' 到 'release'
小区收藏 查看合并请求
!40
parents
f61534f9
0c0e58f5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
27 deletions
+47
-27
esf_center_api.php
center/controllers/esf_center_api.php
+47
-27
No files found.
center/controllers/esf_center_api.php
View file @
161b2451
...
...
@@ -1289,36 +1289,56 @@ class Esf_center_api extends MY_Controller {
$blockid
=
$this
->
input
->
get
(
'id'
);
$city
=
$this
->
input
->
get
(
'city'
);
$city
=
$city
?
$city
:
'nj'
;
$result
=
$this
->
user_model
->
getusercollectid
(
$uid
,
$blockid
,
$city
,
$kind
);
//已关注此房源
if
(
$result
>
0
)
{
$msg
=
"已经收藏此小区"
;
$return_array
=
array
(
'result'
=>
'0'
,
'data'
=>
'2'
,
'msg'
=>
$msg
);
echo
serialize
(
$return_array
);
}
else
{
$url
=
"http://newrent.house365.com/server-task/agent-crm-insert-record?phone=
{
$_GET
[
'telno'
]
}
&city=
{
$city
}
&activefrom=487&block_name=
$blockid
"
;
$ch
=
curl_init
();
curl_setopt
(
$ch
,
CURLOPT_URL
,
$url
);
curl_setopt
(
$ch
,
CURLOPT_TIMEOUT
,
1
);
curl_setopt
(
$ch
,
CURLOPT_RETURNTRANSFER
,
1
);
curl_setopt
(
$ch
,
CURLOPT_HEADER
,
0
);
$rs
=
curl_exec
(
$ch
);
curl_close
(
$ch
);
}
$blockinfo
=
$this
->
user_model
->
get_data
(
array
(
'form_name'
=>
'block'
,
'where'
=>
array
(
'id'
=>
$blockid
,
'esta'
=>
'2'
),
'limit'
=>
1
),
'esfhousebak'
);
$searchcond
=
serialize
(
$blockinfo
[
0
]);
$this
->
user_model
->
addcollect
(
$uid
,
$blockid
,
$kind
,
$searchcond
,
$city
,
2
);
$url
=
$this
->
newrent_host
.
'/api/tf-app-ext/add-block-collect'
;
$postData
=
array
(
'bid'
=>
$blockid
,
'city'
=>
$city
,
'uid'
=>
$uid
,
);
$result
=
SendDataByCurl
(
$url
,
$postData
);
$result
=
$result
?
json_decode
(
$result
,
true
)
:
array
();
$return
=
array
(
'result'
=>
0
,
'msg'
=>
'收藏失败'
);
if
(
!
empty
(
$result
)){
$return
[
'result'
]
=
$result
[
'code'
]
==
0
?
1
:
0
;
//utf8转gbk
$msg
=
$result
[
'msg'
]
?
mb_convert_encoding
(
$result
[
'msg'
],
'gbk'
,
'utf-8'
)
:
''
;
$return
[
'msg'
]
=
$msg
?
$msg
:
(
$return
[
'result'
]
==
1
?
'收藏成功'
:
'收藏失败'
);
}
echo
serialize
(
$return
);
die
();
$msg
=
"收藏成功"
;
//收藏成功,调用接口刷新
$url
=
'http://newrent.house365.com/api/tf-app/refresh-block-list?uid='
.
$uid
.
'&city='
.
$city
.
'&id='
.
$blockid
;
curl_get_contents
(
$url
);
$return_array
=
array
(
'result'
=>
'1'
,
'data'
=>
'1'
,
'msg'
=>
$msg
);
echo
serialize
(
$return_array
);
// $result = $this->user_model->getusercollectid($uid,$blockid,$city,$kind);
//
// //已关注此房源
// if( $result > 0 )
// {
// $msg="已经收藏此小区";
// $return_array = array('result'=>'0','data'=>'2','msg'=>$msg);
// echo serialize($return_array);
// }else{
// $url ="http://newrent.house365.com/server-task/agent-crm-insert-record?phone={$_GET['telno']}&city={$city}&activefrom=487&block_name=$blockid";
// $ch = curl_init();
// curl_setopt($ch, CURLOPT_URL, $url);
// curl_setopt($ch, CURLOPT_TIMEOUT, 1);
// curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// curl_setopt($ch, CURLOPT_HEADER, 0);
// $rs = curl_exec($ch);
// curl_close($ch);
// }
//
// $blockinfo = $this->user_model->get_data(array('form_name' => 'block','where'=>array('id'=>$blockid,'esta'=>'2'),'limit'=>1),'esfhousebak');
// $searchcond = serialize($blockinfo[0]);
// $this->user_model->addcollect($uid,$blockid,$kind,$searchcond,$city,2);
//
// $msg="收藏成功";
//
// //收藏成功,调用接口刷新
// $url = 'http://newrent.house365.com/api/tf-app/refresh-block-list?uid='.$uid.'&city='.$city.'&id='.$blockid;
// curl_get_contents($url);
// $return_array = array('result'=>'1','data'=>'1','msg'=>$msg);
// echo serialize($return_array);
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment