Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
fenzhan_zsb
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
esf
fenzhan_zsb
Commits
41b3df8a
Commit
41b3df8a
authored
Jun 30, 2020
by
zhangkuanguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VR申请
parent
d26c99be
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
882 additions
and
94 deletions
+882
-94
new_base_model.php
new_admincp/applications/models/new_base_model.php
+97
-0
zsb_api_model.php
new_admincp/applications/models/zsb_api_model.php
+3
-1
config.php
new_admincp/applications/zsb/config/config.php
+3
-2
config_hf.php
new_admincp/applications/zsb/config/config_hf.php
+2
-0
sell.php
new_admincp/applications/zsb/controllers/sell.php
+26
-17
vr_model.php
new_admincp/applications/zsb/models/vr_model.php
+678
-0
sell_manage.php
new_admincp/applications/zsb/views/nj/sell_manage.php
+73
-74
No files found.
new_admincp/applications/models/new_base_model.php
0 → 100644
View file @
41b3df8a
<?php
class
new_base_model
extends
MY_Model
{
public
$userSession
;
public
$CI
;
public
$broker_account_id
;
public
$uid
;
public
$username
;
public
$agentcode
;
public
$truename
;
public
$package_id
;
public
function
__construct
()
{
parent
::
__construct
(
1
,
1
,
1
);
$this
->
CI
=
&
get_instance
();
$this
->
CI
->
load
->
library
(
'session'
);
$this
->
userSession
=
$this
->
CI
->
session
->
userdata
(
USER_SESSION_KEY
);
$this
->
broker_account_id
=
$this
->
userSession
[
'broker_account_id'
];
$this
->
uid
=
$this
->
userSession
[
'uid'
];
$this
->
username
=
$this
->
userSession
[
'username'
];
$this
->
truename
=
$this
->
userSession
[
'truename'
];
$this
->
agentcode
=
$this
->
userSession
[
'agentcode'
];
$this
->
package_id
=
$this
->
userSession
[
'package_id'
];
}
public
function
newException
(
$msg
=
''
,
$state
=
0
,
$data
=
array
(),
$return_array
=
false
){
try
{
throw
new
Exception
(
$msg
,
$state
);
}
catch
(
Exception
$e
){
return
$this
->
asJson
(
$data
,
$e
->
getMessage
(),
$e
->
getCode
(),
$return_array
);
}
}
public
function
asJson
(
$data
,
$msg
,
$state
,
$return_array
){
$return
=
array
(
'code'
=>
$state
,
'msg'
=>
iconv
(
'gbk'
,
'utf-8'
,
$msg
),
'data'
=>
$data
);
if
(
$return_array
){
return
$return
;
}
echo
json_encode
(
$return
);
die
;
}
function
gbk2utf8
(
$data
){
foreach
(
$data
as
$k
=>
$v
){
$data
[
$k
]
=
iconv
(
'gbk'
,
'utf-8'
,
$v
);
}
return
$data
;
}
function
stringUncode
(
$msg
,
$incode
=
'GBK'
,
$outcode
=
'UTF-8'
){
if
(
!
$msg
){
return
''
;
}
$msg
=
iconv
(
$incode
,
$outcode
,
$msg
);
return
$msg
;
}
public
function
checkParam
(
$param
=
array
(),
$filed
=
array
()){
foreach
(
$filed
as
$v
){
if
(
!
array_key_exists
(
$v
,
$param
)
||
strlen
(
$param
[
$v
])
<=
0
){
$this
->
newException
(
$v
.
'Ϊ'
);
}
}
}
public
function
getClientIp
(){
$ip
=
$_SERVER
[
"REMOTE_ADDR"
];
if
(
!
empty
(
$_SERVER
[
"HTTP_X_FORWARDED_FOR"
]))
{
$tip
=
explode
(
","
,
$_SERVER
[
"HTTP_X_FORWARDED_FOR"
]);
$ip
=
$tip
[
0
];
}
return
(
trim
(
$ip
));
}
public
function
kefuTel
(){
}
}
\ No newline at end of file
new_admincp/applications/models/zsb_api_model.php
View file @
41b3df8a
...
@@ -20,6 +20,8 @@ class zsb_api_model extends MY_Model{
...
@@ -20,6 +20,8 @@ class zsb_api_model extends MY_Model{
'reportRecord'
=>
'/zsbapi/house/report-record'
,
//举报记录
'reportRecord'
=>
'/zsbapi/house/report-record'
,
//举报记录
'reportRecordAppeal'
=>
'/zsbapi/house/report-record-appeal'
,
//申诉记录展示
'reportRecordAppeal'
=>
'/zsbapi/house/report-record-appeal'
,
//申诉记录展示
'realHouseAppeal'
=>
'/zsbapi/house/real-house-appeal'
,
//房源举报申诉
'realHouseAppeal'
=>
'/zsbapi/house/real-house-appeal'
,
//房源举报申诉
'vr_check'
=>
'/zsbapi/broker/vr-add-before'
,
//VR申请校验
'vr_add'
=>
'/zsbapi/broker/vr-add'
,
//VR申请提交
);
);
...
@@ -56,7 +58,7 @@ class zsb_api_model extends MY_Model{
...
@@ -56,7 +58,7 @@ class zsb_api_model extends MY_Model{
$url
=
$this
->
getApiFullUrl
(
$key
);
$url
=
$this
->
getApiFullUrl
(
$key
);
$token
=
$this
->
getToken
();
$token
=
$this
->
getToken
();
$aHeader
=
array
(
'token:'
.
$token
);
$aHeader
=
array
(
'token:'
.
$token
);
$response
=
$this
->
httpRequest
(
$url
,
$aHeader
,
$param
);
$response
=
$this
->
httpRequest
(
$url
,
$aHeader
,
$param
);
$response
=
json_decode
(
$response
,
true
);
$response
=
json_decode
(
$response
,
true
);
return
$response
;
return
$response
;
}
}
...
...
new_admincp/applications/zsb/config/config.php
View file @
41b3df8a
...
@@ -595,4 +595,6 @@ $config['imageType'] = array(
...
@@ -595,4 +595,6 @@ $config['imageType'] = array(
'6'
=>
'其他'
'6'
=>
'其他'
);
);
//开通放心看权限 0关闭,1开通
//开通放心看权限 0关闭,1开通
$config
[
'is_open_real_house'
]
=
0
;
$config
[
'is_open_real_house'
]
=
0
;
\ No newline at end of file
//申请VR开放
$config
[
'vr_applay'
]
=
0
;
new_admincp/applications/zsb/config/config_hf.php
View file @
41b3df8a
...
@@ -691,3 +691,5 @@ $config['housebeanExpirationTimeType'] = array(
...
@@ -691,3 +691,5 @@ $config['housebeanExpirationTimeType'] = array(
//核验码需要验证的区属
//核验码需要验证的区属
$config
[
'rentCheckCode'
]
=
array
(
'新站区'
,
'蜀山区'
,
'高新区'
,
'包河区'
,
'庐阳区'
,
'瑶海区'
,
'政务区'
,
'经开区'
,
'滨湖区'
);
$config
[
'rentCheckCode'
]
=
array
(
'新站区'
,
'蜀山区'
,
'高新区'
,
'包河区'
,
'庐阳区'
,
'瑶海区'
,
'政务区'
,
'经开区'
,
'滨湖区'
);
//申请VR开放
$config
[
'vr_applay'
]
=
1
;
new_admincp/applications/zsb/controllers/sell.php
View file @
41b3df8a
...
@@ -4026,6 +4026,8 @@ class Sell extends MY_Controller {
...
@@ -4026,6 +4026,8 @@ class Sell extends MY_Controller {
public
function
manage
(
$house_esta
=
'active'
,
$page
=
1
)
public
function
manage
(
$house_esta
=
'active'
,
$page
=
1
)
{
{
$realHouse
=
$this
->
config
->
item
(
'is_open_real_house'
);
$realHouse
=
$this
->
config
->
item
(
'is_open_real_house'
);
//VR申请按钮
$vr_applay
=
$this
->
config
->
item
(
'vr_applay'
);
//post参数
//post参数
$post_param
=
$this
->
input
->
post
(
NULL
,
TRUE
);
$post_param
=
$this
->
input
->
post
(
NULL
,
TRUE
);
...
@@ -4067,12 +4069,7 @@ class Sell extends MY_Controller {
...
@@ -4067,12 +4069,7 @@ class Sell extends MY_Controller {
//加载房源类
//加载房源类
$this
->
load
->
model
(
'sell_model'
);
$this
->
load
->
model
(
'sell_model'
);
//VR申请是否达到上线
$svrshow
=
$this
->
sell_model
->
checkBrokerApplay
(
$uid
);
//当前经纪人是否放心看经纪人
//当前经纪人是否放心看经纪人
$isreal
=
$this
->
sell_model
->
checkisreal
(
$uid
);
$isreal
=
$this
->
sell_model
->
checkisreal
(
$uid
);
...
@@ -4207,12 +4204,6 @@ class Sell extends MY_Controller {
...
@@ -4207,12 +4204,6 @@ class Sell extends MY_Controller {
$data_info
[
$key
][
'vr_status'
]
=
$applay
[
'shot_status'
];
$data_info
[
$key
][
'vr_status'
]
=
$applay
[
'shot_status'
];
$data_info
[
$key
][
'shot_name'
]
=
$applay
[
'shot_name'
];
$data_info
[
$key
][
'shot_name'
]
=
$applay
[
'shot_name'
];
$data_info
[
$key
][
'shot_telno'
]
=
$applay
[
'telno'
];
$data_info
[
$key
][
'shot_telno'
]
=
$applay
[
'telno'
];
//房源位置
$data_info
[
$key
][
'vr_applay_show'
]
=
0
;
if
(
in_array
(
$value
[
'district'
],
$vr_show_district
)){
$data_info
[
$key
][
'vr_applay_show'
]
=
1
;
}
$infotype
=
$value
[
'infotype'
];
$infotype
=
$value
[
'infotype'
];
$is_show_real
=
0
;
$is_show_real
=
0
;
...
@@ -4649,7 +4640,7 @@ class Sell extends MY_Controller {
...
@@ -4649,7 +4640,7 @@ class Sell extends MY_Controller {
$data
[
'page'
]
=
$this
->
_current_page
;
$data
[
'page'
]
=
$this
->
_current_page
;
$data
[
'pagination'
]
=
$pagination
;
$data
[
'pagination'
]
=
$pagination
;
$data
[
'total_count'
]
=
$this
->
_total_count
;
$data
[
'total_count'
]
=
$this
->
_total_count
;
$data
[
'vr_applay'
]
=
$vr_applay
;
switch
(
$house_esta
){
switch
(
$house_esta
){
case
'active'
:
case
'active'
:
$ga_title
=
'激活房源'
;
$ga_title
=
'激活房源'
;
...
@@ -4812,7 +4803,6 @@ class Sell extends MY_Controller {
...
@@ -4812,7 +4803,6 @@ class Sell extends MY_Controller {
$data
[
'tishi'
]
=
$this
->
guojie
();
$data
[
'tishi'
]
=
$this
->
guojie
();
$data
[
'svrshow'
]
=
$svrshow
;
$data
[
'isreal'
]
=
$isreal
;
$data
[
'isreal'
]
=
$isreal
;
//加载模板
//加载模板
...
@@ -6871,14 +6861,13 @@ class Sell extends MY_Controller {
...
@@ -6871,14 +6861,13 @@ class Sell extends MY_Controller {
}
}
function
vrapplay
(){
function
vrapplay
(){
$rowid
=
$this
->
input
->
post
(
'
row
id'
,
TRUE
);
$rowid
=
$this
->
input
->
post
(
'
h
id'
,
TRUE
);
$data
=
$this
->
input
->
post
();
$data
=
$this
->
input
->
post
();
//验证房源编号和提交验证码
//验证房源编号和提交验证码
if
(
intval
(
$rowid
)
>
0
)
{
if
(
intval
(
$rowid
)
>
0
)
{
//初始化房源操作类
//初始化房源操作类
$this
->
load
->
model
(
'sell_model'
);
$this
->
load
->
model
(
'vr_model'
);
$vra
=
$this
->
sell_model
->
vrApplay
(
$data
);
$vra
=
$this
->
vr_model
->
vr_applay
(
$data
);
$vra
=
$this
->
gbk2utf8
(
$vra
);
echo
json_encode
(
$vra
);
echo
json_encode
(
$vra
);
die
;
die
;
...
@@ -6952,7 +6941,27 @@ class Sell extends MY_Controller {
...
@@ -6952,7 +6941,27 @@ class Sell extends MY_Controller {
die
;
die
;
}
}
/*
* vr绑定前验证
*/
public
function
check_vr_new
(){
$rowid
=
$this
->
input
->
post
(
'hid'
,
TRUE
);
if
(
intval
(
$rowid
)
>
0
)
{
$post
=
$this
->
input
->
post
();
//初始化房源操作类
$this
->
load
->
model
(
'vr_model'
);
$vra
=
$this
->
vr_model
->
check_vr_new
(
$post
);
echo
json_encode
(
$vra
);
die
;
}
$result
[
'result'
]
=
0
;
$result
[
'msg'
]
=
'参数错误'
;
$result
=
$this
->
gbk2utf8
(
$result
);
echo
json_encode
(
$result
);
die
;
}
/**
/**
* 中文 转码
* 中文 转码
* @param $data
* @param $data
...
...
new_admincp/applications/zsb/models/vr_model.php
0 → 100644
View file @
41b3df8a
<?php
load_m
(
'new_base_model'
);
class
vr_model
extends
new_base_model
{
public
function
__construct
()
{
parent
::
__construct
();
}
/*
* vr 申请校验
*/
public
function
check_vr_new
(
$param
=
array
()){
$this
->
load
->
model
(
'zsb_api_model'
);
$res
=
$this
->
zsb_api_model
->
getRequrstData
(
'vr_check'
,
$param
);
return
$res
;
}
/*
* VR 申请提交
*/
public
function
vr_applay
(
$param
){
$this
->
load
->
model
(
'zsb_api_model'
);
$res
=
$this
->
zsb_api_model
->
getRequrstData
(
'vr_add'
,
$param
);
return
$res
;
}
/*
* code 1是自由绑定,无须付费,2:扣除房豆,并返还房豆 3,扣除房豆
*
*/
public
function
check_vr
(
$param
=
array
(),
$return_array
=
false
){
$this
->
checkParam
(
$param
,
array
(
'rowid'
,
'buildingnum'
,
'unitnum'
,
'roomnum'
));
$house_id
=
$param
[
'rowid'
];
$buildingnum
=
$param
[
'buildingnum'
];
$unitnum
=
$param
[
'unitnum'
];
$roomnum
=
$param
[
'roomnum'
];
$this
->
load
->
model
(
'broker_model'
);
$house
=
$this
->
checkHouse
(
$house_id
);
if
(
!
$house
){
return
$this
->
newException
(
'房源异常'
,
0
,
array
(),
$return_array
);
}
if
(
$this
->
package_id
==
199
){
return
$this
->
newException
(
'免费账号不能购买增值服务,请先购买套餐'
,
0
,
array
(),
$return_array
);
}
$infotype
=
$house
[
'infotype'
];
if
(
!
in_array
(
$infotype
,
array
(
1
,
2
,
7
))){
return
$this
->
newException
(
'VR拍摄只支持住宅、别墅、公寓类型'
,
0
,
array
(),
$return_array
);
}
$district
=
$house
[
'district'
];
if
(
in_array
(
$district
,
array
(
'高淳区'
,
'溧水区'
))){
return
$this
->
newException
(
'该区属房源暂不支持vr拍摄'
,
0
,
array
(),
$return_array
);
}
if
(
!
empty
(
$param
[
'order_date'
])){
$this
->
check_vr_count
(
$param
[
'order_date'
]);
}
$blockid
=
$house
[
'blockid'
];
//独家代理
$param
[
'blockid'
]
=
$blockid
;
$res
=
$this
->
vr_applay_sole
(
$param
);
if
(
!
$res
[
'code'
]){
return
$this
->
newException
(
$res
[
'msg'
],
0
,
array
(),
$return_array
);
}
$this
->
check_vr_status
(
$house_id
);
$bean
=
$this
->
getVrConf
(
'vr_applay_bean'
);
//对特定的绑定不允许别人绑定
if
(
$blockid
==
'281305'
&&
strtoupper
(
$buildingnum
)
==
'A'
&&
$unitnum
==
'0'
&&
$room_num
=
'1002'
){
if
(
$this
->
uid
!=
'859349'
){
return
$this
->
newException
(
'该套房源无VR效果绑定服务,快去申请其他房源吧!'
,
0
,
array
(),
$return_array
);
}
}
if
(
$blockid
==
'480'
&&
strtoupper
(
$buildingnum
)
==
'A'
&&
$unitnum
==
'0'
&&
$room_num
=
'606'
){
if
(
$this
->
uid
!=
'910896'
){
return
$this
->
newException
(
'该套房源无VR效果绑定服务,快去申请其他房源吧!'
,
0
,
array
(),
$return_array
);
}
}
//自己,无需花钱
$vr_applay_record
=
$this
->
getVrRecord
(
$this
->
uid
,
$blockid
,
$buildingnum
,
$unitnum
,
$roomnum
);
if
(
$vr_applay_record
){
return
$this
->
newException
(
'该房源已有绑定记录,是否直接绑定?'
,
1
,
array
(),
$return_array
);
}
$vr_applay
=
$this
->
getVrModel
(
$blockid
,
$buildingnum
,
$unitnum
,
$roomnum
);
//花钱支付
if
(
$vr_applay
){
if
(
$vr_applay
[
'user_id'
]
==
$this
->
uid
){
return
$this
->
newException
(
'该房源已有绑定记录,是否直接绑定?'
,
1
,
array
(),
$return_array
);
}
$bean
=
$vr_applay
[
'pay_bean'
];
return
$this
->
newException
(
'该房源已有对应房源VR,是否支付'
.
$bean
.
'房豆进行绑定?'
,
2
,
$vr_applay
,
$return_array
);
}
$waring
=
"<span style='color: red'>您好,请确认房源信息,如因您的失误导致服务未达成!房豆将不返还哦!</span><br/>"
;
return
$this
->
newException
(
$waring
.
'预约申请将扣除'
.
$bean
.
'房豆。拍摄成功后他人申请绑定该VR时,您将可获得对应豆房奖励,是否确认支付?'
,
3
,
array
(
'pay_bean'
=>
$bean
),
$return_array
);
}
/*
* vr 独家代理限制
* 规则:个人房源限制,则不允许所有人申请,经纪人限制:只能自己绑定,公司代理:同公司下可绑定
*/
public
function
vr_applay_sole
(
$param
=
array
()){
$blockid
=
$param
[
'blockid'
];
$buildingnum
=
$param
[
'buildingnum'
];
$unitnum
=
$param
[
'unitnum'
];
$roomnum
=
$param
[
'roomnum'
];
//个人独家代理,不允许经纪人绑定
$count1
=
$this
->
dbback
->
from
(
'vr_applay_sole'
)
->
where
(
array
(
'block_id'
=>
$blockid
,
'building'
=>
$buildingnum
,
'unit'
=>
$unitnum
,
'room_num'
=>
$roomnum
,
'type'
=>
2
,
'status'
=>
1
))
->
count_all_results
();
if
(
$count1
){
return
array
(
'code'
=>
0
,
'msg'
=>
'此套房源已提供独家代理,快去申请其他房源吧!'
);
}
//经纪人独家代理
$date
=
date
(
'Y-m-d'
);
$result
=
$this
->
dbback
->
from
(
'vr_applay_sole'
)
->
where
(
array
(
'block_id'
=>
$blockid
,
'building'
=>
$buildingnum
,
'unit'
=>
$unitnum
,
'room_num'
=>
$roomnum
,
'type'
=>
1
,
'status >'
=>
0
,
'end_time >='
=>
$date
))
->
get
()
->
result_array
();
$uids
=
array
();
$agentcodes
=
array
();
foreach
(
$result
as
$key
=>
$value
){
$uid
=
$value
[
'user_id'
];
$agentcode
=
$value
[
'agentcode'
];
$status
=
$value
[
'status'
];
if
(
$status
==
1
){
array_push
(
$uids
,
$uid
);
}
else
{
array_push
(
$agentcodes
,
$agentcode
);
}
}
//公司代理
$getAllAgentCode
=
$this
->
getAllAgentCode
();
$res
=
array_intersect
(
$agentcodes
,
$getAllAgentCode
);
if
(
!
in_array
(
$this
->
uid
,
$uids
)
&&
$uids
||
!
$res
&&
$agentcodes
){
return
array
(
'code'
=>
0
,
'msg'
=>
'此套房源已提供独家代理,快去申请其他房源吧!'
);
}
return
array
(
'code'
=>
1
,
'msg'
=>
'可以申请'
);
}
/*
* 绑定VR
*/
public
function
vr_bind
(
$param
=
array
()){
$this
->
checkParam
(
$param
,
array
(
'rowid'
,
'buildingnum'
,
'unitnum'
,
'roomnum'
));
$param
[
'buildingnum'
]
=
$this
->
str_iconv
(
$param
[
'buildingnum'
]);
$param
[
'unitnum'
]
=
$this
->
str_iconv
(
$param
[
'unitnum'
]);
$param
[
'roomnum'
]
=
$this
->
str_iconv
(
$param
[
'roomnum'
]);
$re
=
$this
->
check_vr
(
$param
,
true
);
$code
=
$re
[
'code'
];
$redata
=
$re
[
'data'
];
$param
[
'pay_bean'
]
=
0
;
//此时要检测是否是
if
(
in_array
(
$code
,
array
(
2
,
3
))){
$this
->
load
->
model
(
'bean_model'
);
$bean
=
$this
->
bean_model
->
getBeanNum
();
$pay_bean
=
$this
->
getVrConf
(
'vr_applay_bean'
);
if
(
$code
==
2
){
$pay_bean
=
$redata
[
'pay_bean'
];
}
if
(
$bean
<
$pay_bean
){
$this
->
newException
(
'剩余房豆不足,是否立即充值房豆?'
,
0
,
array
(
'url'
=>
'http://nj.zsb.house365.com/payment/recharge/'
));
}
$param
[
'pay_bean'
]
=
$pay_bean
;
}
$rs
=
$this
->
vr_bind_appay
(
$param
,
$code
);
$this
->
newException
(
$rs
[
'msg'
],
1
);
}
/*
* code 1是自由绑定,无须付费,2:扣除房豆,并返还房豆 3,扣除房豆
*/
private
function
vr_bind_appay
(
$param
=
array
(),
$code
){
$this
->
checkParam
(
$param
,
array
(
'rowid'
,
'buildingnum'
,
'unitnum'
,
'roomnum'
));
$house_id
=
$param
[
'rowid'
];
$buildingnum
=
$param
[
'buildingnum'
];
$unitnum
=
$param
[
'unitnum'
];
$roomnum
=
$param
[
'roomnum'
];
$house
=
$this
->
checkHouse
(
$house_id
);
$vr_applay_data
=
$this
->
vr_applay_data
(
$param
);
$block_id
=
$house
[
'blockid'
];
//无须扣除房豆,直接绑定
if
(
$code
==
1
){
$vrmodel
=
$this
->
getVrRecord
(
$this
->
uid
,
$block_id
,
$buildingnum
,
$unitnum
,
$roomnum
);
if
(
!
$vrmodel
){
$vrmodel
=
$this
->
getVrModel
(
$block_id
,
$buildingnum
,
$unitnum
,
$roomnum
);
}
$snyc_house_id
=
$vrmodel
[
'house_id'
];
//相似绑定的房源id
$vr_model_id
=
$vrmodel
[
'vr_model_id'
];
$vr_applay_data
[
'shot_status'
]
=
4
;
$vr_applay_data
[
'vr_model_id'
]
=
$vr_model_id
;
$vr_applay_data
[
'from_applay_first_id'
]
=
$vrmodel
[
'id'
];
$vr_applay_data
[
'order_time'
]
=
5
;
$insert_id
=
$this
->
add_vr_applay
(
$vr_applay_data
,
$snyc_house_id
);
if
(
!
$insert_id
){
$this
->
newException
(
'申请失败'
);
}
$this
->
snyc_vr_applay
(
$vr_applay_data
,
$insert_id
,
$snyc_house_id
);
return
array
(
'code'
=>
1
,
'msg'
=>
'您的房源VR已绑定成功'
);
}
$transaction_id
=
$vr_applay_data
[
'transaction_id'
];
$this
->
load
->
model
(
'bean_model'
);
$pay_bean
=
$this
->
getVrConf
(
'vr_applay_bean'
);
$pay_bean
=
empty
(
$param
[
'pay_bean'
])
?
$pay_bean
:
$param
[
'pay_bean'
];
$description
=
'申请VR扣除房豆'
.
$pay_bean
.
'(房源编号:'
.
$house_id
.
')'
;
//扣除房豆,处于待审核状态
if
(
$code
==
3
){
$vr_applay_data
[
'pay_bean'
]
=
$pay_bean
;
$vr_applay_data
[
'pay_state'
]
=
1
;
$insert_id
=
$this
->
add_vr_applay
(
$vr_applay_data
);
if
(
!
$insert_id
){
$this
->
newException
(
'申请失败,请重新尝试'
);
}
$re
=
$this
->
bean_model
->
payBean
(
$this
->
uid
,
'vrApplay'
,
$transaction_id
,
$pay_bean
,
$description
);
if
(
!
$re
[
'code'
]){
$msg
=
empty
(
$re
[
'msg'
])
?
'房豆扣除失败'
:
$re
[
'msg'
];
$vrupdate
[
'pay_state'
]
=
0
;
$vrupdate
[
'shot_status'
]
=
5
;
$vrupdate
[
'remark'
]
=
$msg
;
$this
->
db
->
where
(
array
(
'id'
=>
$insert_id
))
->
update
(
'vr_applay'
,
$vrupdate
);
$from
=
empty
(
$re
[
'from'
])
?
'0'
:
$re
[
'from'
];
if
(
$from
){
$this
->
newException
(
$re
[
'msg'
],
2
);
}
else
{
$this
->
newException
(
$re
[
'msg'
]);
}
}
return
array
(
'code'
=>
2
,
'msg'
=>
'恭喜您申请成功,请保持手机通畅,客服会尽快和你确定具体时间和地点,近期由于申请量巨大,我们最迟会在预约时间前1天和您联系。'
);
}
//扣除房豆,并奖励第一人
if
(
$code
==
2
){
$vrmodel
=
$this
->
getVrModel
(
$block_id
,
$buildingnum
,
$unitnum
,
$roomnum
);
$snyc_house_id
=
$vrmodel
[
'house_id'
];
//相似绑定的房源id
$vr_model_id
=
$vrmodel
[
'vr_model_id'
];
$vr_applay_data
[
'shot_status'
]
=
4
;
$vr_applay_data
[
'order_time'
]
=
5
;
$vr_applay_data
[
'vr_model_id'
]
=
$vr_model_id
;
$vr_applay_data
[
'pay_bean'
]
=
$pay_bean
;
$first_broker_uid
=
$vrmodel
[
'user_id'
];
$from_applay_first_id
=
$vrmodel
[
'id'
];
$vr_applay_data
[
'from_applay_first_id'
]
=
$from_applay_first_id
;
$applay_type
=
$vrmodel
[
'applay_type'
];
//1 经纪人,2个人
$is_return
=
empty
(
$vrmodel
[
'is_return'
])
?
0
:
$vrmodel
[
'is_return'
];
//已经获取奖励的人数
$return_first_bean
=
0
;
if
(
$is_return
&&
$applay_type
==
1
){
$count
=
$this
->
db
->
from
(
'vr_applay'
)
->
where
(
array
(
'from_applay_first_id'
=>
$from_applay_first_id
,
'return_first_bean >'
=>
0
,
'pay_state'
=>
1
))
->
count_all_results
();
$vr_applay_data
[
'pay_state'
]
=
1
;
$vr_applay_data
[
'from_applay_first_id'
]
=
$from_applay_first_id
;
if
(
$count
<=
0
){
$return_first_bean
=
10
;
}
else
if
(
$count
>=
1
&&
$count
<=
2
){
$return_first_bean
=
30
;
}
else
if
(
$count
==
3
){
$return_first_bean
=
60
;
}
else
{
$return_first_bean
=
10
;
}
}
$vr_applay_data
[
'return_first_bean'
]
=
$return_first_bean
;
$insert_id
=
$this
->
add_vr_applay
(
$vr_applay_data
,
$snyc_house_id
);
if
(
!
$insert_id
){
$this
->
newException
(
'申请失败了,请重新尝试'
);
}
$re
=
$this
->
bean_model
->
payBean
(
$this
->
uid
,
'vrApplay'
,
$transaction_id
,
$pay_bean
,
$description
);
if
(
!
$re
[
'code'
]){
$msg
=
empty
(
$re
[
'msg'
])
?
'房豆扣除失败'
:
$re
[
'msg'
];
$vrupdate
[
'pay_state'
]
=
0
;
$vrupdate
[
'shot_status'
]
=
5
;
$vrupdate
[
'remark'
]
=
$msg
;
$this
->
db
->
where
(
array
(
'id'
=>
$insert_id
))
->
update
(
'vr_applay'
,
$vrupdate
);
$from
=
empty
(
$re
[
'from'
])
?
'0'
:
$re
[
'from'
];
if
(
$from
){
$this
->
newException
(
$re
[
'msg'
],
2
);
}
else
{
$this
->
newException
(
$re
[
'msg'
]);
}
}
$this
->
snyc_vr_applay
(
$vr_applay_data
,
$insert_id
,
$snyc_house_id
);
if
(
$applay_type
==
1
&&
$is_return
){
//返回房豆
$description2
=
'VR奖励返还房豆'
.
$return_first_bean
.
'个'
;
$transaction_id_new
=
$this
->
orderNo
(
$first_broker_uid
,
'VR'
);
$this
->
bean_model
->
increaseBean
(
$first_broker_uid
,
'vrApplayReward'
,
$transaction_id_new
,
$return_first_bean
,
$description2
,
'赠送'
);
}
return
array
(
'code'
=>
1
,
'msg'
=>
'您的房源VR已绑定成功'
);
}
$this
->
newException
(
'申请已提交,出现异常'
);
}
public
function
add_vr_applay
(
$vr_applay_data
,
$snyc_house_id
=
''
){
$house_id
=
$vr_applay_data
[
'house_id'
];
$vr_model_id
=
$vr_applay_data
[
'vr_model_id'
];
$ok
=
$this
->
db
->
insert
(
'vr_applay'
,
$vr_applay_data
);
$insert_id
=
0
;
if
(
$ok
){
$insert_id
=
$this
->
db
->
insert_id
();
}
if
(
!
$insert_id
){
return
false
;
}
return
$insert_id
;
}
/*
* 同步 VR封面,室内图,户型图,模型id
*
* $issnyc 是否需要同步
*/
private
function
snyc_vr_applay
(
$vr_applay_data
,
$insert_id
,
$snyc_house_id
=
''
){
$house_id
=
$vr_applay_data
[
'house_id'
];
$vr_model_id
=
$vr_applay_data
[
'vr_model_id'
];
if
(
!
$insert_id
){
return
false
;
}
if
(
!
$snyc_house_id
){
return
$insert_id
;
}
//同步开始
$snyc_house_vr_image
=
$this
->
dbback
->
from
(
'vr_image'
)
->
where
(
array
(
'tbl'
=>
1
,
'houseid'
=>
$snyc_house_id
))
->
get
()
->
row_array
();
$vr_pic
=
''
;
//VR封面
$vr_house_layout
=
''
;
//VR户型图
$vr_room_images
=
''
;
//VR室内图
if
(
$snyc_house_vr_image
){
$vr_pic
=
$snyc_house_vr_image
[
'filename'
];
$vr_house_layout
=
$snyc_house_vr_image
[
'house_type_images'
];
$vr_room_images
=
$snyc_house_vr_image
[
'rom_images'
];
$vri
=
$this
->
dbback
->
from
(
'vr_image'
)
->
where
(
array
(
'tbl'
=>
1
,
'houseid'
=>
$house_id
))
->
get
()
->
row_array
();
$vr_imgs_data
[
'tbl'
]
=
1
;
$vr_imgs_data
[
'filename'
]
=
$vr_pic
;
$vr_imgs_data
[
'house_type_images'
]
=
$vr_house_layout
;
$vr_imgs_data
[
'rom_images'
]
=
$vr_room_images
;
$vr_imgs_data
[
'houseid'
]
=
$house_id
;
if
(
$vri
){
$this
->
db
->
where
(
array
(
'tbl'
=>
1
,
'houseid'
=>
$house_id
))
->
update
(
'vr_image'
,
$vr_imgs_data
);
}
else
{
$this
->
db
->
insert
(
'vr_image'
,
$vr_imgs_data
);
}
}
//同步户型图,室内图,VR模型等
$this
->
load
->
model
(
'sell_model'
);
//如果有户型图,户型图同步
if
(
$vr_house_layout
){
$house_typeims
[
0
]
=
$vr_house_layout
;
$this
->
sell_model
->
romupdate
(
$house_id
,
$house_typeims
,
0
);
}
$rom_images
=
array
();
if
(
!
empty
(
$vr_room_images
)){
$rom_images
=
json_decode
(
$vr_room_images
);
}
//室内图
if
(
$rom_images
){
$this
->
sell_model
->
romupdate
(
$house_id
,
$rom_images
,
2
);
}
$ups
[
'vr_model_id'
]
=
$vr_model_id
;
$ups
[
'isvr'
]
=
1
;
if
(
$vr_pic
){
$ups
[
'pic1'
]
=
$vr_pic
;
}
$sellok
=
$this
->
db
->
where
(
array
(
'id'
=>
$house_id
))
->
update
(
'sell'
,
$ups
);
if
(
!
$sellok
){
return
false
;
}
return
$insert_id
;
}
/*
* 组成vr申请data
*/
private
function
vr_applay_data
(
$param
=
array
()){
$house_id
=
$param
[
'rowid'
];
$buildingnum
=
$param
[
'buildingnum'
];
$unitnum
=
$param
[
'unitnum'
];
$roomnum
=
$param
[
'roomnum'
];
$houseinfo
=
$this
->
checkHouse
(
$house_id
);
$uid
=
$houseinfo
[
'uid'
];
$transaction_id
=
$this
->
orderNo
(
$uid
,
'VR'
);
$vr_applay_data
[
'broker_id'
]
=
$houseinfo
[
'uid'
];
$vr_applay_data
[
'transaction_id'
]
=
$transaction_id
;
$vr_applay_data
[
'block_id'
]
=
$houseinfo
[
'blockid'
];
$vr_applay_data
[
'broker_telno'
]
=
$houseinfo
[
'telno'
];
$vr_applay_data
[
'truename'
]
=
$this
->
userSession
[
'truename'
];
$vr_applay_data
[
'username'
]
=
$this
->
userSession
[
'username'
];
$agentcode
=
$this
->
userSession
[
'agentcode'
];
$agency
=
$this
->
dbback
->
where
(
array
(
'agentcode'
=>
$agentcode
))
->
get
(
'agency'
)
->
row_array
();
$vr_applay_data
[
'agentshortname'
]
=
$agency
[
'agentshortname'
];
$vr_applay_data
[
'house_id'
]
=
$house_id
;
$vr_applay_data
[
'house_type'
]
=
1
;
$vr_applay_data
[
'village_name'
]
=
$houseinfo
[
'blockshowname'
];
$vr_applay_data
[
'area'
]
=
$houseinfo
[
'district'
];
$vr_applay_data
[
'plate'
]
=
$houseinfo
[
'streetname'
];
$vr_applay_data
[
'building'
]
=
$buildingnum
;
$vr_applay_data
[
'unit'
]
=
$unitnum
;
$vr_applay_data
[
'room_num'
]
=
$roomnum
;
$real_status
=
$this
->
userSession
[
'real_status'
];
if
(
$real_status
>
0
){
$vr_applay_data
[
'applay_type'
]
=
1
;
}
else
{
$vr_applay_data
[
'applay_type'
]
=
2
;
}
$vr_applay_data
[
'save_time'
]
=
date
(
'Y-m-d H:i:s'
);
if
(
!
empty
(
$param
[
'agent_telno'
])){
$vr_applay_data
[
'broker_telno'
]
=
$param
[
'agent_telno'
];
}
if
(
!
empty
(
$param
[
'order_date'
])){
$vr_applay_data
[
'order_date'
]
=
$param
[
'order_date'
];
}
$vr_applay_data
[
'order_time'
]
=
0
;
if
(
!
empty
(
$param
[
'order_time'
])){
$vr_applay_data
[
'order_time'
]
=
$param
[
'order_time'
];
}
if
(
!
empty
(
$param
[
'blockshownameall'
])){
$blockshownameall
=
$param
[
'blockshownameall'
];
$blockshownameall
=
iconv
(
'utf-8'
,
'gbk'
,
$blockshownameall
);
$vr_applay_data
[
'remark'
]
=
$blockshownameall
;
}
return
$vr_applay_data
;
}
/*
* 取消VR
*/
public
function
cancleVr
(
$rowid
){
$applay
=
$this
->
dbback
->
from
(
'vr_applay'
)
->
where
(
array
(
'house_id'
=>
$rowid
,
'broker_id'
=>
$this
->
uid
))
->
order_by
(
'save_time desc'
)
->
get
()
->
row_array
();
if
(
$applay
){
$vrstatus
=
$applay
[
'shot_status'
];
$id
=
$applay
[
'id'
];
$pay_bean
=
$applay
[
'pay_bean'
];
$pay_state
=
$applay
[
'pay_state'
];
$transaction_id
=
$applay
[
'transaction_id'
];
//取消后退还房豆数
$return_bean_discount
=
$this
->
getVrConf
(
'vr_applay_return_discount_1'
);
$return_bean
=
floor
(
$pay_bean
*
$return_bean_discount
);
if
(
$vrstatus
==
1
||
$vrstatus
==
7
){
$data
[
'shot_status'
]
=
5
;
$ok
=
$this
->
db
->
where
(
array
(
'id'
=>
$id
))
->
update
(
'vr_applay'
,
$data
);
$description2
=
'取消VR,返回'
.
$return_bean
.
'房豆'
;
if
(
$ok
){
//返还房豆
if
(
$return_bean
&&
$pay_state
&&
$transaction_id
){
$this
->
load
->
model
(
'bean_model'
);
$re
=
$this
->
bean_model
->
increaseBean
(
$this
->
uid
,
'vrApplayReturn'
,
$transaction_id
,
$return_bean
,
$description2
,
'退款'
);
if
(
$re
){
$this
->
db
->
where
(
array
(
'id'
=>
$id
))
->
update
(
'vr_applay'
,
array
(
'return_bean'
=>
$return_bean
));
}
}
return
array
(
'code'
=>
1
,
'msg'
=>
'VR申请已取消'
);
}
return
array
(
'code'
=>
0
,
'msg'
=>
'操作失败'
);
}
elseif
(
$vrstatus
==
2
){
return
array
(
'code'
=>
0
,
'msg'
=>
'您好,该房源已处于已预约,取消时申请的房豆不会返还给您哦!确认取消拍摄VR,请联系:18662715825'
);
}
else
{
return
array
(
'code'
=>
0
,
'msg'
=>
'状态已发生变化,刷新后操作'
);
}
}
return
array
(
'code'
=>
0
,
'msg'
=>
'无效数据'
);
}
/*
* VR操作日志
*/
public
function
vrOptionLog
(
$rowid
,
$shot_status
,
$msg
){
$options
[
'house_id'
]
=
$rowid
;
$options
[
'shot_status'
]
=
$shot_status
;
$options
[
'params'
]
=
$msg
;
$options
[
'operator'
]
=
$this
->
username
;
$options
[
'create_time'
]
=
time
();
$this
->
db
->
insert
(
'vr_applay_option_log'
,
$options
);
}
/*
* 根据楼栋门牌获取模型记录
*/
public
function
getVrModel
(
$blockid
,
$buildingnum
,
$unitnum
,
$roomnum
){
$getAllAgentCode
=
$this
->
getAllAgentCode
();
$vr_applay
=
$this
->
dbback
->
from
(
'vr_applay_first'
)
->
where
(
array
(
'block_id'
=>
$blockid
,
'building'
=>
$buildingnum
,
'unit'
=>
$unitnum
,
'room_num'
=>
$roomnum
))
->
where_in
(
'agentcode'
,
$getAllAgentCode
)
->
order_by
(
'id asc'
)
->
get
()
->
row_array
();
if
(
$vr_applay
){
$vr_applay
[
'is_sameCompany'
]
=
1
;
$vr_applay
[
'is_return'
]
=
$vr_applay
[
'is_reward'
];
$vr_applay
[
'pay_bean'
]
=
$this
->
getVrConf
(
'vr_applay_bean_company'
);
}
if
(
!
$vr_applay
){
$vr_applay
=
$this
->
dbback
->
from
(
'vr_applay_first'
)
->
where
(
array
(
'block_id'
=>
$blockid
,
'building'
=>
$buildingnum
,
'unit'
=>
$unitnum
,
'room_num'
=>
$roomnum
))
->
order_by
(
'id asc'
)
->
get
()
->
row_array
();
if
(
$vr_applay
){
$vr_applay
[
'is_sameCompany'
]
=
0
;
$vr_applay
[
'is_return'
]
=
$vr_applay
[
'is_reward'
];
$vr_applay
[
'pay_bean'
]
=
$this
->
getVrConf
(
'vr_applay_bean'
);
}
}
return
$vr_applay
;
}
/*
* 获取VR申请记录
*/
public
function
getVrRecord
(
$uid
,
$blockid
,
$buildingnum
,
$unitnum
,
$roomnum
){
$vr_applay_record
=
$this
->
dbback
->
from
(
'vr_applay'
)
->
where
(
array
(
'broker_id'
=>
$uid
,
'block_id'
=>
$blockid
,
'building'
=>
$buildingnum
,
'unit'
=>
$unitnum
,
'room_num'
=>
$roomnum
,
'vr_model_id !='
=>
''
))
->
order_by
(
'id desc'
)
->
get
()
->
row_array
();
return
$vr_applay_record
;
}
/*
* vr_applay_bean 花费房豆数
* vr_applay_return_usernum 返还至第几人
* vr_applay_return_bean 返还房豆数
*/
public
function
getVrConf
(
$key
){
$val
=
$this
->
config
->
item
(
$key
);
return
$val
;
}
/*
* 查询房源
*/
public
function
checkHouse
(
$house_id
){
$tab
=
'sell'
;
$houseInfo
=
$this
->
dbback
->
from
(
$tab
)
->
where
(
array
(
'id'
=>
$house_id
,
'uid'
=>
$this
->
uid
))
->
get
()
->
row_array
();
if
(
!
$houseInfo
){
return
false
;
}
$streetid
=
$houseInfo
[
'streetid'
];
$street
=
$this
->
dbback
->
from
(
'street'
)
->
where
(
array
(
'id'
=>
$streetid
))
->
get
()
->
row_array
();
$houseInfo
[
'streetname'
]
=
''
;
if
(
$street
){
$houseInfo
[
'streetname'
]
=
$street
[
'streetname'
];
}
return
$houseInfo
;
}
/*
* 申请中的不可再次申请
*/
private
function
check_vr_status
(
$house_id
){
$applay
=
$this
->
dbback
->
from
(
'vr_applay'
)
->
where
(
array
(
'house_id'
=>
$house_id
))
->
where_not_in
(
'shot_status'
,
array
(
5
,
6
,
9
))
->
order_by
(
'save_time desc'
)
->
get
()
->
row_array
();
if
(
$applay
){
$this
->
newException
(
'该房源正在处理中,不可再次申请'
);
}
return
true
;
}
/*
* 检测不能超过总数
*/
private
function
check_vr_count
(
$order_date
){
$count_manage
=
$this
->
dbback
->
from
(
'vr_count_manage'
)
->
where
(
array
(
'order_date'
=>
$order_date
))
->
get
()
->
row_array
();
if
(
$count_manage
){
$total_count
=
$count_manage
[
'count'
];
}
else
{
$total_count
=
40
;
}
//检测是否超过40套
$applay_count
=
$this
->
db
->
from
(
'vr_applay'
)
->
where
(
array
(
'order_date'
=>
$order_date
))
->
where_not_in
(
'shot_status'
,
array
(
5
,
6
,
9
))
->
count_all_results
();
if
(
$applay_count
>=
$total_count
){
$this
->
newException
(
'拍摄日期'
.
$order_date
.
'申请已超过'
.
$total_count
.
'套,不可申请了'
);
}
return
true
;
}
/*
* 非放心看经纪人,永久只能申请一次
* 放心看经纪人 ,拍摄中的最多存在3个
*/
private
function
check_vr_broker
(){
$broker
=
$this
->
dbback
->
from
(
'broker'
)
->
where
(
array
(
'uid'
=>
$this
->
uid
))
->
get
()
->
row_array
();
if
(
!
$broker
){
$this
->
newException
(
'经纪人不存在'
);
}
//非放心看经纪人,永久只能申请一套
if
(
!
$broker
[
'real_status'
]){
$applay_count
=
$this
->
dbback
->
from
(
'vr_applay'
)
->
where
(
array
(
'broker_id'
=>
$this
->
uid
))
->
where_not_in
(
'shot_status'
,
array
(
5
,
6
,
9
))
->
count_all_results
();
if
(
$applay_count
){
$this
->
newException
(
'您非放心看经纪人,最多只能申请一套'
);
}
}
else
{
$applay_count_total
=
$this
->
dbback
->
from
(
'vr_applay'
)
->
where
(
array
(
'broker_id'
=>
$this
->
uid
))
->
where_in
(
'shot_status'
,
array
(
1
,
2
))
->
count_all_results
();
if
(
$applay_count_total
>=
3
){
$this
->
newException
(
'审核中,已预约不能超过3套房源'
);
}
}
}
/*
* 获取所有的公司的门店编号
*/
public
function
getAllAgentCode
(){
$broker
=
$this
->
dbback
->
from
(
'broker'
)
->
select
(
'uid,agentcode'
)
->
where
(
array
(
'uid'
=>
$this
->
uid
))
->
get
()
->
row_array
();
$agentcode
=
$broker
[
'agentcode'
];
if
(
!
$agentcode
){
return
array
();
}
$agentcodes
=
array
();
array_push
(
$agentcodes
,
$agentcode
);
$agency
=
$this
->
dbback
->
from
(
'agency'
)
->
where
(
array
(
'agentcode'
=>
$agentcode
))
->
get
()
->
row_array
();
$agenttype
=
$agency
[
'agenttype'
];
if
(
$agenttype
==
1
){
//分公司
$parentcode
=
$agency
[
'parentcode'
];
}
elseif
(
$agenttype
==
2
){
//总公司
$parentcode
=
$agentcode
;
}
if
(
$parentcode
){
array_push
(
$agentcodes
,
$parentcode
);
$agencys
=
$this
->
dbback
->
from
(
'agency'
)
->
where
(
array
(
'parentcode'
=>
$parentcode
))
->
get
()
->
result_array
();
foreach
(
$agencys
as
$k
=>
$v
){
array_push
(
$agentcodes
,
$v
[
'agentcode'
]);
}
}
return
$agentcodes
;
}
}
\ No newline at end of file
new_admincp/applications/zsb/views/nj/sell_manage.php
View file @
41b3df8a
...
@@ -497,37 +497,20 @@
...
@@ -497,37 +497,20 @@
?>
?>
<?php
if
(
!
$isreal
&&
GB_CITY
==
'nj'
)
:
?>
<?php
if
(
$vr_applay
)
:
?>
<!--2018-6-28 VR-->
<!--2018-6-28 VR-->
<?php
if
(
in_array
(
$value
[
'vr_status'
],
array
(
0
,
5
,
6
,
9
))
&&
$value
[
'vr_applay_show'
]
)
:
?>
<?php
if
(
in_array
(
$value
[
'vr_status'
],
array
(
0
,
5
,
6
,
9
)))
:
?>
<div
class=
"vr-apply"
onclick=
"applay_vr(
<?php
echo
$value
[
'id'
];
?>
,0,
<?php
echo
$vrs
;
?>
)"
>
<div
class=
"vr-apply"
onclick=
"applay_vr(
<?php
echo
$value
[
'id'
];
?>
,0,
<?php
echo
$vrs
;
?>
)"
>
申请VR
申请VR
</div>
</div>
<?php
elseif
(
in_array
(
$value
[
'vr_status'
],
array
(
1
,
2
)))
:
?>
<?php
elseif
(
in_array
(
$value
[
'vr_status'
],
array
(
1
,
2
)))
:
?>
<div
class=
"vr-apply"
id=
"vr_id_
<?php
echo
$value
[
'id'
];
?>
"
onclick=
"applay_cancle_vr(
<?php
echo
$value
[
'id'
];
?>
,
<?php
echo
$value
[
'vr_status'
];
?>
)"
>
<div
class=
"vr-apply"
style=
"background: #F57D3A"
id=
"vr_id_
<?php
echo
$value
[
'id'
];
?>
"
onclick=
"applay_cancle_vr(
<?php
echo
$value
[
'id'
];
?>
,
<?php
echo
$value
[
'vr_status'
];
?>
)"
>
取消预约
取消预约
</div>
</div>
<?php
endif
;
?>
<?php
endif
;
?>
<?php
endif
;
?>
<?php
endif
;
?>
<?php
if
(
$isreal
&&
$value
[
'is_real_house'
]
&&
GB_CITY
==
'nj'
)
:
?>
<!--2018-6-28 VR-->
<?php
if
(
in_array
(
$value
[
'vr_status'
],
array
(
0
,
5
,
6
,
9
))
&&
$svrshow
&&
$value
[
'vr_applay_show'
])
:
?>
<div
class=
"vr-apply"
onclick=
"applay_vr(
<?php
echo
$value
[
'id'
];
?>
,1,
<?php
echo
$vrs
;
?>
)"
>
申请VR
</div>
<?php
elseif
(
in_array
(
$value
[
'vr_status'
],
array
(
1
,
2
)))
:
?>
<div
class=
"vr-apply"
id=
"vr_id_
<?php
echo
$value
[
'id'
];
?>
"
onclick=
"applay_cancle_vr(
<?php
echo
$value
[
'id'
];
?>
,
<?php
echo
$value
[
'vr_status'
];
?>
)"
>
取消预约
</div>
<?php
endif
;
?>
<?php
endif
;
?>
</div>
</div>
</div>
</div>
</td>
</td>
...
@@ -799,7 +782,7 @@
...
@@ -799,7 +782,7 @@
</ul>
</ul>
</div>
</div>
<div
class=
"btnFBbox vr3 show_applay"
align=
"center"
>
<div
class=
"btnFBbox vr3 show_applay"
align=
"center"
>
<a
style=
"margin:0;"
href=
"
####
"
class=
"btnB btnSubmit radius5 btnSubmit_vrapplay"
>
提交预约
</a>
<a
style=
"margin:0;"
href=
"
javascript:void(0);
"
class=
"btnB btnSubmit radius5 btnSubmit_vrapplay"
>
提交预约
</a>
</div>
</div>
<div
class=
"btnFBbox vr4 show_applay"
align=
"center"
>
<div
class=
"btnFBbox vr4 show_applay"
align=
"center"
>
...
@@ -839,8 +822,8 @@
...
@@ -839,8 +822,8 @@
<script
src=
"/source/zsb/js/layer-v3.1.1/layer/layer.js"
></script>
<script
src=
"/source/zsb/js/layer-v3.1.1/layer/layer.js"
></script>
<link
href=
"/source/zsb/layui/css/mylayui.css"
rel=
"stylesheet"
type=
"text/css"
>
<link
href=
"/source/zsb/layui/css/mylayui.css"
rel=
"stylesheet"
type=
"text/css"
>
<
!--<
script src="/source/zsb/layui/layui.js"></script>
<script
src=
"/source/zsb/layui/layui.js"
></script>
-->
<script>
<script>
$
(
function
()
{
$
(
function
()
{
layer
.
config
({
layer
.
config
({
...
@@ -899,13 +882,6 @@
...
@@ -899,13 +882,6 @@
//申请vr
//申请vr
function
applay_vr
(
id
,
isreal
,
vrshow
){
function
applay_vr
(
id
,
isreal
,
vrshow
){
if
(
!
isreal
&&
!
vrshow
){
$
(
"#dialog_tip"
).
html
(
"普通经纪人仅有1套VR拍摄机会,【放心看】经纪人可申请3套以上赶快参与吧!"
);
openWin
(
'dialogts'
);
return
false
;
}
$
.
ajax
({
$
.
ajax
({
type
:
'get'
,
type
:
'get'
,
url
:
'
<?php
echo
GB_WO_URL
;
?>
/sell/getHouseInfo/'
,
url
:
'
<?php
echo
GB_WO_URL
;
?>
/sell/getHouseInfo/'
,
...
@@ -983,38 +959,58 @@ function ajax_cancle_vr() {
...
@@ -983,38 +959,58 @@ function ajax_cancle_vr() {
}
}
function
check_valid
(
attr_id
,
type
){
function
check_valid
(
attr_id
,
type
){
var
val
=
$
.
trim
(
$
(
'#'
+
attr_id
).
val
());
var
val
=
$
.
trim
(
$
(
'#'
+
attr_id
).
val
());
if
(
type
==
'mashup'
){
if
(
type
==
'mashup'
){
if
(
!
val
){
$
(
'#'
+
attr_id
).
addClass
(
'check_valid_vr'
);
return
false
;
}
else
{
$
(
'#'
+
attr_id
).
removeClass
(
'check_valid_vr'
);
var
reg
=
/^
[
0-9a-zA-Z
]
+$/
var
newv
=
val
if
(
!
reg
.
test
(
val
)){
var
ne
=
newv
.
toUpperCase
();
$
(
'#'
+
attr_id
).
addClass
(
'check_valid_vr'
);
$
(
'#'
+
attr_id
).
val
(
ne
);
return
false
;
}
}
else
{
$
(
'#'
+
attr_id
).
removeClass
(
'check_valid_vr'
);
var
newv
=
val
//检测是否全部填写,ajax 检测 是否绑定vr模型
var
ne
=
newv
.
toUpperCase
();
var
house_id
=
$
.
trim
(
$
(
'#vr_house_id'
).
html
());
$
(
'#'
+
attr_id
).
val
(
ne
);
var
buildingnum
=
$
.
trim
(
$
(
'#buildingnum'
).
val
());
}
var
unitnum
=
$
.
trim
(
$
(
'#unitnum'
).
val
());
var
roomnum
=
$
.
trim
(
$
(
'#roomnum'
).
val
());
var
reg
=
/^
[
0-9a-zA-Z
]
+$/
if
(
!
reg
.
test
(
buildingnum
)
||
!
reg
.
test
(
unitnum
)
||
!
reg
.
test
(
roomnum
)){
if
(
!
reg
.
test
(
buildingnum
)){
$
(
'#buildingnum'
).
addClass
(
'check_valid_vr'
)
}
if
(
!
reg
.
test
(
unitnum
)){
$
(
'#unitnum'
).
addClass
(
'check_valid_vr'
)
}
if
(
!
reg
.
test
(
roomnum
)){
$
(
'#roomnum'
).
addClass
(
'check_valid_vr'
)
}
return
false
;
}
buildingnum
=
buildingnum
.
toUpperCase
();
unitnum
=
unitnum
.
toUpperCase
();
roomnum
=
roomnum
.
toUpperCase
();
//检测是否全部填写,ajax 检测 是否绑定vr模型
if
(
buildingnum
&&
unitnum
&&
roomnum
){
var
house_id
=
$
.
trim
(
$
(
'#vr_house_id'
).
html
());
var
buildingnum
=
$
.
trim
(
$
(
'#buildingnum'
).
val
());
var
unitnum
=
$
.
trim
(
$
(
'#unitnum'
).
val
());
var
roomnum
=
$
.
trim
(
$
(
'#roomnum'
).
val
());
if
(
buildingnum
&&
unitnum
&&
roomnum
){
$
.
ajax
({
$
.
ajax
({
type
:
'post'
,
type
:
'post'
,
url
:
'
<?php
echo
GB_WO_URL
;
?>
/sell/check_vr/'
,
url
:
'
<?php
echo
GB_WO_URL
;
?>
/sell/check_vr
_new
/'
,
data
:
{
'
rowid'
:
house_id
,
'buildingnum'
:
buildingnum
,
'unitnum'
:
unitnum
,
'roomnu
m'
:
roomnum
},
data
:
{
'
hid'
:
house_id
,
'build'
:
buildingnum
,
'unit'
:
unitnum
,
'roo
m'
:
roomnum
},
dataType
:
"json"
,
dataType
:
"json"
,
success
:
function
(
re
)
success
:
function
(
re
)
{
{
if
(
re
.
code
==
1
){
$
(
'.bindlike'
).
html
(
'该房源已有对应房源VR,是否立即绑定?'
);
if
(
re
.
result
==
0
){
layer
.
msg
(
re
.
msg
);
return
false
;
}
var
state
=
re
.
data
.
state
;
if
(
state
==
1
){
$
(
'.vr4'
).
removeClass
(
'show_applay'
)
$
(
'.vr4'
).
removeClass
(
'show_applay'
)
$
(
'.vr1'
).
addClass
(
'show_applay'
)
$
(
'.vr1'
).
addClass
(
'show_applay'
)
$
(
'.vr2'
).
addClass
(
'show_applay'
)
$
(
'.vr2'
).
addClass
(
'show_applay'
)
...
@@ -1030,27 +1026,27 @@ function check_valid(attr_id,type){
...
@@ -1030,27 +1026,27 @@ function check_valid(attr_id,type){
}
}
}
}
});
});
}
}
}
}
if
(
type
==
'phone'
){
if
(
type
==
'phone'
){
if
(
!
phonereg
(
val
)){
if
(
!
phonereg
(
val
)){
$
(
'#'
+
attr_id
).
addClass
(
'check_valid_vr'
);
$
(
'#'
+
attr_id
).
addClass
(
'check_valid_vr'
);
}
else
{
}
else
{
$
(
'#'
+
attr_id
).
removeClass
(
'check_valid_vr'
);
$
(
'#'
+
attr_id
).
removeClass
(
'check_valid_vr'
);
}
}
}
}
if
(
type
==
'num'
){
if
(
type
==
'num'
){
if
(
!
(
/
(
^
[
1-9
]\d
*$
)
/
.
test
(
val
)))
{
if
(
!
(
/
(
^
[
1-9
]\d
*$
)
/
.
test
(
val
)))
{
$
(
'#'
+
attr_id
).
addClass
(
'check_valid_vr'
);
$
(
'#'
+
attr_id
).
addClass
(
'check_valid_vr'
);
}
else
{
}
else
{
$
(
'#'
+
attr_id
).
removeClass
(
'check_valid_vr'
);
$
(
'#'
+
attr_id
).
removeClass
(
'check_valid_vr'
);
}
}
}
}
}
}
/**
/**
* 有相似房源,直接绑定
* 有相似房源,直接绑定
*/
*/
...
@@ -1093,7 +1089,6 @@ $('.btnSubmit_vrbind').click(function () {
...
@@ -1093,7 +1089,6 @@ $('.btnSubmit_vrbind').click(function () {
$
(
'.btnSubmit_vrapplay'
).
click
(
function
()
{
$
(
'.btnSubmit_vrapplay'
).
click
(
function
()
{
var
house_id
=
$
.
trim
(
$
(
'#vr_house_id'
).
html
());
var
house_id
=
$
.
trim
(
$
(
'#vr_house_id'
).
html
());
var
buildingnum
=
$
.
trim
(
$
(
'#buildingnum'
).
val
());
var
buildingnum
=
$
.
trim
(
$
(
'#buildingnum'
).
val
());
var
unitnum
=
$
.
trim
(
$
(
'#unitnum'
).
val
());
var
unitnum
=
$
.
trim
(
$
(
'#unitnum'
).
val
());
...
@@ -1133,20 +1128,24 @@ $('.btnSubmit_vrapplay').click(function () {
...
@@ -1133,20 +1128,24 @@ $('.btnSubmit_vrapplay').click(function () {
var
form
=
$
(
"#search_form"
);
var
form
=
$
(
"#search_form"
);
vr_applay_close
();
vr_applay_close
();
var
index
=
layer
.
load
(
1
,
{
shade
:
[
0.1
,
'#fff'
]
//0.1透明度的白色背景
});
$
.
ajax
({
$
.
ajax
({
type
:
'post'
,
type
:
'post'
,
url
:
'
<?php
echo
GB_WO_URL
;
?>
/sell/vrapplay/'
,
url
:
'
<?php
echo
GB_WO_URL
;
?>
/sell/vrapplay/'
,
data
:
{
'
rowid'
:
house_id
,
'buildingnum'
:
buildingnum
,
'unitnum'
:
unitnum
,
'roomnum'
:
roomnum
,
'agent_telno'
:
agent_telno
,
'order_date'
:
order_date
,
'order_time'
:
order_time
,
'blockshownameall
'
:
blockshownameall
},
data
:
{
'
hid'
:
house_id
,
'build'
:
buildingnum
,
'unit'
:
unitnum
,
'room'
:
roomnum
,
'phone'
:
agent_telno
,
'order_date'
:
order_date
,
'order_time'
:
order_time
,
'block
'
:
blockshownameall
},
dataType
:
"json"
,
dataType
:
"json"
,
success
:
function
(
re
)
success
:
function
(
re
)
{
{
if
(
re
.
code
==
1
){
layer
.
close
(
index
);
if
(
re
.
result
==
1
){
$
(
"#dialogts #dialog_tip"
).
html
(
'申请成功'
);
$
(
"#dialogts #dialog_tip"
).
html
(
'申请成功'
);
openWin
(
'dialogts'
);
openWin
(
'dialogts'
);
form
.
submit
();
setTimeout
(
function
()
{
$
(
"#search_form"
).
submit
();
},
500
)
}
else
{
}
else
{
$
(
"#dialogts #dialog_tip"
).
html
(
re
.
msg
);
$
(
"#dialogts #dialog_tip"
).
html
(
re
.
msg
);
openWin
(
'dialogts'
);
openWin
(
'dialogts'
);
}
}
...
...
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