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
87de2d3e
Commit
87de2d3e
authored
Apr 09, 2018
by
clone
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test' of
https://gitee.com/zwyjjc/tl_estate
into test
parents
47650b64
a89c33ba
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
5 deletions
+52
-5
GHouses.php
application/model/GHouses.php
+1
-1
GHousesImgs.php
application/model/GHousesImgs.php
+45
-0
edit.js
public/resource/js/edit.js
+4
-3
houseList.js
public/resource/js/houseList.js
+2
-1
No files found.
application/model/GHouses.php
View file @
87de2d3e
...
...
@@ -395,7 +395,7 @@ class GHouses extends BaseModel
$ext_result
=
$ext
->
save
(
$update_data
,
[
'house_id'
=>
$data
[
'houses_id'
]
]);
$house_img
=
new
GHousesImgs
();
$house_img
->
edit
(
$data
,
$house_id
);
$house_img
->
edit
ExclusiveImg
(
$data
,
$house_id
);
$agents
=
new
GHousesToAgents
();
$agents
->
addAgents
(
$data
[
'exclusive_id'
],
$house_id
,
3
);
...
...
application/model/GHousesImgs.php
View file @
87de2d3e
...
...
@@ -220,4 +220,48 @@ class GHousesImgs extends BaseModel
'img_name'
=>
$data
[
'img_name'
]
]);
}
/**
* 独家图片新增和编辑
*
* @param $params
* @param $house_id
* @return array|false
* @throws \Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
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
();
$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
))
{
$img_key
=
array_search
(
$v
->
img_name
,
$params
[
'exclusive_img'
]);
//根据值查找对应的key
unset
(
$params
[
'exclusive_img'
][
$img_key
]);
}
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
++
;
}
}
}
$this
->
add
(
$params
,
$house_id
);
return
$this
->
saveAll
(
$house_img_edit
);
}
}
\ No newline at end of file
public/resource/js/edit.js
View file @
87de2d3e
...
...
@@ -110,12 +110,13 @@ define (['ckfinder','ckfinderStart', 'bootstrapJs'], function () {
_exclusiveTelObj
.
val
(
_data
[
'exclusive_name'
][
i
]).
attr
(
'data-id'
,
_data
[
'exclusive_name'
][
i
].
split
(
'-'
)[
0
]);
};
//独家合同
var
exclusive_img_str
=
''
;
for
(
var
i
in
_data
[
'exclusive_img'
]){
_imgUploadDujia
.
html
(
'<li><img title="点击查看大图" src="{0}" /><a href="javascript:;" class="delet-pic-btn">删除</a></li>'
.
stringFormatObj
({
exclusive_img_str
+=
'<li><img title="点击查看大图" src="{0}" /><a href="javascript:;" class="delet-pic-btn">删除</a></li>'
.
stringFormatObj
({
'0'
:
_urlCut
+
_data
[
'exclusive_img'
][
i
]
})
)
;
});
};
_imgUploadDujia
.
html
(
exclusive_img_str
);
};
//案场人电话
...
...
public/resource/js/houseList.js
View file @
87de2d3e
...
...
@@ -128,6 +128,7 @@ define (['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css','ckfin
var
img_url
=
""
;
BrowseServer
(
'liudan_pic_btn'
,
function
(
url
){
var
alt_img
=
$
(
"#liudan_pic_btn"
).
val
();
alt_img
=
alt_img
.
replace
(
'images/'
,
''
);
img_url
+=
' <img src="'
+
url
+
'" class="jai_dujia" data-img="'
+
alt_img
+
'">'
;
$
(
"#liudan_pic_pre"
).
append
(
img_url
);
});
...
...
@@ -171,7 +172,7 @@ define (['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css','ckfin
exclusive_id
=
data
.
data
.
id
;
var
img_url
=
""
;
$
.
each
(
data
[
'data'
][
'exclusive_img'
],
function
(
i
,
item
)
{
var
local_img
=
location
.
origin
+
'/resource/lib/Attachments/'
+
item
.
img_name
;
var
local_img
=
location
.
origin
+
'/resource/lib/Attachments/
images/
'
+
item
.
img_name
;
img_url
+=
'<img src="'
+
local_img
+
'" class="jai_dujia" data-img="'
+
item
.
img_name
+
'" >'
;
});
$
(
"#liudan_pic_pre"
).
html
(
img_url
);
...
...
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