Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
fenzhan_zsb
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
esf
fenzhan_zsb
Commits
963f994b
Commit
963f994b
authored
Jul 06, 2020
by
liuqiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
没有封面时候 取小区封面图作为房源封面 没有则为空
parent
f75d35e7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
sell.php
new_admincp/applications/zsb/controllers/sell.php
+6
-0
pic_model.php
new_admincp/applications/zsb/models/pic_model.php
+10
-1
No files found.
new_admincp/applications/zsb/controllers/sell.php
View file @
963f994b
...
...
@@ -2761,6 +2761,12 @@ class Sell extends MY_Controller {
$pic1
=
reset
(
$imageUrlArr
);
$pic1
=
preg_match
(
"#\?#"
,
$pic1
)
?
substr
(
$pic1
,
0
,
strpos
(
$pic1
,
'?'
))
:
$pic1
;
}
else
{
// 封面 房源 360 都不存在图片 获取小区封面图 如果不存在封面图则房源封面图为空
//查找小区的封面图
$this
->
block_model
->
set_select_fields
(
array
(
'b_img'
));
$block
=
$this
->
block_model
->
find_by_id
(
$blockid
);
$pic1
=
(
isset
(
$block
[
'b_img'
])
&&
$block
[
'b_img'
])
?
$block
[
'b_img'
]
:
''
;
}
//加载业务模块
...
...
new_admincp/applications/zsb/models/pic_model.php
View file @
963f994b
...
...
@@ -1003,8 +1003,17 @@ class Pic_model extends MY_Model {
{
$this
->
db
->
where
(
'sort'
,
$sort
);
}
$housePic
=
$this
->
db
->
get
(
$uploadtable
)
->
result_array
();
return
$this
->
db
->
get
(
$uploadtable
)
->
result_array
();
// 增加与封面图相同格式的图片地址(封面地址不包含?之后的数据)
foreach
(
$housePic
as
&
$item
)
{
// 判断是否存在filename字段,防止程序出错
if
(
isset
(
$item
[
'filename'
])
&&
$item
[
'filename'
])
{
$subLength
=
strpos
(
$item
[
'filename'
],
'?'
);
$item
[
'img_url'
]
=
$subLength
?
substr
(
$item
[
'filename'
],
0
,
$subLength
)
:
$item
[
'filename'
];
}
}
return
$housePic
;
}
/**
...
...
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