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
cb1eb08f
Commit
cb1eb08f
authored
Jan 29, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接收参数修改
parent
06daf716
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
68 deletions
+63
-68
Broker.php
application/index/controller/Broker.php
+22
-26
Houses.php
application/index/controller/Houses.php
+41
-42
No files found.
application/index/controller/Broker.php
View file @
cb1eb08f
...
...
@@ -30,13 +30,12 @@ class Broker extends Basic
$data
[
'data'
]
=
''
;
$data
[
'code'
]
=
''
;
$data
[
'msg'
]
=
''
;
$params
=
$this
->
request
->
param
();
$pageNo
=
empty
(
$
params
[
'pageNo'
])
?
1
:
$
params
[
'pageNo'
];
$pageSize
=
empty
(
$
params
[
'pageSize'
])
?
10
:
$
params
[
'pageSize'
];
if
(
$params
[
'phone'
])
{
$where
=
'phone like "'
.
$
params
[
'phone'
]
.
'%" or realname like "'
.
$
params
[
'phone'
]
.
'%"'
;
$pageNo
=
empty
(
$
this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$
this
->
params
[
'pageSize'
])
?
10
:
$this
->
params
[
'pageSize'
];
$where
=
''
;
if
(
$
this
->
params
[
'phone'
])
{
$where
=
'phone like "'
.
$
this
->
params
[
'phone'
]
.
'%" or realname like "'
.
$this
->
params
[
'phone'
]
.
'%"'
;
}
if
(
$where
)
{
...
...
@@ -62,13 +61,12 @@ class Broker extends Basic
$data
[
'status'
]
=
200
;
$data
[
'data'
]
=
''
;
$data
[
'msg'
]
=
''
;
$params
=
$this
->
request
->
param
();
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
10
:
$params
[
'pageSize'
];
if
(
$params
[
'phone'
])
{
$where
=
'phone like "'
.
$params
[
'phone'
]
.
'%" or name like "'
.
$params
[
'phone'
]
.
'%"'
;
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
10
:
$this
->
params
[
'pageSize'
];
$where
=
''
;
if
(
$this
->
params
[
'phone'
])
{
$where
=
'phone like "'
.
$this
->
params
[
'phone'
]
.
'%" or name like "'
.
$this
->
params
[
'phone'
]
.
'%"'
;
}
if
(
$where
)
{
...
...
@@ -95,15 +93,14 @@ class Broker extends Basic
$data
[
'status'
]
=
200
;
$data
[
'data'
]
=
''
;
$data
[
'msg'
]
=
''
;
$params
=
$this
->
request
->
param
();
if
(
$params
[
'houses_id'
])
{
if
(
$
this
->
params
[
'houses_id'
])
{
$hg
=
new
GHousesToAgents
();
switch
(
$params
[
'type'
])
{
switch
(
$
this
->
params
[
'type'
])
{
case
1
:
$res
=
$hg
->
addAgents
(
$
params
[
'agents_id'
],
$params
[
'houses_id'
],
$
params
[
'type'
]);
break
;
$res
=
$hg
->
addAgents
(
$
this
->
params
[
'agents_id'
],
$this
->
params
[
'houses_id'
],
$this
->
params
[
'type'
]);
break
;
case
2
:
$res
=
$hg
->
addAgents
(
$
params
[
'agents_id'
],
$params
[
'houses_id'
],
$
params
[
'type'
]);
break
;
$res
=
$hg
->
addAgents
(
$
this
->
params
[
'agents_id'
],
$this
->
params
[
'houses_id'
],
$this
->
params
[
'type'
]);
break
;
default
:
$data
[
'status'
]
=
101
;
$data
[
'msg'
]
=
'type is null'
;
...
...
@@ -132,11 +129,10 @@ class Broker extends Basic
$data
[
'status'
]
=
200
;
$data
[
'data'
]
=
''
;
$data
[
'msg'
]
=
''
;
$params
=
$this
->
request
->
param
();
if
(
$
params
[
'id'
]
&&
$
params
[
'houses_id'
])
{
if
(
$
this
->
params
[
'id'
]
&&
$this
->
params
[
'houses_id'
])
{
$hg
=
new
GHousesToAgents
();
$hg
->
del
(
$
params
[
'id'
],
$
params
[
'houses_id'
]);
$hg
->
del
(
$
this
->
params
[
'id'
],
$this
->
params
[
'houses_id'
]);
}
else
{
$data
[
'status'
]
=
101
;
$data
[
'msg'
]
=
'id or houses_id is null'
;
...
...
@@ -153,16 +149,16 @@ class Broker extends Basic
$data
[
'status'
]
=
200
;
$data
[
'data'
]
=
''
;
$data
[
'msg'
]
=
''
;
$params
=
$this
->
request
->
param
();
if
(
$params
[
'houses_id'
])
{
$pageNo
=
empty
(
$
params
[
'pageNo'
])
?
1
:
$
params
[
'pageNo'
];
$pageSize
=
empty
(
$
params
[
'pageSize'
])
?
10
:
$
params
[
'pageSize'
];
if
(
$
this
->
params
[
'houses_id'
])
{
$pageNo
=
empty
(
$
this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$
this
->
params
[
'pageSize'
])
?
10
:
$this
->
params
[
'pageSize'
];
$hg
=
new
GHousesToAgents
();
$fields
=
'b.id,b.name,b.phone'
;
$where
[
'a.is_del'
]
=
[
'='
,
0
];
$where
[
'b.status'
]
=
[
'='
,
0
];
$where
[
'a.type'
]
=
$params
[
'type'
];
$where
[
'a.houses_id'
]
=
$params
[
'houses_id'
];
$where
[
'a.type'
]
=
$
this
->
params
[
'type'
];
$where
[
'a.houses_id'
]
=
$
this
->
params
[
'houses_id'
];
$data
[
'data'
]
=
$hg
->
getAgentsHousesList
(
$pageNo
,
$pageSize
,
'id DESC'
,
$fields
,
$where
);
}
else
{
$data
[
'status'
]
=
101
;
...
...
application/index/controller/Houses.php
View file @
cb1eb08f
...
...
@@ -38,10 +38,10 @@ class Houses extends Basic
public
function
edit
()
{
$result
[
'code'
]
=
200
;
$result
[
'msg'
]
=
''
;
$params
=
$this
->
request
->
param
();
if
(
$this
->
request
->
isPost
())
{
$this
->
house
->
startTrans
();
$house_id
=
$this
->
house
->
add
(
$params
);
//添加或编辑商铺
$house_id
=
$this
->
house
->
add
(
$
this
->
params
);
//添加或编辑商铺
if
(
$house_id
)
{
$this
->
house
->
commit
();
$return
=
$this
->
response
(
$result
[
'code'
],
$result
[
'msg'
],[
'id'
,
$house_id
]);
...
...
@@ -49,11 +49,11 @@ class Houses extends Basic
$this
->
house
->
rollback
();
$return
=
$this
->
response
(
101
,
'add houses is error'
);
}
}
elseif
(
$params
[
'id'
]){
}
elseif
(
$
this
->
params
[
'id'
]){
if
(
$this
->
request
->
isAjax
())
{
//获取商铺详情
$house
=
new
GHouses
();
$result
[
'data'
]
=
$house
->
getHouseById
(
$params
[
'id'
]);
$result
[
'data'
]
=
$house
->
getHouseById
(
$
this
->
params
[
'id'
]);
$return
=
$this
->
response
(
$result
[
'code'
],
$result
[
'msg'
],
$result
[
'data'
]);
}
else
{
//商铺添加页面
...
...
@@ -77,45 +77,45 @@ class Houses extends Basic
public
function
getHouseList
()
{
$data
[
'status'
]
=
200
;
$data
[
'msg'
]
=
''
;
$params
=
$this
->
request
->
param
();
$pageNo
=
empty
(
$
params
[
'pageNo'
])
?
1
:
$
params
[
'pageNo'
];
$pageSize
=
empty
(
$
params
[
'pageSize'
])
?
15
:
$
params
[
'pageSize'
];
$pageNo
=
empty
(
$
this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$
this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
$fields
=
''
;
/*精选商铺--0是1否*/
if
(
$params
[
'is_carefully_chosen'
]
!=
NULL
)
{
$where
[
'is_carefully_chosen'
]
=
$params
[
'is_carefully_chosen'
];
if
(
$
this
->
params
[
'is_carefully_chosen'
]
!=
NULL
)
{
$where
[
'is_carefully_chosen'
]
=
$
this
->
params
[
'is_carefully_chosen'
];
}
/*0是1否显示在c端用户*/
if
(
$params
[
'is_show'
]
!=
NULL
)
{
$where
[
'is_show'
]
=
$params
[
'is_show'
];
if
(
$
this
->
params
[
'is_show'
]
!=
NULL
)
{
$where
[
'is_show'
]
=
$
this
->
params
[
'is_show'
];
}
/*商铺类型(0商场,1街铺)*/
if
(
$params
[
'shop_type'
]
!=
NULL
)
{
$where
[
'shop_type'
]
=
$params
[
'shop_type'
];
if
(
$
this
->
params
[
'shop_type'
]
!=
NULL
)
{
$where
[
'shop_type'
]
=
$
this
->
params
[
'shop_type'
];
}
/*所在城市*/
if
(
$params
[
'city'
]
!=
NULL
)
{
$where
[
'city'
]
=
$params
[
'city'
];
if
(
$
this
->
params
[
'city'
]
!=
NULL
)
{
$where
[
'city'
]
=
$
this
->
params
[
'city'
];
}
/*所在区*/
if
(
$params
[
'disc'
]
!=
NULL
)
{
$where
[
'disc'
]
=
$params
[
'disc'
];
if
(
$
this
->
params
[
'disc'
]
!=
NULL
)
{
$where
[
'disc'
]
=
$
this
->
params
[
'disc'
];
}
/*状态 0待审批 1上架 2下架 3回收*/
if
(
$params
[
'status'
]
!=
NULL
)
{
$where
[
'status'
]
=
$params
[
'status'
];
if
(
$
this
->
params
[
'status'
]
!=
NULL
)
{
$where
[
'status'
]
=
$
this
->
params
[
'status'
];
}
/*价格 -1表示营业额扣点 存分*/
if
(
$params
[
'rent_price'
]
!=
NULL
)
{
switch
(
$params
[
'rent_price'
])
{
if
(
$
this
->
params
[
'rent_price'
]
!=
NULL
)
{
switch
(
$
this
->
params
[
'rent_price'
])
{
case
1
:
$where
[
'rent_price'
]
=
[
'>'
,
10000
];
break
;
case
2
:
...
...
@@ -126,33 +126,33 @@ class Houses extends Basic
}
/*对内楼盘名*/
if
(
$params
[
'internal_title'
]
!=
NULL
)
{
$where
[
'internal_title'
]
=
[
'LIKE'
,
$params
[
'internal_title'
]
.
'%'
];
if
(
$
this
->
params
[
'internal_title'
]
!=
NULL
)
{
$where
[
'internal_title'
]
=
[
'LIKE'
,
$
this
->
params
[
'internal_title'
]
.
'%'
];
}
/*是否独家0否1是*/
if
(
$params
[
'is_exclusive_type'
]
!=
NULL
)
{
$where
[
'is_exclusive_type'
]
=
[
'LIKE'
,
$params
[
'is_exclusive_type'
]
.
'%'
];
if
(
$
this
->
params
[
'is_exclusive_type'
]
!=
NULL
)
{
$where
[
'is_exclusive_type'
]
=
[
'LIKE'
,
$
this
->
params
[
'is_exclusive_type'
]
.
'%'
];
}
/*开始时间*/
if
(
$params
[
'start_date'
]
!=
NULL
)
{
$where
[
'create_time'
]
=
[
'> time'
,
$params
[
'start_date'
]
.
' 00:00:00'
];
if
(
$
this
->
params
[
'start_date'
]
!=
NULL
)
{
$where
[
'create_time'
]
=
[
'> time'
,
$
this
->
params
[
'start_date'
]
.
' 00:00:00'
];
}
/*结束时间*/
if
(
$params
[
'end_date'
]
!=
NULL
)
{
$where
[
'create_time'
]
=
[
'< time'
,
$params
[
'end_date'
]
.
' 23:59:59'
];
if
(
$
this
->
params
[
'end_date'
]
!=
NULL
)
{
$where
[
'create_time'
]
=
[
'< time'
,
$
this
->
params
[
'end_date'
]
.
' 23:59:59'
];
}
/*开始结束时间*/
if
(
$
params
[
'start_date'
]
!=
NULL
&&
$
params
[
'end_date'
]
!=
NULL
)
{
$where
[
'create_time'
]
=
[
'between time'
,[
$
params
[
'start_date'
]
.
' 00:00:00'
],
$
params
[
'end_date'
]
.
' 23:59:59'
];
if
(
$
this
->
params
[
'start_date'
]
!=
NULL
&&
$this
->
params
[
'end_date'
]
!=
NULL
)
{
$where
[
'create_time'
]
=
[
'between time'
,[
$
this
->
params
[
'start_date'
]
.
' 00:00:00'
],
$this
->
params
[
'end_date'
]
.
' 23:59:59'
];
}
/*根据库存判断是否已租*/
if
(
$params
[
'leased'
]
!=
NULL
)
{
if
(
$params
[
'leased'
]
==
0
)
{
if
(
$
this
->
params
[
'leased'
]
!=
NULL
)
{
if
(
$
this
->
params
[
'leased'
]
==
0
)
{
$where
[
'residue_num'
]
=
0
;
}
else
{
$where
[
'residue_num'
]
=
[
'<>'
,
0
];
...
...
@@ -160,8 +160,8 @@ class Houses extends Basic
}
/*业态*/
if
(
$params
[
'industry_type'
]
!=
NULL
)
{
$where
[
'industry_type'
]
=
[
'LIKE'
,
$params
[
'industry_type'
]
.
'%'
];
if
(
$
this
->
params
[
'industry_type'
]
!=
NULL
)
{
$where
[
'industry_type'
]
=
[
'LIKE'
,
$
this
->
params
[
'industry_type'
]
.
'%'
];
}
//案场权限人搜索
...
...
@@ -198,9 +198,9 @@ class Houses extends Basic
$data
[
'status'
]
=
200
;
$data
[
'msg'
]
=
''
;
$data
[
'data'
]
=
''
;
$params
=
$this
->
request
->
param
();
if
(
$params
[
'id'
])
{
$this
->
house
->
isUpdate
(
true
)
->
save
([
'status'
=>
3
],[
'id'
=>
$params
[
'id'
]]);
if
(
$
this
->
params
[
'id'
])
{
$this
->
house
->
isUpdate
(
true
)
->
save
([
'status'
=>
3
],[
'id'
=>
$
this
->
params
[
'id'
]]);
$data
[
'msg'
]
=
'successfully deleted'
;
}
else
{
$data
[
'status'
]
=
101
;
...
...
@@ -219,11 +219,10 @@ class Houses extends Basic
$data
[
'status'
]
=
200
;
$data
[
'msg'
]
=
''
;
$data
[
'data'
]
=
''
;
$params
=
$this
->
request
->
param
();
if
(
$
params
[
'houses_id'
]
!=
NULL
&&
$
params
[
'is_carefully_chosen'
]
!=
NULL
)
{
$data
[
'is_carefully_chosen'
]
=
$params
[
'is_carefully_chosen'
];
$data
[
'data'
]
=
$this
->
house
->
editData
(
$data
,
$params
[
'houses_id'
],
'id'
);
if
(
$
this
->
params
[
'houses_id'
]
!=
NULL
&&
$this
->
params
[
'is_carefully_chosen'
]
!=
NULL
)
{
$data
[
'is_carefully_chosen'
]
=
$
this
->
params
[
'is_carefully_chosen'
];
$data
[
'data'
]
=
$this
->
house
->
editData
(
$data
,
$
this
->
params
[
'houses_id'
],
'id'
);
}
else
{
$data
[
'status'
]
=
101
;
$data
[
'msg'
]
=
'houses_id or is_carefully_chosen is null'
;
...
...
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