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
93df3da8
Commit
93df3da8
authored
Jun 13, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改状态
parent
78193d7a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
5 deletions
+53
-5
OfficeRoomService.php
application/index/service/OfficeRoomService.php
+31
-0
OfficeService.php
application/index/service/OfficeService.php
+2
-1
OfficeBuildingValidate.php
application/index/validate/OfficeBuildingValidate.php
+10
-4
OfficeGRoom.php
application/model/OfficeGRoom.php
+10
-0
No files found.
application/index/service/OfficeRoomService.php
View file @
93df3da8
...
@@ -1460,4 +1460,34 @@ class OfficeRoomService
...
@@ -1460,4 +1460,34 @@ class OfficeRoomService
}
}
return
$result
;
return
$result
;
}
}
/**
* 修改上下架
*
* @param int $building_id
* @param int $status //状态 1上架 2下架 3回收
* @return mixed
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public
function
downStatus
(
int
$building_id
,
int
$status
)
{
$result
[
'status'
]
=
'fail'
;
$result
[
'msg'
]
=
''
;
$result
[
'data'
]
=
[];
if
(
empty
(
$building_id
)
||
empty
(
$status
))
{
$result
[
'msg'
]
=
'参数错误'
;
return
$result
;
}
$where
[
'building_id'
]
=
$building_id
;
$where
[
'status'
]
=
[
'<>'
,
3
];
$num
=
$this
->
m_office_room
->
updateData
([
'status'
=>
$status
],
$where
);
if
(
$num
>
0
)
{
$result
[
'status'
]
=
'successful'
;
$result
[
'msg'
]
=
'修改成功'
;
}
else
{
$result
[
'msg'
]
=
'修改失败'
;
}
return
$result
;
}
}
}
\ No newline at end of file
application/index/service/OfficeService.php
View file @
93df3da8
...
@@ -64,7 +64,7 @@ class OfficeService
...
@@ -64,7 +64,7 @@ class OfficeService
$result
[
'msg'
]
=
$this
->
validate
->
getError
();
$result
[
'msg'
]
=
$this
->
validate
->
getError
();
return
$result
;
return
$result
;
}
}
$data
[
'status'
]
=
1
;
$id
=
$this
->
m_office
->
addOffice
(
$data
,
$agent_id
);
$id
=
$this
->
m_office
->
addOffice
(
$data
,
$agent_id
);
if
(
$id
>
0
)
{
if
(
$id
>
0
)
{
...
@@ -112,6 +112,7 @@ class OfficeService
...
@@ -112,6 +112,7 @@ class OfficeService
$this
->
m_office_img
->
edit
(
$data
[
'building_images'
],
$id
,
0
);
$this
->
m_office_img
->
edit
(
$data
[
'building_images'
],
$id
,
0
);
}
}
$this
->
service_room
->
downStatus
(
$id
,
1
);
$result
[
'status'
]
=
'successful'
;
$result
[
'status'
]
=
'successful'
;
}
else
{
}
else
{
$result
[
'msg'
]
=
'新增或编辑失败!'
;
$result
[
'msg'
]
=
'新增或编辑失败!'
;
...
...
application/index/validate/OfficeBuildingValidate.php
View file @
93df3da8
...
@@ -27,7 +27,9 @@ class OfficeBuildingValidate extends Validate
...
@@ -27,7 +27,9 @@ class OfficeBuildingValidate extends Validate
'longitude'
=>
'require|min:1'
,
'longitude'
=>
'require|min:1'
,
'latitude'
=>
'require|min:1'
,
'latitude'
=>
'require|min:1'
,
'business_district_id'
=>
'require|between: 1,99999999999'
,
'business_district_id'
=>
'require|between: 1,99999999999'
,
'intro'
=>
'require|length:1,255'
'intro'
=>
'require|length:1,255'
,
'add_building_stations'
=>
'require|min:5'
,
'building_images'
=>
'require'
];
];
protected
$message
=
[
protected
$message
=
[
...
@@ -55,14 +57,17 @@ class OfficeBuildingValidate extends Validate
...
@@ -55,14 +57,17 @@ class OfficeBuildingValidate extends Validate
'intro.length'
=>
'楼盘简介要做1至255个字'
,
'intro.length'
=>
'楼盘简介要做1至255个字'
,
'floor_total.require'
=>
'总层数不能为空'
,
'floor_total.require'
=>
'总层数不能为空'
,
'floor_total.between'
=>
'总层数参数错误'
,
'floor_total.between'
=>
'总层数参数错误'
,
'type.require'
=>
'类型不为空'
'type.require'
=>
'类型不为空'
,
'add_building_stations.require'
=>
'地铁必选'
,
'add_building_stations.min'
=>
'地铁参数错误'
,
'building_images.require'
=>
'楼盘图片必传'
,
];
];
protected
$scene
=
[
protected
$scene
=
[
'add'
=>
[
'title'
,
'address'
,
'province'
,
'city'
,
'disc'
,
'type'
,
'floor_total'
,
'longitude'
,
'latitude'
,
'add'
=>
[
'title'
,
'address'
,
'province'
,
'city'
,
'disc'
,
'type'
,
'floor_total'
,
'longitude'
,
'latitude'
,
'business_district_id'
,
'upload_id'
,
'intro'
],
'business_district_id'
,
'upload_id'
,
'intro'
,
'building_images'
,
'add_building_stations'
],
'edit'
=>
[
'id'
,
'title'
,
'address'
,
'province'
,
'city'
,
'disc'
,
'type'
,
'floor_total'
,
'longitude'
,
'latitude'
,
'edit'
=>
[
'id'
,
'title'
,
'address'
,
'province'
,
'city'
,
'disc'
,
'type'
,
'floor_total'
,
'longitude'
,
'latitude'
,
'business_district_id'
,
'intro'
],
'business_district_id'
,
'intro'
,
'building_images'
,
'add_building_stations'
],
'detail'
=>
[
'id'
]
'detail'
=>
[
'id'
]
];
];
}
}
\ No newline at end of file
application/model/OfficeGRoom.php
View file @
93df3da8
...
@@ -469,4 +469,14 @@ class OfficeGRoom extends BaseModel
...
@@ -469,4 +469,14 @@ class OfficeGRoom extends BaseModel
return
$result
;
return
$result
;
}
}
/**
* @param $data
* @param $where
* @return int|string
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public
function
updateData
(
$data
,
$where
)
{
return
$this
->
db_
->
where
(
$where
)
->
update
(
$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