Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
ruer_cms
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蔡闯
ruer_cms
Commits
437491c4
Commit
437491c4
authored
Feb 22, 2021
by
蔡闯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
社区联系电话
parent
1986339e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
1 deletion
+59
-1
app/api/controller/Index.php
app/api/controller/Index.php
+1
-1
app/shequ/controller/Village.php
app/shequ/controller/Village.php
+54
-0
config/app.php
config/app.php
+4
-0
No files found.
app/api/controller/Index.php
View file @
437491c4
...
...
@@ -134,7 +134,7 @@ class Index extends Base
$village_id
=
Request
::
param
(
'village_id'
);
$where
[
'village_id'
]
=
$village_id
;
$where
[
'status'
]
=
1
;
$data
=
Db
::
name
(
'village_phone'
)
->
where
(
$where
)
->
order
([
'is_on_call_phone'
=>
'desc'
,
'sort'
=>
'desc'
])
->
select
()
->
toArray
();
$data
=
Db
::
name
(
'village_phone'
)
->
where
(
$where
)
->
order
([
'is_on_call_phone'
=>
'desc'
,
'sort
_id
'
=>
'desc'
])
->
select
()
->
toArray
();
return
$this
->
returnJson
(
$data
);
}
...
...
app/shequ/controller/Village.php
View file @
437491c4
...
...
@@ -203,6 +203,60 @@ class Village extends Base
}
//社区联系电话列表
public
function
villagePhone
()
{
$where
[
'village_id'
]
=
$this
->
village_id
;
$page
=
Request
::
param
(
'page'
,
1
);
$data
=
Db
::
name
(
'village_phone'
)
->
where
(
$where
)
->
order
(
'sort_id'
,
'desc'
)
->
page
(
$page
,
config
(
'app.limit'
))
->
select
()
->
toArray
();
return
$this
->
returnJson
(
$data
);
}
//添加或修改社区联系电话
public
function
changeVillagePhone
()
{
$village_phone_id
=
Request
::
param
(
'village_phone_id'
);
$save
[
'village_id'
]
=
$this
->
village_id
;
$save
[
'name'
]
=
Request
::
param
(
'name'
);;
$save
[
'phone'
]
=
Request
::
param
(
'phone'
);
$save
[
'sort_id'
]
=
Request
::
param
(
'sort_id'
,
0
);
$save
[
'status'
]
=
Request
::
param
(
'status'
,
1
);
$save
[
'is_on_call_phone'
]
=
Request
::
param
(
'is_on_call_phone'
,
0
);
if
(
$village_phone_id
)
{
$where
[
'village_phone_id'
]
=
(
int
)
$village_phone_id
;
$operation
=
Db
::
name
(
'village_phone'
)
->
where
(
$where
)
->
save
(
$save
);
$msg
=
"添加失败"
;
}
else
{
$operation
=
Db
::
name
(
'village_phone'
)
->
insert
(
$save
);
$msg
=
"修改失败"
;
}
if
(
$operation
!==
false
)
{
return
$this
->
returnJson
();
}
else
{
return
$this
->
returnJson
([],
$msg
,
400
);
}
}
//删除社区联系电话
public
function
deleteVillagePhone
()
{
$where
[
'village_phone_id'
]
=
Request
::
param
(
'village_phone_id'
);
$where
[
'village_id'
]
=
$this
->
village_id
;
$delete
=
Db
::
name
(
'village_phone'
)
->
where
(
$where
)
->
delete
();
if
(
$delete
!=
false
)
{
return
$this
->
returnJson
();
}
else
{
return
$this
->
returnJson
([],
'删除失败'
,
400
);
}
}
...
...
config/app.php
View file @
437491c4
...
...
@@ -31,6 +31,8 @@ return [
'show_error_msg'
=>
false
,
//以下都是自定义配置
//接口数据分页
'limit'
=>
15
,
...
...
@@ -74,4 +76,6 @@ return [
];
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