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
f015636f
Commit
f015636f
authored
Jun 19, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分享办公楼
parent
04393e43
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
120 additions
and
1 deletion
+120
-1
.DS_Store
application/index/.DS_Store
+0
-0
ShareOfficeRoom.php
application/index/controller/ShareOfficeRoom.php
+117
-0
ShareShop.php
application/index/controller/ShareShop.php
+1
-1
.DS_Store
application/index/view/.DS_Store
+0
-0
office_detail.html
application/index/view/share_office_room/office_detail.html
+0
-0
route.php
application/route.php
+2
-0
No files found.
application/index/.DS_Store
View file @
f015636f
No preview for this file type
application/index/controller/ShareOfficeRoom.php
0 → 100644
View file @
f015636f
<?php
namespace
app\index\controller
;
use
app\api\controller\WxSdk
;
use
app\api\untils\WxCallbackUntils
;
use
app\index\extend\Basic
;
use
app\index\service\UserService
;
use
app\model\UWxInfo
;
use
Think\Log
;
/**
* Created by PhpStorm.
* User : zhwuei
* Date : 2018-11-14
* Time : 11:29:52
* Intro:
*/
class
ShareOfficeRoom
extends
Basic
{
private
$url
;
private
$_wxApi
;
private
$wxInfoModel
;
public
function
__construct
()
{
parent
::
__construct
();
$this
->
_wxApi
=
new
WxCallbackUntils
();
$this
->
wxInfoModel
=
new
UWxInfo
();
$this
->
url
=
CURRENT_URL
.
"index/ShareOfficeRoom"
;
}
public
function
ShareOfficeRoom
()
{
$browser_type
=
$this
->
isWeiChatBrowser
();
$params
=
$this
->
params
;
$is_user
=
true
;
if
(
$browser_type
==
1
){
//dump('微信浏览器');
$code
=
empty
(
$_GET
[
'code'
])
?
null
:
$_GET
[
'code'
];
if
(
!
$code
)
{
$this
->
_wxApi
->
getWxCode
(
$this
->
url
.
'?'
.
http_build_query
(
$params
));
}
else
{
$userInfo
=
$this
->
_wxApi
->
getUserInfoByAccessToken
(
$code
);
//dump($userInfo);exit;
if
(
!
$userInfo
[
'wx_open_id'
])
{
$this
->
_wxApi
->
getWxCode
(
$this
->
url
.
'?'
.
http_build_query
(
$params
));
}
else
{
$wx_union_id
=
$userInfo
[
'wx_union_id'
]
?
$userInfo
[
'wx_union_id'
]
:
$userInfo
[
'wx_open_id'
];
if
(
!
$userInfo
[
'wx_union_id'
]){
$userInfo
[
'wx_union_id'
]
=
$userInfo
[
'wx_open_id'
];
}
$user_service
=
new
UserService
();
$is_user
=
$user_service
->
isUserByweiXin
(
$wx_union_id
);
$userInfo
[
"source"
]
=
0
;
// 验证open_id是否已经存在,存在则更新
$wxInfoObj
=
$this
->
wxInfoModel
->
getWxInfoByOpenId
(
$wx_union_id
);
if
(
$wxInfoObj
&&
count
(
$wxInfoObj
)
>
0
)
{
$userInfo
[
"id"
]
=
$wxInfoObj
[
0
][
"id"
];
$id
=
$this
->
wxInfoModel
->
updateWxInfo
(
$userInfo
);
}
else
{
$id
=
$this
->
wxInfoModel
->
addWxInfo
(
$userInfo
);
}
$params
[
'is_user'
]
=
$is_user
;
$params
[
'wx_union_id'
]
=
$wx_union_id
;
$params
[
'device_id'
]
=
$this
->
createOrderNumber
();
}
}
}
$this
->
assign
(
'data'
,
json_encode
(
$params
));
return
view
(
"share_detail"
);
}
public
function
yindaoAndroid
()
{
return
view
(
"yindao_android"
);
}
public
function
yindaoIos
()
{
return
view
(
"yindao_ios"
);
}
/**
* 随机数
* @return string
*/
private
function
createOrderNumber
()
{
return
time
()
.
mt_rand
(
10000
,
99999
);
}
/**
* 浏览器判断
* @return int
*/
function
isWeiChatBrowser
(){
$ua
=
$_SERVER
[
'HTTP_USER_AGENT'
];
//MicroMessenger 是android/iphone版微信所带的
//Windows Phone 是winphone版微信带的 (这个标识会误伤winphone普通浏览器的访问)
if
(
strpos
(
$ua
,
'MicroMessenger'
)
==
false
&&
strpos
(
$ua
,
'Windows Phone'
)
==
false
){
return
0
;
//普通浏览器
}
else
{
return
1
;
//微信浏览器
}
}
}
\ No newline at end of file
application/index/controller/ShareShop.php
View file @
f015636f
...
...
@@ -74,7 +74,7 @@ class ShareShop extends Basic
}
$this
->
assign
(
'data'
,
json_encode
(
$params
));
return
view
(
"
shar
e_detail"
);
return
view
(
"
offic
e_detail"
);
}
...
...
application/index/view/.DS_Store
View file @
f015636f
No preview for this file type
application/index/view/share_
shop
/office_detail.html
→
application/index/view/share_
office_room
/office_detail.html
View file @
f015636f
File moved
application/route.php
View file @
f015636f
...
...
@@ -493,6 +493,8 @@ Route::group('index', [
'getFindShopList'
=>
[
'index/FindShop/getFindShopList'
,
[
'method'
=>
'POST|GET'
]],
'getFindShopListIsMy'
=>
[
'index/FindShop/getFindShopList'
,
[
'method'
=>
'POST|GET'
]],
'ShareOfficeRoom'
=>
[
'index/ShareOfficeRoom/ShareOfficeRoom'
,
[
'method'
=>
'POST|GET'
]],
]);
...
...
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