Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
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
hujun
tl_estate
Commits
a49ec0b7
Commit
a49ec0b7
authored
Jan 02, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
盘方
parent
44a4f461
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
12 deletions
+54
-12
Houses.php
application/index/controller/Houses.php
+53
-11
house_template_tpl.html
public/resource/template/house_template_tpl.html
+1
-1
No files found.
application/index/controller/Houses.php
View file @
a49ec0b7
...
@@ -19,6 +19,7 @@ use app\model\AAgents;
...
@@ -19,6 +19,7 @@ use app\model\AAgents;
use
app\model\ACollectHouse
;
use
app\model\ACollectHouse
;
use
app\model\GHouses
;
use
app\model\GHouses
;
use
app\model\GHousesExt
;
use
app\model\GHousesExt
;
use
app\model\GHousesFollowUp
;
use
app\model\GHousesImgs
;
use
app\model\GHousesImgs
;
use
app\model\GHousesToAgents
;
use
app\model\GHousesToAgents
;
use
app\model\GLandlordPhone
;
use
app\model\GLandlordPhone
;
...
@@ -129,8 +130,8 @@ class Houses extends Basic
...
@@ -129,8 +130,8 @@ class Houses extends Basic
public
function
getHouseList
()
public
function
getHouseList
()
{
{
if
(
$this
->
request
->
isAjax
())
{
if
(
$this
->
request
->
isAjax
())
{
$
data
[
'status'
]
=
200
;
$
status
=
200
;
$
data
[
'msg'
]
=
''
;
$
msg
=
''
;
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
...
@@ -303,10 +304,9 @@ class Houses extends Basic
...
@@ -303,10 +304,9 @@ class Houses extends Basic
$agent_where
[
'a.type'
]
=
2
;
$agent_where
[
'a.type'
]
=
2
;
$agent_where
[
'a.is_del'
]
=
0
;
$agent_where
[
'a.is_del'
]
=
0
;
}
}
$m_to_agent
=
new
GHousesToAgents
();
//盘方搜索
//盘方搜索
if
(
!
empty
(
$agent_where
))
{
if
(
!
empty
(
$agent_where
))
{
$m_to_agent
=
new
GHousesToAgents
();
$agent_arr
=
$m_to_agent
->
getAgentsHouseField
(
'houses_id'
,
$agent_where
);
$agent_arr
=
$m_to_agent
->
getAgentsHouseField
(
'houses_id'
,
$agent_where
);
if
(
empty
(
$agent_arr
))
{
if
(
empty
(
$agent_arr
))
{
...
@@ -399,11 +399,14 @@ class Houses extends Basic
...
@@ -399,11 +399,14 @@ class Houses extends Basic
}
}
}
}
$list
=
$this
->
house
->
get
HouseListDish
(
$pageNo
,
$pageSize
,
'id DESC'
,
$fields
,
$where
,
$this
->
userId
);
$list
=
$this
->
house
->
get
List
(
$pageNo
,
$pageSize
,
'id DESC'
,
$fields
,
$where
);
$data
[
'
data'
][
'total'
]
=
$this
->
house
->
getHouseLis
tTotal
(
$where
);
$data
[
'
total'
]
=
$this
->
house
->
ge
tTotal
(
$where
);
$look_shop
=
new
LookShopService
();
$look_shop
=
new
LookShopService
();
$house_follow_up
=
new
GHousesFollowUp
();
$m_agent
=
new
AAgents
();
$s_house
=
new
HouseService
();
$collect_house
=
new
ACollectHouse
();
foreach
(
$list
as
$k
=>
$v
)
{
foreach
(
$list
as
$k
=>
$v
)
{
$list
[
$k
][
"is_look"
]
=
$look_shop
->
isLooked
(
$this
->
userId
,
$v
[
"id"
]);
$list
[
$k
][
"is_look"
]
=
$look_shop
->
isLooked
(
$this
->
userId
,
$v
[
"id"
]);
...
@@ -414,7 +417,6 @@ class Houses extends Basic
...
@@ -414,7 +417,6 @@ class Houses extends Basic
$field
=
'id,status'
;
$field
=
'id,status'
;
$get_params
[
'agents_id'
]
=
$this
->
params
[
"agent_id"
];
$get_params
[
'agents_id'
]
=
$this
->
params
[
"agent_id"
];
$get_params
[
'house_id'
]
=
$v
[
"id"
];
$get_params
[
'house_id'
]
=
$v
[
"id"
];
$collect_house
=
new
ACollectHouse
();
$res
=
$collect_house
->
getCollectHouse
(
$field
,
$get_params
);
$res
=
$collect_house
->
getCollectHouse
(
$field
,
$get_params
);
if
(
$res
&&
(
$res
[
0
][
'status'
]
==
1
))
{
//如果存在
if
(
$res
&&
(
$res
[
0
][
'status'
]
==
1
))
{
//如果存在
$list
[
$k
][
"is_collect"
]
=
1
;
$list
[
$k
][
"is_collect"
]
=
1
;
...
@@ -423,13 +425,53 @@ class Houses extends Basic
...
@@ -423,13 +425,53 @@ class Houses extends Basic
//302版本
//302版本
//判断是否有权限点击独家合同按钮 0:可查看 1:不可查看
//判断是否有权限点击独家合同按钮 0:可查看 1:不可查看
$s_house
=
new
HouseService
();
$list
[
$k
][
'is_can_edit_only_contract'
]
=
$s_house
->
isCanEditOnlyContract
(
$this
->
userId
,
$v
[
"id"
]);
$list
[
$k
][
'is_can_edit_only_contract'
]
=
$s_house
->
isCanEditOnlyContract
(
$this
->
userId
,
$v
[
"id"
]);
$house_id
=
[];
$house_id
[
$k
]
=
$v
[
'id'
];
$list
[
$k
][
'create_time'
]
=
date
(
'Y-m-d'
,
strtotime
(
$v
->
create_time
));
$list
[
$k
][
'last_follow_up'
]
=
$house_follow_up
->
getAgentHouseFollowValue
(
'create_time'
,
[
'house_id'
=>
$v
[
'id'
]]);
/*案场权限人和盘方*/
$agent_where
[
'a.houses_id'
]
=
[
'IN'
,
implode
(
','
,
$house_id
)];
$agent_where
[
'a.is_del'
]
=
0
;
$agent_where
[
'a.type'
]
=
2
;
$house_agents
=
$m_to_agent
->
getAgentsByHouseId
(
'a.houses_id,b.id,b.name,b.phone,a.agents_id,b.store_id'
,
$agent_where
);
$house_id_arr
=
[];
$dish_name
=
$list
[
$k
][
'dish_name'
]
=
''
;
foreach
(
$house_agents
as
$k2
=>
$v2
)
{
if
(
$v
[
'id'
]
==
$v2
[
'houses_id'
])
{
$dish_name
.=
$v2
[
'name'
]
.
','
;
$list
[
$k
][
'dish_name'
]
=
rtrim
(
$dish_name
,
','
);
$store_agent_id
=
$m_agent
->
getAgentsByWhere
([
'store_id'
=>
$v2
[
'store_id'
],
'level'
=>
[
'in'
,
'20,40'
]],
'id'
);
//店长
if
(
$v2
[
'agents_id'
]
==
$this
->
userId
||
$store_agent_id
==
$this
->
userId
)
{
$house_id_arr
[]
=
$v
[
'id'
];
//存储盘方自己的商铺
}
}
}
//盘方对自己的商铺有编辑权限
if
(
in_array
(
$v
[
'id'
],
$house_id_arr
))
{
$list
[
$k
][
'auth_edit_house'
]
=
1
;
}
else
{
$list
[
$k
][
'auth_edit_house'
]
=
0
;
}
//独家方
$exclusive_where
[
'type'
]
=
3
;
$exclusive_where
[
'agents_id'
]
=
$this
->
userId
;
$exclusive_where
[
'houses_id'
]
=
$v
[
'id'
];
$exclusive_where
[
'is_del'
]
=
0
;
$exclusive_num
=
$m_to_agent
->
getTotal
(
$exclusive_where
);
if
(
$exclusive_num
>
0
)
{
$list
[
$k
][
'auth_edit_exclusive'
]
=
1
;
}
}
}
$data
[
'
data'
][
'
list'
]
=
$list
;
$data
[
'list'
]
=
$list
;
return
$this
->
response
(
$
data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]
);
return
$this
->
response
(
$
status
,
$msg
,
$data
);
}
else
{
}
else
{
return
view
(
'houseList'
);
return
view
(
'houseList'
);
}
}
...
...
public/resource/template/house_template_tpl.html
View file @
a49ec0b7
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
[
%
}
%
]
[
%
}
%
]
<
/td
>
<
/td
>
<
td
width
=
"15%"
>
[
%=
it
[
item
][
'industry_type'
]
%
]
<
/td
>
<
td
width
=
"15%"
>
[
%=
it
[
item
][
'industry_type'
]
%
]
<
/td
>
<
td
>
[
%=
'盘方 '
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
'dish_name'
]
%
]
<
/td
>
<
td
width
=
"10%"
>
[
%=
it
[
item
][
'create_time'
]
%
]
<
/td
>
<
td
width
=
"10%"
>
[
%=
it
[
item
][
'create_time'
]
%
]
<
/td
>
<
td
>
<
td
>
[
%
if
(
it
[
item
][
"status"
]
==
0
)
{
%
]
[
%
if
(
it
[
item
][
"status"
]
==
0
)
{
%
]
...
...
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