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
cac152f2
Commit
cac152f2
authored
Jan 15, 2021
by
蔡闯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
人脸图片上传
parent
daec9f86
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
134 additions
and
60 deletions
+134
-60
app/admin/controller/Index.php
app/admin/controller/Index.php
+0
-6
app/api/controller/Base.php
app/api/controller/Base.php
+20
-20
app/api/controller/Index.php
app/api/controller/Index.php
+1
-2
app/api/controller/Payreturn.php
app/api/controller/Payreturn.php
+1
-2
app/api/controller/User.php
app/api/controller/User.php
+74
-16
app/common/controller/Common.php
app/common/controller/Common.php
+20
-1
app/model/User.php
app/model/User.php
+12
-0
app/shequ/controller/News.php
app/shequ/controller/News.php
+6
-13
No files found.
app/admin/controller/Index.php
View file @
cac152f2
...
@@ -223,7 +223,6 @@ class Index extends Base {
...
@@ -223,7 +223,6 @@ class Index extends Base {
}
else
{
}
else
{
return
$this
->
returnJson
([],
'error'
,
400
);
return
$this
->
returnJson
([],
'error'
,
400
);
}
}
}
}
//查看单个物业公司详情
//查看单个物业公司详情
...
@@ -262,7 +261,6 @@ class Index extends Base {
...
@@ -262,7 +261,6 @@ class Index extends Base {
public
function
detailNav
()
{
public
function
detailNav
()
{
$type
=
Request
::
param
(
'type'
,
3
);
$type
=
Request
::
param
(
'type'
,
3
);
$id
=
Request
::
param
(
'id'
);
$id
=
Request
::
param
(
'id'
);
if
(
$type
==
1
)
{
if
(
$type
==
1
)
{
$data
=
DB
::
name
(
'admin_nav'
)
->
where
([
'admin_nav_id'
=>
$id
])
->
find
();
$data
=
DB
::
name
(
'admin_nav'
)
->
where
([
'admin_nav_id'
=>
$id
])
->
find
();
if
(
$data
[
'parent_id'
]
!=
0
)
{
if
(
$data
[
'parent_id'
]
!=
0
)
{
...
@@ -299,8 +297,6 @@ class Index extends Base {
...
@@ -299,8 +297,6 @@ class Index extends Base {
$type
=
Request
::
param
(
'type'
,
3
);
//1:总后台;2:物业后台;3:社区后台
$type
=
Request
::
param
(
'type'
,
3
);
//1:总后台;2:物业后台;3:社区后台
$data
[
'parent_id'
]
=
Request
::
param
(
'parent_id'
,
0
);
$data
[
'parent_id'
]
=
Request
::
param
(
'parent_id'
,
0
);
$data
[
'icon'
]
=
Request
::
param
(
'icon'
);
$data
[
'icon'
]
=
Request
::
param
(
'icon'
);
$data
[
'url'
]
=
Request
::
param
(
'url'
,
''
);
$data
[
'url'
]
=
Request
::
param
(
'url'
,
''
);
$data
[
'url_name'
]
=
Request
::
param
(
'url_name'
);
$data
[
'url_name'
]
=
Request
::
param
(
'url_name'
);
$data
[
'sort_id'
]
=
Request
::
param
(
'sort_id'
);
$data
[
'sort_id'
]
=
Request
::
param
(
'sort_id'
);
...
@@ -406,10 +402,8 @@ class Index extends Base {
...
@@ -406,10 +402,8 @@ class Index extends Base {
if
(
$type
==
1
)
{
if
(
$type
==
1
)
{
$is_zi
=
Db
::
name
(
'admin_nav'
)
->
where
([
'parent_id'
=>
$id
])
->
find
();
$is_zi
=
Db
::
name
(
'admin_nav'
)
->
where
([
'parent_id'
=>
$id
])
->
find
();
}
elseif
(
$type
==
2
)
{
}
elseif
(
$type
==
2
)
{
$is_zi
=
Db
::
name
(
'property_nav'
)
->
where
([
'parent_id'
=>
$id
])
->
find
();
$is_zi
=
Db
::
name
(
'property_nav'
)
->
where
([
'parent_id'
=>
$id
])
->
find
();
}
else
{
}
else
{
$is_zi
=
Db
::
name
(
'community_nav'
)
->
where
([
'parent_id'
=>
$id
])
->
find
();
$is_zi
=
Db
::
name
(
'community_nav'
)
->
where
([
'parent_id'
=>
$id
])
->
find
();
}
}
...
...
app/api/controller/Base.php
View file @
cac152f2
app/api/controller/Index.php
View file @
cac152f2
...
@@ -109,8 +109,6 @@ class Index extends Base
...
@@ -109,8 +109,6 @@ class Index extends Base
}
}
//常用电话
//常用电话
public
function
commonPhone
()
{
public
function
commonPhone
()
{
$village_id
=
Request
::
param
(
'village_id'
);
$village_id
=
Request
::
param
(
'village_id'
);
...
@@ -169,6 +167,7 @@ class Index extends Base
...
@@ -169,6 +167,7 @@ class Index extends Base
}
}
$data
[
'name'
]
=
Request
::
param
(
'name'
);
$data
[
'name'
]
=
Request
::
param
(
'name'
);
$data
[
'car_color'
]
=
Request
::
param
(
'car_color'
);
$data
[
'car_color'
]
=
Request
::
param
(
'car_color'
);
$data
[
'village_id'
]
=
Request
::
param
(
'village_id'
);
$data
[
'brand'
]
=
Request
::
param
(
'brand'
);
$data
[
'brand'
]
=
Request
::
param
(
'brand'
);
$data
[
'car_type'
]
=
Request
::
param
(
'car_type'
);
$data
[
'car_type'
]
=
Request
::
param
(
'car_type'
);
...
...
app/api/controller/Payreturn.php
View file @
cac152f2
...
@@ -32,8 +32,8 @@ class Payreturn extends BaseController
...
@@ -32,8 +32,8 @@ class Payreturn extends BaseController
$testxml
=
file_get_contents
(
"php://input"
);
$testxml
=
file_get_contents
(
"php://input"
);
$jsonxml
=
json_encode
(
simplexml_load_string
(
$testxml
,
'SimpleXMLElement'
,
LIBXML_NOCDATA
));
$jsonxml
=
json_encode
(
simplexml_load_string
(
$testxml
,
'SimpleXMLElement'
,
LIBXML_NOCDATA
));
$result
=
json_decode
(
$jsonxml
,
true
);
$result
=
json_decode
(
$jsonxml
,
true
);
//生成日志
$this
->
createPayLog
(
$result
,
"微信"
);
$this
->
createPayLog
(
$result
,
"微信"
);
if
(
$result
){
if
(
$result
){
//如果成功返回了
//如果成功返回了
if
(
$result
[
'return_code'
]
==
'SUCCESS'
&&
$result
[
'result_code'
]
==
'SUCCESS'
){
if
(
$result
[
'return_code'
]
==
'SUCCESS'
&&
$result
[
'result_code'
]
==
'SUCCESS'
){
...
@@ -44,7 +44,6 @@ class Payreturn extends BaseController
...
@@ -44,7 +44,6 @@ class Payreturn extends BaseController
</xml>"
);
</xml>"
);
}
}
}
}
}
}
}
}
...
...
app/api/controller/User.php
View file @
cac152f2
...
@@ -7,6 +7,7 @@ namespace app\api\controller;
...
@@ -7,6 +7,7 @@ namespace app\api\controller;
use
app\common\controller\Common
;
use
app\common\controller\Common
;
use
think\facade\Db
;
use
think\facade\Db
;
use
think\facade\Request
;
use
think\facade\Request
;
use
app\model\User
as
UserModel
;
class
User
extends
Base
class
User
extends
Base
{
{
...
@@ -187,29 +188,86 @@ class User extends Base
...
@@ -187,29 +188,86 @@ class User extends Base
//查看所有的房间,如果是业主,展示房间下的所有租客或家属
//查看所有的房间,如果是业主,展示房间下的所有租客或家属
public
function
getUserVacancy
()
{
// public function getUserVacancy() {
$uid
=
$this
->
uid
;
// $uid = $this->uid;
$where
[
'hub.uid'
]
=
$uid
;
// $where['hub.uid'] = $uid;
// $data = Db::name('house_user_bind')->alias('hub')
// ->leftJoin('house_vacancy hv','hv.vacancy_id = hub.vacancy_id')
// ->leftJoin('house_village hvi','hvi.village_id = hub.village_id')
// ->where($where)->whereIn('hub.status',[1,2,4])
// ->field('hub.type,hub.house_user_bind_id,hub.vacancy_id,parent_id,hv.vacancy_code,hv.layout_id,hv.name,hv.phone,hvi.village_name')
// ->select()->toArray();
// foreach ($data as $k =>$v) {
// $data[$k]['vacancy_address'] = Common::getVacancyAddress($v['vacancy_code'],$v['layout_id']);
// if($v['type'] ==0) {
// //如果是业主身份,查找下面的租客或家属等
// $data[$k]['myTenant'] = Db::name('house_user_bind')->where(['vacancy_id'=>$v['vacancy_id']])->whereIn('type',[1,2,3])->field('name,phone,status')->select()->toArray();
// }else{
// //如果是租客身份,查找所属业主
// $data[$k]['myOwner'] = Db::name('house_user_bind')->where(['vacancy_id'=>$v['vacancy_id'],'type'=>0,'status'=>1])->field('name,phone,status')->find();
// }
// }
//
// return $this->returnJson($data);
// }
//个人中心
public
function
person
(){
$bind_id
=
Request
::
param
(
'bind_id'
);
$where
[
'hub.house_user_bind_id'
]
=
$bind_id
;
$where
[
'hub.uid'
]
=
$this
->
uid
;
$data
=
Db
::
name
(
'house_user_bind'
)
->
alias
(
'hub'
)
$data
=
Db
::
name
(
'house_user_bind'
)
->
alias
(
'hub'
)
->
leftJoin
(
'house_vacancy hv'
,
'hv.vacancy_id = hub.vacancy_id'
)
->
leftJoin
(
'house_vacancy hv'
,
'hv.vacancy_id = hub.vacancy_id'
)
->
leftJoin
(
'house_village hvi'
,
'hvi.village_id = hub.village_id'
)
->
where
(
$where
)
->
where
(
$where
)
->
whereIn
(
'hub.status'
,[
1
,
2
,
4
])
->
field
(
'hub.name,hv.vacancy_code,hv.layout_id,hv.village_id'
)
->
field
(
'hub.type,hub.house_user_bind_id,hub.vacancy_id,parent_id,hv.vacancy_code,hv.layout_id,hv.name,hv.phone,hvi.village_name'
)
->
find
();
->
select
()
->
toArray
();
//获取当日值班电话
foreach
(
$data
as
$k
=>
$v
)
{
if
(
$data
)
{
$data
[
$k
][
'vacancy_address'
]
=
Common
::
getVacancyAddress
(
$v
[
'vacancy_code'
],
$v
[
'layout_id'
]);
$phone
=
Db
::
name
(
'village_phone'
)
->
where
([
'village_id'
=>
$data
[
'village_id'
],
'is_on_call_phone'
=>
1
,
'status'
=>
1
])
->
value
(
'phone'
);
if
(
$v
[
'type'
]
==
0
)
{
$res
=
Common
::
getVacancyAddress
(
$data
[
'vacancy_code'
],
$data
[
'layout_id'
]);
//如果是业主身份,查找下面的租客或家属等
$data
[
'vacancy_address'
]
=
$res
[
'vacancy_address'
];
$data
[
$k
][
'myTenant'
]
=
Db
::
name
(
'house_user_bind'
)
->
where
([
'vacancy_id'
=>
$v
[
'vacancy_id'
]])
->
whereIn
(
'type'
,[
1
,
2
,
3
])
->
field
(
'name,phone,status'
)
->
select
()
->
toArray
();
$data
[
'today_phone'
]
=
$phone
;
}
else
{
}
else
{
//如果是租客身份,查找所属业主
$data
=
[];
$data
[
$k
][
'myOwner'
]
=
Db
::
name
(
'house_user_bind'
)
->
where
([
'vacancy_id'
=>
$v
[
'vacancy_id'
],
'type'
=>
0
,
'status'
=>
1
])
->
field
(
'name,phone,status'
)
->
find
();
}
}
}
return
$this
->
returnJson
(
$data
);
return
$this
->
returnJson
(
$data
);
}
}
//更改人脸图片信息
public
function
changeUserFaceImg
()
{
$where
[
'uid'
]
=
$this
->
uid
;
$data
[
'face_img'
]
=
Request
::
param
(
'face_img'
);
if
(
empty
(
$data
))
{
return
$this
->
returnJson
([],
'图片必传!'
,
400
);
}
$change
=
Db
::
name
(
'user'
)
->
where
(
$where
)
->
save
(
$data
);
if
(
$change
)
{
return
$this
->
returnJson
();
}
else
{
return
$this
->
returnJson
([],
'更改失败!'
);
}
}
//人脸图片文件上传
public
function
uploadFaceImg
()
{
$file
=
request
()
->
file
(
'img'
);
$path
=
"/face"
;
$data
=
Common
::
uploadImg
(
$file
,
$path
);
if
(
$data
)
{
return
$this
->
returnJson
(
$data
,
'success'
);
}
else
{
return
$this
->
returnJson
([],
'请上传图片文件'
,
400
);
}
}
...
...
app/common/controller/Common.php
View file @
cac152f2
...
@@ -872,7 +872,7 @@ class Common extends BaseController
...
@@ -872,7 +872,7 @@ class Common extends BaseController
}
}
//获取需要绑定人员设备
//获取需要绑定人员设备
public
static
function
getFamilyBindType
()
{
public
static
function
getFamilyBindType
()
{
return
[
'1'
=>
'配偶'
,
'2'
=>
'父母'
,
'3'
=>
'子女'
,
'4'
=>
'亲
朋
好友'
];
return
[
'1'
=>
'配偶'
,
'2'
=>
'父母'
,
'3'
=>
'子女'
,
'4'
=>
'亲
戚'
,
'5'
=>
'
好友'
];
}
}
//根据查询到的小区id,获取当前用户所在小区绑定的房间
//根据查询到的小区id,获取当前用户所在小区绑定的房间
...
@@ -887,4 +887,23 @@ class Common extends BaseController
...
@@ -887,4 +887,23 @@ class Common extends BaseController
return
$data
;
return
$data
;
}
}
//图片上传
public
static
function
uploadImg
(
$file
,
$path
)
{
$ext
=
$file
->
getOriginalExtension
();
if
(
!
in_array
(
$ext
,[
'pjpeg'
,
'jpeg'
,
'jpg'
,
'gif'
,
'bmp'
,
'png'
]))
{
return
false
;
}
$savename
=
\think\facade\Filesystem
::
putFile
(
$path
,
$file
);
if
(
isHTTPS
()){
$http
=
"https://"
;
}
else
{
$http
=
"http://"
;
}
$data
[
'path'
]
=
$http
.
$_SERVER
[
'SERVER_NAME'
]
.
"/upload/"
.
$savename
;
$data
[
'data'
]
=
"/upload/"
.
$savename
;
return
$data
;
}
}
}
\ No newline at end of file
app/model/User.php
0 → 100644
View file @
cac152f2
<?php
namespace
app\model
;
use
think\Model
;
class
User
extends
Model
{
protected
$pk
=
'uid'
;
//设置主键,默认id,可以不写
}
app/shequ/controller/News.php
View file @
cac152f2
...
@@ -147,23 +147,16 @@ class News extends Base
...
@@ -147,23 +147,16 @@ class News extends Base
}
}
//fi
el
图片上传
//fi
le
图片上传
public
function
uploadImg
()
{
public
function
uploadImg
()
{
$file
=
request
()
->
file
(
'img'
);
$file
=
request
()
->
file
(
'img'
);
$ext
=
$file
->
getOriginalExtension
();
$path
=
'/new/'
.
"village_"
.
$this
->
village_id
;
if
(
!
in_array
(
$ext
,[
'pjpeg'
,
'jpeg'
,
'jpg'
,
'gif'
,
'bmp'
,
'png'
]))
{
$data
=
Common
::
uploadImg
(
$file
,
$path
);
return
$this
->
returnJson
([],
'请上传图片文件'
,
400
);
if
(
$data
)
{
}
return
$this
->
returnJson
(
$data
,
'success'
);
$savename
=
\think\facade\Filesystem
::
putFile
(
''
,
$file
,
'datea'
);
if
(
isHTTPS
()){
$http
=
"https://"
;
}
else
{
}
else
{
$http
=
"http://"
;
return
$this
->
returnJson
([],
'请上传图片文件'
,
400
)
;
}
}
$data
[
'path'
]
=
$http
.
$_SERVER
[
'SERVER_NAME'
]
.
"/upload/"
.
$savename
;
$data
[
'data'
]
=
"/upload/"
.
$savename
;
return
$this
->
returnJson
(
$data
,
'success'
);
}
}
...
...
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