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
3e82d5a2
Commit
3e82d5a2
authored
Jan 20, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
楼盘详情
parent
d86c91cf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
6 deletions
+61
-6
Houses.php
application/index/controller/Houses.php
+25
-6
GHouses.php
application/model/GHouses.php
+36
-0
No files found.
application/index/controller/Houses.php
View file @
3e82d5a2
...
...
@@ -13,6 +13,7 @@ use app\index\extend\Basic;
use
app\model\GHouses
;
use
app\model\GHousesExt
;
use
app\model\GHousesImgs
;
use
app\model\HouseInfos
;
class
Houses
extends
Basic
...
...
@@ -22,7 +23,7 @@ class Houses extends Basic
}
/**
* 新增商铺
* 新增
和编辑
商铺
*
* @return \think\response\View
* @throws \Exception
...
...
@@ -31,8 +32,8 @@ class Houses extends Basic
public
function
edit
()
{
$result
[
'code'
]
=
200
;
$result
[
'msg'
]
=
''
;
$params
=
$this
->
request
->
param
();
if
(
$this
->
request
->
isPost
())
{
$params
=
$this
->
request
->
param
();
$date
=
date
(
'Y-m-d H:i:s'
);
if
(
$params
[
'id'
])
{
...
...
@@ -71,28 +72,46 @@ class Houses extends Basic
$house_img
->
edit
(
$params
,
$house_id
);
}
/***保存图片 hujun 2018.1.19 end***/
if
(
$house
->
id
)
{
if
(
$house
_
id
)
{
$house
->
commit
();
$return
=
$this
->
response
(
$result
[
'code'
],
$result
[
'msg'
]);
}
else
{
$house
->
rollback
();
$return
=
$this
->
response
(
101
,
$result
[
'msg'
]);
}
}
elseif
(
$
this
->
request
->
param
(
'id'
)
){
}
elseif
(
$
params
[
'id'
]
){
//获取商铺详情
$house
=
new
GHouses
();
$result
[
'data'
]
=
$house
->
find
(
);
$result
[
'data'
]
=
$house
->
getHouseById
(
$params
[
'id'
]
);
$return
=
$this
->
response
(
$result
[
'code'
],
$result
[
'msg'
],
$result
[
'data'
]);
}
else
{
//商铺添加页面
$return
=
view
(
'edit'
);
}
return
$return
;
}
/**
* 获取商铺列表
*
* @return \think\Response
*/
public
function
getHouse
()
{
$data
[
'status'
]
=
200
;
$data
[
'msg'
]
=
''
;
$params
=
$this
->
request
->
param
();
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$house
=
new
GHouses
();
$where
=
'status <> 3'
;
$data
[
'list'
]
=
$house
->
getHouseInfoList
(
$pageNo
,
$pageSize
,
'id DESC'
,
'*'
,
$where
);
// $data['total'] = $house->($where);
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]);
}
public
function
del
()
{
}
...
...
application/model/GHouses.php
View file @
3e82d5a2
...
...
@@ -7,4 +7,40 @@ namespace app\model;
class
GHouses
extends
BaseModel
{
protected
$table
=
'g_houses'
;
/**
* 通过id获取商铺详情
*
* @param $id
* @return array|false|\PDOStatement|string|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getHouseById
(
$id
)
{
$fields
=
'a.*,b.fee_rule,internal_item_advantage,external_item_advantage,tiny_brochure_url,auditorium,traffic,
enter_num,do_business_date,start_business_date,singn_rule,landlord_phone'
;
$data
=
$this
->
alias
(
'a'
)
->
field
(
$fields
)
->
join
(
'g_houses_ext b'
,
'a.id = b.house_id'
,
'left'
)
->
where
(
'a.id'
,
$id
)
->
find
();
$data
=
$data
->
toArray
();
$img
=
new
GHousesImgs
();
$img_data
=
$img
->
field
(
'id,img_type,img_name'
)
->
where
(
'img_status = 0 AND house_id = '
.
$id
)
->
select
();
foreach
(
$img_data
as
$k
=>
$v
)
{
switch
(
$v
->
img_type
)
{
case
1
:
$data
[
'cover'
]
=
$v
;
break
;
case
2
:
$data
[
'slide_show'
][
$k
]
=
$v
;
break
;
default
:
$data
[
'plan'
][
$k
]
=
$v
;
}
}
return
$data
;
}
}
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