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
a17e691d
Commit
a17e691d
authored
Apr 04, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改编辑商铺获取图片
parent
d7dcf4f8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
16 deletions
+41
-16
Shop.php
application/api_broker/controller/Shop.php
+1
-1
GHouses.php
application/model/GHouses.php
+40
-15
No files found.
application/api_broker/controller/Shop.php
View file @
a17e691d
...
...
@@ -286,7 +286,7 @@ class Shop extends Basic
$result
[
'msg'
]
=
'Id is null'
;
}
else
{
//获取商铺详情
$result
[
'data'
]
=
$this
->
gHousesModel
->
getHouseById
(
$this
->
params
[
'id'
]);
$result
[
'data'
]
=
$this
->
gHousesModel
->
getHouseById
(
$this
->
params
[
'id'
]
,
1
);
}
}
...
...
application/model/GHouses.php
View file @
a17e691d
...
...
@@ -20,7 +20,7 @@ class GHouses extends BaseModel
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getHouseById
(
$id
)
public
function
getHouseById
(
$id
,
$app
=
0
)
{
$data
=
array
();
$fields
=
'a.*,b.*'
;
...
...
@@ -89,22 +89,47 @@ class GHouses extends BaseModel
$data
[
'slide_show'
]
=
[];
$data
[
'plan'
]
=
[];
$data
[
'exclusive_img'
]
=
[];
foreach
(
$img_data
as
$k
=>
$v
)
{
$v
->
img_name
=
CK_IMG_URL
.
'images/'
.
$v
->
img_name
;
switch
(
$v
->
img_type
)
{
case
1
:
$data
[
'cover'
]
=
$v
->
img_name
;
break
;
case
2
:
$data
[
'slide_show'
][]
=
$v
->
img_name
;
break
;
case
3
:
$data
[
'plan'
][]
=
$v
->
img_name
;
break
;
default
:
$data
[
'exclusive_img'
][]
=
$v
->
img_name
;
if
(
$app
==
0
)
{
foreach
(
$img_data
as
$k
=>
$v
)
{
$v
->
img_name
=
CK_IMG_URL
.
'images/'
.
$v
->
img_name
;
switch
(
$v
->
img_type
)
{
case
1
:
$data
[
'cover'
]
=
$v
->
img_name
;
break
;
case
2
:
$data
[
'slide_show'
][]
=
$v
->
img_name
;
break
;
case
3
:
$data
[
'plan'
][]
=
$v
->
img_name
;
break
;
default
:
$data
[
'exclusive_img'
][]
=
$v
->
img_name
;
}
}
}
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
;
}
}
}
/*图片 start*/
}
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