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
29e87877
Commit
29e87877
authored
May 30, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
楼盘详情
parent
8a2d687e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
123 additions
and
42 deletions
+123
-42
OfficeManage.php
application/index/controller/OfficeManage.php
+1
-1
OfficeService.php
application/index/service/OfficeService.php
+17
-37
MetroStations.php
application/model/MetroStations.php
+50
-0
OfficeGBuildingImg.php
application/model/OfficeGBuildingImg.php
+3
-4
OfficeGBuildingStations.php
application/model/OfficeGBuildingStations.php
+52
-0
No files found.
application/index/controller/OfficeManage.php
View file @
29e87877
...
...
@@ -38,7 +38,7 @@ class OfficeManage extends Basic
$result
[
'status'
]
=
$msg
=
''
;
if
(
$this
->
request
->
isPost
())
{
$msg
=
'新增成功'
;
$result
=
$this
->
service
->
edit
(
$this
->
params
);
$result
=
$this
->
service
->
edit
(
$this
->
params
,
$this
->
userId
);
}
if
(
$result
[
'status'
]
==
'fail'
)
{
...
...
application/index/service/OfficeService.php
View file @
29e87877
...
...
@@ -11,8 +11,10 @@ namespace app\index\service;
use
app\index\validate\OfficeBuildingValidate
;
use
app\model\GBusinessDistrict
;
use
app\model\MetroStations
;
use
app\model\OfficeGBuilding
;
use
app\model\OfficeGBuildingImg
;
use
app\model\OfficeGBuildingStations
;
class
OfficeService
{
...
...
@@ -86,55 +88,33 @@ class OfficeService
if
(
$result
)
{
$img_data
=
$this
->
m_office_img
->
getListAll
(
'id,img_type,img_name'
,
[
'build
_id'
=>
$id
]);
$img_data
=
$this
->
m_office_img
->
getListAll
(
'id,img_type,img_name'
,
[
'build
ing_id'
=>
$id
,
'img_type'
=>
2
]);
if
(
$app
==
0
)
{
foreach
(
$img_data
as
$k
=>
$v
)
{
switch
(
$v
[
'img_type'
])
{
case
1
:
$data
[
'cover'
]
=
$v
[
'img_name'
];
break
;
case
2
:
$data
[
'slide_show'
][
$k
][
'img_name'
]
=
$v
[
'img_name'
];
$data
[
'slide_show'
][
$k
][
'id'
]
=
$v
[
'id'
];
break
;
case
3
:
$data
[
'plan'
][
$k
][
'img_name'
]
=
$v
[
'img_name'
];
$data
[
'plan'
][
$k
][
'id'
]
=
$v
[
'id'
];
break
;
case
4
:
$data
[
'exclusive_img'
][
$k
][
'img_name'
]
=
$v
[
'img_name'
];
$data
[
'exclusive_img'
][
$k
][
'id'
]
=
$v
[
'id'
];
}
$data
[
'slide_show'
][
$k
][
'img_name'
]
=
$v
[
'img_name'
];
$data
[
'slide_show'
][
$k
][
'id'
]
=
$v
[
'id'
];
}
}
else
{
$file_url
=
[];
foreach
(
$img_data
as
$k
=>
$v
)
{
$img_url
=
CK_IMG_URL
.
'images/'
.
$v
->
img_name
;
$file_url
[
'file_name'
]
=
$img_url
;
$file_url
[
'save_path'
]
=
$v
[
'img_name'
];
switch
(
$v
->
img_type
)
{
case
1
:
$data
[
'cover'
]
=
$file_url
;
break
;
case
2
:
$data
[
'slide_show'
][]
=
$file_url
;
break
;
case
3
:
$data
[
'plan'
][]
=
$file_url
;
break
;
default
:
$data
[
'exclusive_img'
][]
=
$file_url
;
}
$data
[
'slide_show'
][]
=
$file_url
;
}
}
if
(
!
empty
(
$data
[
'business_district_id'
]))
{
$business
=
new
GBusinessDistrict
();
$data
[
'business_name'
]
=
$business
->
getValue
([
'id'
=>
$data
[
'business_district_id'
]],
'name'
);
}
else
{
$data
[
'business_name'
]
=
""
;
}
// if (!empty($data['business_district_id'])) {
// $business = new GBusinessDistrict();
// $data['business_name'] = $business->getValue(['id'=>$data['business_district_id']], 'name');
// } else {
// $data['business_name'] = "";
// }
$m_building_stations
=
new
OfficeGBuildingStations
();
$field_stations
=
'a.id,b.line_name,name,distance,b.id as stations_id'
;
$data
[
'building_stations'
]
=
$m_building_stations
->
getListAll
(
$field_stations
,
[
'a.building_id'
=>
$id
]);
}
$result
[
'data'
]
=
$data
;
$result
[
'status'
]
=
'successful'
;
...
...
application/model/MetroStations.php
0 → 100644
View file @
29e87877
<?php
namespace
app\model
;
use
think\Db
;
class
MetroStations
extends
BaseModel
{
protected
$table
=
'metro_stations'
;
private
$db_
;
public
function
__construct
(
$data
=
[])
{
parent
::
__construct
(
$data
);
$this
->
db_
=
Db
::
name
(
$this
->
table
);
}
/**
* @param $field
* @param $where
* @return array|false|\PDOStatement|string|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getFindData
(
$field
,
$where
)
{
$where
[
'is_del'
]
=
0
;
return
$this
->
db_
->
field
(
$field
)
->
where
(
$where
)
->
find
();
}
/**
* @param $field
* @param $where
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getListAll
(
$field
,
$where
)
{
$where
[
'img_status'
]
=
0
;
return
$this
->
db_
->
field
(
$field
)
->
where
(
$where
)
->
select
();
}
}
application/model/OfficeGBuildingImg.php
View file @
29e87877
...
...
@@ -21,15 +21,14 @@ class OfficeGBuildingImg extends BaseModel
* 新增和编辑楼盘图片
*
* @param array $data
* @param int $agent_id
* @return int|mixed|string
*/
public
function
addOffice
(
array
$data
,
int
$agent_id
=
0
)
public
function
addOffice
(
array
$data
)
{
$save_data
=
[];
//楼盘名称
if
(
isset
(
$data
[
'build_id'
]))
{
$save_data
[
'build
_id'
]
=
$data
[
'build
_id'
];
if
(
isset
(
$data
[
'build
ing
_id'
]))
{
$save_data
[
'build
ing_id'
]
=
$data
[
'building
_id'
];
}
//图片类型:1列表页封面图,2详情页轮播图,3楼层平面图,4独家合同,5,删除
...
...
application/model/OfficeGBuildingStations.php
0 → 100644
View file @
29e87877
<?php
namespace
app\model
;
use
think\Db
;
class
OfficeGBuildingStations
extends
BaseModel
{
protected
$table
=
'office_g_building_stations'
;
private
$db_
;
public
function
__construct
(
$data
=
[])
{
parent
::
__construct
(
$data
);
$this
->
db_
=
Db
::
name
(
$this
->
table
);
}
/**
* @param $field
* @param $where
* @return array|false|\PDOStatement|string|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getFindData
(
$field
,
$where
)
{
$where
[
'is_del'
]
=
0
;
return
$this
->
db_
->
field
(
$field
)
->
where
(
$where
)
->
find
();
}
/**
* @param $field
* @param $where
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getListAll
(
$field
,
$where
)
{
$where
[
'a.is_del'
]
=
0
;
return
$this
->
db_
->
alias
(
'a'
)
->
field
(
$field
)
->
join
(
'metro_stations b'
,
'a.stations_id=b.id'
,
'left'
)
->
where
(
$where
)
->
select
();
}
}
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