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
e1b839fa
Commit
e1b839fa
authored
Jan 29, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商铺列表独家添加和编辑
parent
21afaf68
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
15 deletions
+76
-15
Houses.php
application/index/controller/Houses.php
+29
-8
GHouses.php
application/model/GHouses.php
+9
-4
GHousesImgs.php
application/model/GHousesImgs.php
+37
-3
route.php
application/route.php
+1
-0
No files found.
application/index/controller/Houses.php
View file @
e1b839fa
...
...
@@ -17,6 +17,10 @@ use think\Request;
class
Houses
extends
Basic
{
protected
$house
;
protected
$code
=
200
;
protected
$data
=
''
;
protected
$msg
=
''
;
public
function
__construct
(
Request
$request
=
null
)
{
...
...
@@ -216,18 +220,34 @@ class Houses extends Basic
* @return \think\Response
*/
public
function
carefullyChosen
()
{
$data
[
'status'
]
=
200
;
$data
[
'msg'
]
=
''
;
$data
[
'data'
]
=
''
;
if
(
$this
->
params
[
'houses_id'
]
!=
NULL
&&
$this
->
params
[
'is_carefully_chosen'
]
!=
NULL
)
{
$data
[
'is_carefully_chosen'
]
=
$this
->
params
[
'is_carefully_chosen'
];
$
data
[
'data'
]
=
$this
->
house
->
editData
(
$data
,
$this
->
params
[
'houses_id'
],
'id'
);
$
this
->
data
=
$this
->
house
->
editData
(
$data
,
$this
->
params
[
'houses_id'
],
'id'
);
}
else
{
$
data
[
'status'
]
=
101
;
$
data
[
'msg'
]
=
'houses_id or is_carefully_chosen is null'
;
$
this
->
code
=
101
;
$
this
->
msg
=
'houses_id or is_carefully_chosen is null'
;
}
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]);
return
$this
->
response
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
}
/**
* 商铺列表添加和编辑独家
*
* @return \think\Response
* @throws \Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
editExclusive
()
{
if
(
$this
->
params
[
'houses_id'
])
{
$this
->
data
=
$this
->
house
->
exclusive
(
$this
->
params
,
$this
->
params
[
'houses_id'
]);
}
else
{
$this
->
code
=
101
;
$this
->
msg
=
'houses_id is null'
;
}
return
$this
->
response
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
}
}
\ No newline at end of file
application/model/GHouses.php
View file @
e1b839fa
...
...
@@ -264,20 +264,25 @@ class GHouses extends BaseModel
*/
public
function
exclusive
(
$data
,
$house_id
)
{
$this
->
startTrans
();
$result
=
$this
->
save
([
'is_exclusive_type'
=>
$data
[
'is_exclusive_type'
]],[
'id'
=>
$house_id
]);
$result
=
$this
->
save
([
'is_exclusive_type'
=>
$data
[
'is_exclusive_type'
],
'update_time'
=>
date
(
'Y-m-d H:i:s'
)
],[
'id'
=>
$house_id
]);
if
(
$result
)
{
$ext
=
new
GHousesExt
();
$update_data
[
'agent_start_time'
]
=
$data
[
'agent_start_time'
];
$update_data
[
'agent_end_time'
]
=
$data
[
'agent_end_time'
];
$ext_result
=
$ext
->
save
(
$update_data
,[
'house_id'
=>
$data
[
'houses_id'
]]);
}
if
(
$result
==
1
||
$ext_result
==
1
)
{
$house_img
=
new
GHousesImgs
();
$house_img
->
edit
(
$data
,
$house_id
);
$agents
=
new
GHousesToAgents
();
$agents
->
addAgents
(
$data
[
'exclusive_id'
],
$house_id
,
3
);
}
if
(
$result
==
1
||
$ext_result
==
1
)
{
$this
->
commit
();
$return
=
true
;
}
else
{
...
...
application/model/GHousesImgs.php
View file @
e1b839fa
...
...
@@ -42,7 +42,7 @@ class GHousesImgs extends BaseModel
if
(
$params
[
'slide_show'
])
{
foreach
(
$params
[
'slide_show'
]
as
$k
=>
$v
)
{
$k
+=
$count
;
$insert_img
[
$k
][
'house_id'
]
=
$
params
[
'house_id'
]
;
$insert_img
[
$k
][
'house_id'
]
=
$
house_id
;
$insert_img
[
$k
][
'img_type'
]
=
2
;
$insert_img
[
$k
][
'img_name'
]
=
$v
;
$insert_img
[
$k
][
'create_time'
]
=
$params
[
'create_time'
];
...
...
@@ -58,7 +58,7 @@ class GHousesImgs extends BaseModel
if
(
$params
[
'plan'
])
{
foreach
(
$params
[
'plan'
]
as
$kk
=>
$vv
)
{
$kk
+=
$count
;
$insert_img
[
$kk
][
'house_id'
]
=
$
params
[
'house_id'
]
;
$insert_img
[
$kk
][
'house_id'
]
=
$
house_id
;
$insert_img
[
$kk
][
'img_type'
]
=
3
;
$insert_img
[
$kk
][
'img_name'
]
=
$vv
;
$insert_img
[
$kk
][
'create_time'
]
=
$params
[
'create_time'
];
...
...
@@ -66,6 +66,18 @@ class GHousesImgs extends BaseModel
}
}
//4独家合同
if
(
$params
[
'exclusive_img'
])
{
foreach
(
$params
[
'exclusive_img'
]
as
$kk
=>
$vv
)
{
$kk
+=
$count
;
$insert_img
[
$kk
][
'house_id'
]
=
$house_id
;
$insert_img
[
$kk
][
'img_type'
]
=
4
;
$insert_img
[
$kk
][
'img_name'
]
=
$vv
;
$insert_img
[
$kk
][
'create_time'
]
=
$params
[
'create_time'
];
$insert_img
[
$kk
][
'update_time'
]
=
$params
[
'update_time'
];
}
}
return
$this
->
saveAll
(
$insert_img
);
}
...
...
@@ -88,6 +100,7 @@ class GHousesImgs extends BaseModel
$house_img_edit
=
array
();
$slide_show
=
$params
[
'slide_show'
];
$plan
=
$params
[
'plan'
];
$exclusive_img
=
$params
[
'exclusive_img'
];
foreach
(
$house_img_data
as
$k
=>
$v
)
{
//1列表页封面图
...
...
@@ -138,7 +151,28 @@ class GHousesImgs extends BaseModel
}
}
}
else
{
//伪删除全部的轮播图
//伪删除全部的平面图
$house_img_edit
[
$key
][
'id'
]
=
$v
->
id
;
$house_img_edit
[
$key
][
'img_status'
]
=
1
;
$key
++
;
}
}
//4独家合同
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
++
;
...
...
application/route.php
View file @
e1b839fa
...
...
@@ -106,6 +106,7 @@ Route::group('index', [
'regions'
=>
[
'index/BusinessDistrict/regions'
,
[
'method'
=>
'get'
]],
//获取省市区数据
'getHouseList'
=>
[
'index/houses/getHouseList'
,
[
'method'
=>
'get'
]],
//楼盘列表
'carefullyChosen'
=>
[
'index/houses/carefullyChosen'
,
[
'method'
=>
'post'
]],
//设置精选楼盘
'editExclusive'
=>
[
'index/houses/editExclusive'
,
[
'method'
=>
'post'
]],
//添加和编辑楼盘独家
]);
...
...
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