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
b3bad4a1
Commit
b3bad4a1
authored
Dec 18, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
//
parent
d75a24f4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
46 deletions
+41
-46
HouseService.php
application/index/service/HouseService.php
+9
-0
GHousesImgs.php
application/model/GHousesImgs.php
+32
-46
No files found.
application/index/service/HouseService.php
View file @
b3bad4a1
...
...
@@ -146,14 +146,23 @@ class HouseService
if
(
$is_app
==
1
)
{
if
(
isset
(
$data
[
'cover'
]))
{
$data
[
'cover'
]
=
json_decode
(
$data
[
'cover'
],
true
);
foreach
(
$data
[
'cover'
]
as
$k
=>
$v
)
{
$data
[
'cover'
][
$k
]
=
stripslashes
(
$v
);
}
}
if
(
isset
(
$data
[
'slide_show'
]))
{
$data
[
'slide_show'
]
=
json_decode
(
$data
[
'slide_show'
],
true
);
foreach
(
$data
[
'slide_show'
]
as
$k
=>
$v
)
{
$data
[
'slide_show'
][
$k
]
=
stripslashes
(
$v
);
}
}
if
(
isset
(
$data
[
'exclusive_img'
]))
{
$data
[
'exclusive_img'
]
=
json_decode
(
$data
[
'exclusive_img'
],
true
);
foreach
(
$data
[
'exclusive_img'
]
as
$k
=>
$v
)
{
$data
[
'exclusive_img'
][
$k
]
=
stripslashes
(
$v
);
}
}
}
...
...
application/model/GHousesImgs.php
View file @
b3bad4a1
...
...
@@ -95,21 +95,18 @@ class GHousesImgs extends BaseModel
public
function
edit
(
$params
,
$house_id
)
{
try
{
//编辑图片
$where
[
'img_status'
]
=
[
'<>'
,
1
]
;
$where
[
'img_status'
]
=
0
;
$where
[
'house_id'
]
=
$house_id
;
$house_img_data
=
$this
->
getListAll
(
'id,img_name,img_type'
,
$where
);
$key
=
0
;
$house_img_edit
=
array
();
$slide_show
=
$params
[
'slide_show'
];
$plan
=
$params
[
'plan'
];
$exclusive_img
=
$params
[
'exclusive_img'
];
foreach
(
$house_img_data
as
$k
=>
$v
)
{
switch
(
$v
[
'img_type'
])
{
case
1
:
//1列表页封面图
if
(
isset
(
$params
[
'cover'
]))
{
if
(
$params
[
'cover'
]
!=
$v
->
img_name
)
{
if
(
$params
[
'cover'
]
!=
$v
[
'img_name'
]
)
{
/*伪删除之前的图片*/
$house_img_edit
[
$key
][
'id'
]
=
$v
->
id
;
$house_img_edit
[
$key
][
'img_status'
]
=
1
;
...
...
@@ -123,15 +120,13 @@ class GHousesImgs extends BaseModel
case
2
:
//2详情页轮播图
if
(
isset
(
$params
[
'slide_show'
]))
{
if
(
empty
(
$slide_show
))
{
foreach
(
$slide_show
as
$kk
=>
$vv
)
{
if
(
in_array
(
$v
->
img_name
,
$slide_show
))
{
$params
[
'slide_show'
]
=
del_array_string
(
$v
->
img_name
,
$params
[
'slide_show'
]);
}
else
{
$house_img_edit
[
$key
][
'id'
]
=
$v
->
id
;
$house_img_edit
[
$key
][
'img_status'
]
=
1
;
$key
++
;
}
if
(
empty
(
$params
[
'slide_show'
]))
{
if
(
in_array
(
$v
[
'img_name'
],
$params
[
'slide_show'
]))
{
$params
[
'slide_show'
]
=
del_array_string
(
$v
->
img_name
,
$params
[
'slide_show'
]);
}
else
{
$house_img_edit
[
$key
][
'id'
]
=
$v
->
id
;
$house_img_edit
[
$key
][
'img_status'
]
=
1
;
$key
++
;
}
}
else
{
//伪删除全部的轮播图
...
...
@@ -144,15 +139,13 @@ class GHousesImgs extends BaseModel
case
3
:
//3楼层平面图
if
(
isset
(
$params
[
'plan'
]))
{
if
(
empty
(
$plan
))
{
foreach
(
$plan
as
$kk
=>
$vv
)
{
if
(
in_array
(
$v
->
img_name
,
$plan
))
{
$params
[
'plan'
]
=
del_array_string
(
$v
->
img_name
,
$params
[
'plan'
]);
}
else
{
$house_img_edit
[
$key
][
'id'
]
=
$v
->
id
;
$house_img_edit
[
$key
][
'img_status'
]
=
1
;
$key
++
;
}
if
(
empty
(
$params
[
'plan'
]))
{
if
(
in_array
(
$v
[
'img_name'
],
$params
[
'plan'
]))
{
$params
[
'plan'
]
=
del_array_string
(
$v
->
img_name
,
$params
[
'plan'
]);
}
else
{
$house_img_edit
[
$key
][
'id'
]
=
$v
->
id
;
$house_img_edit
[
$key
][
'img_status'
]
=
1
;
$key
++
;
}
}
else
{
//伪删除全部的平面图
...
...
@@ -165,15 +158,13 @@ class GHousesImgs extends BaseModel
case
4
:
//4独家合同
if
(
isset
(
$params
[
'exclusive_img'
]))
{
if
(
!
empty
(
$exclusive_img
))
{
foreach
(
$exclusive_img
as
$kk
=>
$vv
)
{
if
(
in_array
(
$v
->
img_name
,
$exclusive_img
))
{
$params
[
'exclusive_img'
]
=
del_array_string
(
$v
->
img_name
,
$params
[
'exclusive_img'
]);
}
else
{
$house_img_edit
[
$key
][
'id'
]
=
$v
->
id
;
$house_img_edit
[
$key
][
'img_status'
]
=
1
;
$key
++
;
}
if
(
!
empty
(
$params
[
'exclusive_img'
]))
{
if
(
in_array
(
$v
[
'img_name'
],
$params
[
'exclusive_img'
]))
{
$params
[
'exclusive_img'
]
=
del_array_string
(
$v
[
'img_name'
],
$params
[
'exclusive_img'
]);
}
else
{
$house_img_edit
[
$key
][
'id'
]
=
$v
->
id
;
$house_img_edit
[
$key
][
'img_status'
]
=
1
;
$key
++
;
}
}
else
{
//伪删除全部的独家图片
...
...
@@ -185,7 +176,6 @@ class GHousesImgs extends BaseModel
break
;
}
}
$this
->
add
(
$params
,
$house_id
);
$this
->
saveAll
(
$house_img_edit
);
$result
[
'status'
]
=
'successful'
;
...
...
@@ -274,28 +264,24 @@ class GHousesImgs extends BaseModel
public
function
editExclusiveImg
(
$params
,
$house_id
)
{
//编辑图片
$house_img_data
=
$this
->
field
(
'id,img_name,img_type'
)
->
where
(
'img_status
<> 1
AND img_type = 4 AND house_id = '
.
$house_id
)
->
select
();
->
where
(
'img_status
= 0
AND img_type = 4 AND house_id = '
.
$house_id
)
->
select
();
$key
=
0
;
$house_img_edit
=
array
();
$exclusive_img
=
$params
[
'exclusive_img'
];
foreach
(
$house_img_data
as
$k
=>
$v
)
{
if
(
$v
->
img_type
==
4
)
{
if
(
$exclusive_img
!=
''
)
{
foreach
(
$exclusive_img
as
$kk
=>
$vv
)
{
if
(
in_array
(
$v
->
img_name
,
$exclusive_img
))
{
$params
[
'exclusive_img'
]
=
del_array_string
(
$v
->
img_name
,
$params
[
'exclusive_img'
]);
}
else
{
$house_img_edit
[
$key
][
'id'
]
=
$v
->
id
;
$house_img_edit
[
$key
][
'img_status'
]
=
1
;
$key
++
;
}
}
if
(
$exclusive_img
!=
''
)
{
if
(
in_array
(
$v
->
img_name
,
$exclusive_img
))
{
$params
[
'exclusive_img'
]
=
del_array_string
(
$v
->
img_name
,
$params
[
'exclusive_img'
]);
}
else
{
//伪删除全部的独家图片
$house_img_edit
[
$key
][
'id'
]
=
$v
->
id
;
$house_img_edit
[
$key
][
'img_status'
]
=
1
;
$key
++
;
}
}
else
{
//伪删除全部的独家图片
$house_img_edit
[
$key
][
'id'
]
=
$v
->
id
;
$house_img_edit
[
$key
][
'img_status'
]
=
1
;
$key
++
;
}
}
...
...
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