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
08ba82ed
Commit
08ba82ed
authored
Jun 24, 2024
by
fangliyan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
base_id 收藏
parent
2e0d36c7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
137 additions
and
0 deletions
+137
-0
esf_center_api.php
center/controllers/esf_center_api.php
+103
-0
user_model.php
esf_core/models/user_model.php
+34
-0
No files found.
center/controllers/esf_center_api.php
View file @
08ba82ed
...
@@ -289,6 +289,109 @@ class Esf_center_api extends MY_Controller {
...
@@ -289,6 +289,109 @@ class Esf_center_api extends MY_Controller {
echo
serialize
(
$return_array
);
echo
serialize
(
$return_array
);
}
}
/**
* 关注房源操作接口,base_id版本
* @author fly
*/
public
function
save_house_focus_by_baseId
()
{
$return
=
''
;
$passport_uid
=
$this
->
input
->
get
(
'passport_uid'
);
$uid
=
0
;
$flag
=
$this
->
input
->
get
(
'flag'
);
if
(
$passport_uid
){
//根据passport_uid获取uid
$uid
=
$this
->
user_model
->
getUidByPassportId
(
$passport_uid
);
if
(
empty
(
$flag
))
{
$flag
=
2
;
}
if
(
$uid
==
0
)
{
$return
=
'N_USER'
;
}
}
$kind
=
$this
->
input
->
get
(
'kind'
);
$rowid
=
$this
->
input
->
get
(
'rowid'
);
$city
=
$this
->
input
->
get
(
'city'
);
$phone
=
$this
->
input
->
get
(
'phone'
);
$base_id
=
$this
->
input
->
get
(
'base_id'
);
$city
=
$city
?
$city
:
'nj'
;
$tbl
=
$kind
==
3
?
'sell'
:
'rent'
;
$result
=
$this
->
user_model
->
getCollectHouseIdByBaseID
(
$uid
,
$rowid
,
$city
);
//已关注此房源
if
(
$result
[
'id'
]
>
0
)
{
$return
=
'N_COL'
;
}
if
(
$tbl
==
'sell'
){
$houseinfo
=
$this
->
house_model
->
get_data
(
array
(
'form_name'
=>
$tbl
,
'where'
=>
array
(
'id'
=>
$rowid
,
'esta'
=>
'1'
),
'select'
=>
array
(
'infotype'
,
'infofrom'
,
'id'
,
'district'
,
'address'
,
'streetid'
,
'blockshowname'
,
'room'
,
'hall'
,
'buildarea'
,
'forward'
,
'fitment'
,
'buildyear'
,
'floor'
,
'totalfloor'
,
'subfloor'
,
'price'
,
'uid'
,
'telno'
,
'pic1'
,
'contactor'
,
'uid'
),
'limit'
=>
1
),
'esfhousebak'
);
}
else
{
$houseinfo
=
$this
->
house_model
->
get_data
(
array
(
'form_name'
=>
$tbl
,
'where'
=>
array
(
'id'
=>
$rowid
,
'esta'
=>
'1'
),
'select'
=>
array
(
'infotype'
,
'infofrom'
,
'id'
,
'district'
,
'address'
,
'streetid'
,
'blockshowname'
,
'room'
,
'hall'
,
'buildarea'
,
'forward'
,
'fitment'
,
'buildyear'
,
'floor'
,
'totalfloor'
,
'subfloor'
,
'price'
,
'uid'
,
'telno'
,
'pic1'
,
'contactor'
,
'uid'
,
'priceunit'
,
'renttype'
),
'limit'
=>
1
),
'esfhousebak'
);
}
if
(
empty
(
$houseinfo
[
0
])
&&
$city
==
'nj'
)
{
$return
=
'N_HOU'
;
}
elseif
(
$return
!=
'N_COL'
){
if
(
!
empty
(
$houseinfo
[
0
]))
{
$searchcond
=
serialize
(
$houseinfo
[
0
]);
}
else
{
$searchcond
=
''
;
}
$return
=
$this
->
user_model
->
addcollectByBaseID
(
$base_id
,
$rowid
,
$kind
,
$searchcond
,
$city
,
$flag
,
$passport_uid
,
$uid
);
}
if
(
$return
==
'N_COL'
){
$result
=
2
;
$msg
=
'已收藏此房源'
;
}
elseif
(
$return
==
'N_HOU'
){
$result
=
3
;
$msg
=
'无此房源'
;
}
elseif
(
$return
==
'N_USER'
){
$result
=
4
;
$msg
=
'无此用户'
;
}
elseif
(
$return
>
0
){
$result
=
1
;
$msg
=
'收藏成功'
;
$house_type
=
$houseinfo
[
0
][
'room'
]
.
"室"
.
$houseinfo
[
0
][
'hall'
]
.
"厅"
;
$houseinfo
[
0
][
'floor'
]
=
iconv
(
'gbk'
,
'utf-8'
,
$houseinfo
[
0
][
'floor'
]);
$houseinfo
[
0
][
'blockshowname'
]
=
iconv
(
'gbk'
,
'utf-8'
,
$houseinfo
[
0
][
'blockshowname'
]);
$houseinfo
[
0
][
'forward'
]
=
iconv
(
'gbk'
,
'utf-8'
,
$houseinfo
[
0
][
'forward'
]);
$house_type
=
iconv
(
'gbk'
,
'utf-8'
,
$house_type
);
if
(
$kind
==
3
){
$url
=
"http://crm.house365.com/index.php/Simulate/sea_utf8?mobile=
{
$phone
}
&city=
{
$city
}
&activefrom=485&my_floor=
{
$houseinfo
[
0
][
'floor'
]
}
&total_floor=
{
$houseinfo
[
0
][
'totalfloor'
]
}
&block_name=
{
$houseinfo
[
0
][
'blockshowname'
]
}
&area=
{
$houseinfo
[
0
][
'buildarea'
]
}
&forward=
{
$houseinfo
[
0
][
'forward'
]
}
&buy_old_property=
{
$houseinfo
[
0
][
'infotype'
]
}
&house_type=
{
$house_type
}
"
;
$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
);
}
//验证不在白名单,不在推送库,不在推送历史库
$result2
=
$this
->
push_model
->
yzpush
(
$telno
);
if
(
$result2
<=
0
&&
$city
==
'nj'
){
//加入备选库
//$this->push_model->addalternatives($uid,$telno);
}
}
elseif
(
$return
==
0
){
$result
=
0
;
$msg
=
'收藏失败'
;
}
$return_array
=
array
(
'result'
=>
$result
,
'msg'
=>
$msg
);
echo
serialize
(
$return_array
);
}
...
...
esf_core/models/user_model.php
View file @
08ba82ed
...
@@ -878,6 +878,20 @@ class User_model extends MY_Model
...
@@ -878,6 +878,20 @@ class User_model extends MY_Model
}
}
}
}
/**
* 通过base_id查询用户关注房源的房源id
* @param type $base_id
* @return string
*/
function
getCollectHouseIdByBaseID
(
$base_id
,
$kind
,
$city
=
GB_CITY
){
$return
=
$this
->
get_data
(
array
(
'form_name'
=>
'personal_collection'
,
'where_in'
=>
array
(
'base_id'
=>
$base_id
),
'where'
=>
array
(
'kind'
=>
$kind
,
'city_name'
=>
$city
),
'select'
=>
array
(
'collect_id'
)),
'esfbak'
);
if
(
!
empty
(
$return
)){
return
$return
;
}
else
{
return
array
();
}
}
/**
/**
* 查询是否有此用户
* 查询是否有此用户
...
@@ -945,6 +959,26 @@ class User_model extends MY_Model
...
@@ -945,6 +959,26 @@ class User_model extends MY_Model
return
$result
;
return
$result
;
}
}
/**
* 添加关注
* @param string $base_id
* @param string $collect_id
* @return string
*/
function
addcollectByBaseID
(
$base_id
,
$collect_id
,
$kind
,
$collect_value
,
$city
=
GB_CITY
,
$infofrom
=
1
,
$passport_uid
=
0
,
$uid
=
0
)
{
//取base_id字符串中逗号前面的部分作为base_id
$base_id
=
explode
(
','
,
$base_id
);
$base_id
=
$base_id
[
0
];
$arr
=
array
(
'base_id'
=>
$base_id
,
'uid'
=>
$uid
,
'collect_id'
=>
$collect_id
,
'kind'
=>
$kind
,
'collect_value'
=>
$collect_value
,
'collect_time'
=>
time
(),
'city_name'
=>
$city
,
'infofrom'
=>
$infofrom
,
'passport_uid'
=>
$passport_uid
);
//设置表
$this
->
user_model
->
set_table
(
'personal_collection'
);
//过滤表结构
$result
=
$this
->
user_model
->
add
(
$arr
,
'esf'
);
return
$result
;
}
/**
/**
* 推广情况
* 推广情况
* @param type $uid
* @param type $uid
...
...
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