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
6b5ec2b5
Commit
6b5ec2b5
authored
Nov 08, 2024
by
yanghui
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_yh' into release_dev_107
parents
91283eb8
1db0e3f4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
151 additions
and
55 deletions
+151
-55
esf_center_api.php
center/controllers/esf_center_api.php
+103
-37
user.php
center/controllers/user.php
+14
-14
myorder.php
center/views/myorder.php
+13
-0
MY_Model.php
esf_core/core/MY_Model.php
+2
-1
function_helper.php
esf_core/helpers/function_helper.php
+0
-0
user_model.php
esf_core/models/user_model.php
+19
-3
No files found.
center/controllers/esf_center_api.php
View file @
6b5ec2b5
<?php
if
(
!
defined
(
'BASEPATH'
))
exit
(
'No direct script access allowed'
);
class
Esf_center_api
extends
MY_Controller
{
var
$newrent_host
=
'http://newrent.house365.com'
;
function
__construct
()
{
...
...
@@ -17,6 +18,13 @@ class Esf_center_api extends MY_Controller {
$this
->
load
->
model
(
'rent_coupon_model'
);
$this
->
city
=
''
;
$this
->
user_id
=
0
;
//根据ip是否是127开头判断是否是测试环境
if
(
substr
(
$_SERVER
[
'REMOTE_ADDR'
],
0
,
3
)
==
'127'
)
{
$this
->
newrent_host
=
'http://newrentlocal.house365.com'
;
}
}
...
...
@@ -113,6 +121,25 @@ class Esf_center_api extends MY_Controller {
$telno
=
$this
->
input
->
get
(
'telno'
);
$uid
=
$this
->
user_model
->
yztelno
(
$telno
);
}
$url
=
$this
->
newrent_host
.
'/api/tf-app-ext/add-house-collect'
;
$postData
=
array
(
'house_id'
=>
$this
->
input
->
get
(
'rowid'
),
'tbl'
=>
$this
->
input
->
get
(
'kind'
)
==
3
?
'sell'
:
'rent'
,
'city'
=>
$this
->
input
->
get
(
'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
();
$flag
=
$this
->
input
->
get
(
'flag'
);
if
(
empty
(
$flag
))
{
...
...
@@ -127,12 +154,15 @@ class Esf_center_api extends MY_Controller {
$city
=
$this
->
input
->
get
(
'city'
);
$city
=
$city
?
$city
:
'nj'
;
$tbl
=
$kind
==
3
?
'sell'
:
'rent'
;
$result
=
$this
->
user_model
->
getusercollectid
(
$uid
,
$rowid
,
$city
);
//已关注此房源
if
(
$result
[
'id'
]
>
0
)
{
$return
=
'N_COL'
;
if
(
$uid
){
$result
=
$this
->
user_model
->
getusercollectid
(
$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'
,
'averprice'
),
'limit'
=>
1
),
'esfhousebak'
);
}
else
{
...
...
@@ -968,8 +998,9 @@ class Esf_center_api extends MY_Controller {
public
function
api_getsaveblock
()
{
$telno
=
$this
->
input
->
get
(
'telno'
);
$base_id
=
$this
->
input
->
get
(
'base_id'
);
if
(
!
$base_id
)
$uid
=
$this
->
user_model
->
yztelno
(
$telno
);
if
(
$uid
==
0
)
{
echo
serialize
(
array
());
exit
;
}
...
...
@@ -981,8 +1012,8 @@ class Esf_center_api extends MY_Controller {
$page
=
$page
?
$page
:
1
;
$pagesize
=
$pagesize
?
$pagesize
:
20
;
$offset
=
$pagesize
*
(
$page
-
1
);
$collect_array
=
$this
->
user_model
->
getcollectByBaseId
(
$kind
,
$base_id
,
$offset
,
$pagesize
,
$city
);
$collect_array
=
$this
->
user_model
->
getcollect
(
$kind
,
$uid
,
$offset
,
$pagesize
,
$city
);
if
(
!
empty
(
$collect_array
)
&&
is_array
(
$collect_array
))
{
foreach
(
$collect_array
as
$key
=>
$value
)
...
...
@@ -1258,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
);
//已关注此房源
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
);
$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
();
// $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);
}
/**
...
...
@@ -3480,4 +3531,18 @@ class Esf_center_api extends MY_Controller {
return
true
;
}
public
function
test
(){
$transactionId
=
$_GET
[
'trans_id'
];
if
(
!
$transactionId
){
echo
'error'
;
exit
;
}
$this
->
load
->
model
(
"package_model"
);
$orderInfo
=
$this
->
package_model
->
getOrderInfoByTransactionId
(
$transactionId
);
if
(
empty
(
$orderInfo
)){
echo
'no order'
;
exit
;
}
$this
->
sendMsg
(
$orderInfo
);
echo
'ok'
;
exit
;
}
}
\ No newline at end of file
center/controllers/user.php
View file @
6b5ec2b5
...
...
@@ -1868,12 +1868,9 @@ class User extends MY_Controller
}
else
{
if
(
$item
[
'property_type'
]
==
$infoType
&&
$item
[
'day'
]
==
$day
){
$price
=
$originalPrice
=
floatval
(
$item
[
'price'
]);
if
(
GB_CITY
==
'wh'
&&
$packageType
==
2
){
//处理折扣
if
(
isset
(
$item
[
'discount'
])
&&
$item
[
'discount'
]
>
0
){
$price
=
$originalPrice
=
$this
->
pirceDiscount
(
$price
,
$item
[
'discount'
]);
}
//处理折扣
if
(
isset
(
$item
[
'discount'
])
&&
$item
[
'discount'
]
>
0
){
$price
=
$originalPrice
=
$this
->
pirceDiscount
(
$price
,
$item
[
'discount'
]);
}
// 列表套餐8折券使用 20200507
// 优惠券修改为 6折
...
...
@@ -2408,19 +2405,22 @@ class User extends MY_Controller
$data
[
'conf_where'
]
=
'myorder'
;
$data
[
'title'
]
=
'我的订单'
;
$data
[
'qrImg'
]
=
$this
->
user_model
->
getBuyQrImg
(
$this
->
user_id
);
$data
[
'pagesize'
]
=
10
;
//记录每页的条数
$data
[
'page'
]
=
$this
->
uri
->
segment
(
3
)
?
intval
(
$this
->
uri
->
segment
(
3
))
:
1
;
// 获取当前页数
if
(
1
==
2
)
{
$data
[
'pagesize'
]
=
10
;
//记录每页的条数
$data
[
'page'
]
=
$this
->
uri
->
segment
(
3
)
?
intval
(
$this
->
uri
->
segment
(
3
))
:
1
;
// 获取当前页数
$data
[
'totalsize'
]
=
$this
->
user_model
->
myorder_count
(
$this
->
user_id
);
//记录总数
$data
[
'totalsize'
]
=
$this
->
user_model
->
myorder_count
(
$this
->
user_id
);
//记录总数
$data
[
'totalpage'
]
=
ceil
(
$data
[
'totalsize'
]
/
$data
[
'pagesize'
]);
$data
[
'totalpage'
]
=
ceil
(
$data
[
'totalsize'
]
/
$data
[
'pagesize'
]);
$orderdata
=
$this
->
user_model
->
myorder_list
(
$this
->
user_id
,
$data
[
'page'
],
$data
[
'pagesize'
]);
$orderdata
=
$this
->
user_model
->
myorder_list
(
$this
->
user_id
,
$data
[
'page'
],
$data
[
'pagesize'
]);
$invoiceUrlArr
=
$this
->
user_model
->
getInvoiceUrlArr
(
$orderdata
);
$data
[
'orders'
]
=
$orderdata
;
$data
[
'invoice_url_arr'
]
=
$invoiceUrlArr
;
$invoiceUrlArr
=
$this
->
user_model
->
getInvoiceUrlArr
(
$orderdata
);
$data
[
'orders'
]
=
$orderdata
;
$data
[
'invoice_url_arr'
]
=
$invoiceUrlArr
;
}
$this
->
load
->
view
(
'myorder'
,
$data
);
}
...
...
center/views/myorder.php
View file @
6b5ec2b5
...
...
@@ -8,6 +8,11 @@
.user-nav
a
.nav7
{
background-position
:
13px
-695px
;}
.user-nav-mod.on
a
.nav7
{
background-position
:
13px
-763px
;
background-color
:
#fff
;}
.mt10
{
margin-top
:
10px
;}
/** 二维码 **/
.qr_code
{
width
:
100%
;
text-align
:
center
;
margin-top
:
20px
;}
.qr_code
.title
{
font-size
:
15px
;
color
:
#333333
;
margin-bottom
:
30px
;
font-weight
:
bold
;}
.qr_code
.content
img
{
width
:
210px
;}
</style>
<div
class=
"w960 clearfix mt10 pepcenterBox"
>
<?php
require
APPPATH_MVC
.
'views/left.php'
;
?>
...
...
@@ -21,6 +26,13 @@
<div
class=
"user-main user-main03 mt10"
>
<div
class=
"mod-list statistical"
>
<div
class=
"qr_code"
>
<div
class=
"title"
>
请使用微信扫描下方二维码
</div>
<div
class=
"content"
>
<img
src=
"
<?=
$qrImg
?>
"
/>
</div>
</div>
<?php
if
(
1
==
2
){
?>
<?php
if
(
count
(
$orders
)
>
0
){
?>
<table
width=
"100%"
border=
"0"
cellspacing=
"0"
cellpadding=
"0"
class=
"table-style-a acenter"
>
<tr>
...
...
@@ -66,6 +78,7 @@
<div
class=
"no-result"
>
目前您还没有订单哦。
</div>
</div>
<?php
}
?>
<?php
}
?>
</div>
</div>
</form>
...
...
esf_core/core/MY_Model.php
View file @
6b5ec2b5
...
...
@@ -135,7 +135,8 @@ class MY_Model extends CI_Model
public
function
findAll
()
{
$list
=
array
();
$query
=
$this
->
db
->
get
(
$this
->
form_name
);
$result
=
$query
->
result_array
();
// $result = $query->result_array();
$result
=
$query
->
num_rows
>
0
?
$query
->
result_array
()
:
array
();
$sqls
=
$this
->
db
->
last_query
();
//echo "<!--$sqls-->";
//echo $this->db->last_query();exit;
...
...
esf_core/helpers/function_helper.php
View file @
6b5ec2b5
This diff is collapsed.
Click to expand it.
esf_core/models/user_model.php
View file @
6b5ec2b5
...
...
@@ -846,8 +846,11 @@ class User_model extends MY_Model
$where_string
.=
" and kind =
$kind
"
;
}
$return
=
$this
->
get_data
(
array
(
'form_name'
=>
'personal_collection'
,
'where'
=>
$where_string
,
'select'
=>
array
(
'id'
)),
'esf'
);
// $return = $this->get_data(array('form_name' => 'personal_collection','where'=>$where_string,'select'=>array('id')),'esf');
$sql
=
"select id from personal_collection where "
.
$where_string
;
$query
=
$this
->
db_esfbak
->
query
(
$sql
);
$return
=
$query
->
result_array
();
writelog
(
':查询用户是否收藏: '
.
print_r
(
$return
,
1
),
'fangliyan_'
.
date
(
'd'
)
);
if
(
!
empty
(
$return
[
0
]))
{
return
$return
[
0
];
...
...
@@ -988,6 +991,7 @@ class User_model extends MY_Model
//取第一个
$one_base_id
=
explode
(
','
,
$base_id
);
$arr
=
array
(
'base_id'
=>
$one_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
);
writelog
(
':保存收藏addcollect: '
.
print_r
(
$arr
,
1
),
'fangliyan_'
.
date
(
'd'
)
);
//设置表
$this
->
user_model
->
set_table
(
'personal_collection'
);
//过滤表结构
...
...
@@ -6359,7 +6363,7 @@ if($searcharr['infotype']==4){
}
}
$base_id_url
=
'http://
local
newrent.house365.com/api/tf-app/get-base-id?keyword='
.
$passport_uid
;
$base_id_url
=
'http://newrent.house365.com/api/tf-app/get-base-id?keyword='
.
$passport_uid
;
$base_id
=
curl_get_contents
(
$base_id_url
);
$res
=
$base_id
;
...
...
@@ -6380,4 +6384,15 @@ if($searcharr['infotype']==4){
return
$res
;
}
//获取用户购买二维码
public
function
getBuyQrImg
(
$uid
){
$url
=
'http://newrentlocal.house365.com/api/tf-app-ext/get-order-qrimg?user_id='
.
$uid
;
$result
=
curl_get_contents
(
$url
);
$result
=
$result
?
json_decode
(
$result
,
1
)
:
array
();
if
(
empty
(
$result
)
||
empty
(
$result
[
'data'
])){
return
''
;
}
return
$result
[
'data'
][
'qrimg'
];
}
}
\ No newline at end of file
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