Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
quxiu
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
冷斌
quxiu
Commits
e856ecc6
Commit
e856ecc6
authored
Jun 12, 2020
by
冷斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
1ce2ad81
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
156 additions
and
157 deletions
+156
-157
application/Appapi/Controller/InviteController.class.php
+0
-2
wxshare/Application/Common/Common/function.php
+156
-155
No files found.
application/Appapi/Controller/InviteController.class.php
View file @
e856ecc6
...
...
@@ -193,8 +193,6 @@ class InviteController extends HomebaseController {
}
$mobile_code
=
random
(
6
,
1
);
var_dump
(
$mobile
,
$mobile_code
,
630425
);
die
;
//密码可以使用明文密码或使用32位MD5加密
$result
=
sendCode
(
$mobile
,
$mobile_code
,
630425
);
if
(
$result
[
'code'
]
===
0
){
...
...
wxshare/Application/Common/Common/function.php
View file @
e856ecc6
...
...
@@ -13,7 +13,7 @@
return
$redis
;
}
/* 设置缓存 */
function
setcache
(
$key
,
$info
){
$config
=
getConfigPri
();
...
...
@@ -22,17 +22,17 @@
}
$redis
=
connectionRedis
();
$redis
->
set
(
$key
,
json_encode
(
$info
));
$redis
->
setTimeout
(
$key
,
$config
[
'cache_time'
]);
$redis
->
setTimeout
(
$key
,
$config
[
'cache_time'
]);
return
1
;
}
}
/* 设置缓存 可自定义时间*/
function
setcaches
(
$key
,
$info
,
$time
){
$redis
=
connectionRedis
();
$redis
->
set
(
$key
,
json_encode
(
$info
));
$redis
->
setTimeout
(
$key
,
$time
);
$redis
->
setTimeout
(
$key
,
$time
);
return
1
;
}
/* 获取缓存 */
...
...
@@ -44,25 +44,25 @@
if
(
$config
[
'cache_switch'
]
!=
1
){
$isexist
=
false
;
}
return
json_decode
(
$isexist
,
true
);
}
}
/* 获取缓存 不判断后台设置 */
function
getcaches
(
$key
){
$redis
=
connectionRedis
();
$isexist
=
$redis
->
Get
(
$key
);
return
json_decode
(
$isexist
,
true
);
}
/* 删除缓存 */
function
delcache
(
$key
){
$redis
=
connectionRedis
();
$isexist
=
$redis
->
delete
(
$key
);
return
1
;
}
}
/* 去除NULL 判断空处理 主要针对字符串类型*/
function
checkNull
(
$checkstr
){
$checkstr
=
urldecode
(
$checkstr
);
...
...
@@ -74,9 +74,9 @@
}
else
{
$str
=
$checkstr
;
}
return
$str
;
return
$str
;
}
/* 去除emoji表情 */
function
filterEmoji
(
$str
){
$str
=
preg_replace_callback
(
...
...
@@ -97,33 +97,33 @@
$config
=
json_decode
(
$config
,
true
);
setcaches
(
$key
,
$config
);
}
if
(
is_array
(
$config
[
'live_time_coin'
])){
}
else
if
(
$config
[
'live_time_coin'
]){
$config
[
'live_time_coin'
]
=
preg_split
(
'/,|,/'
,
$config
[
'live_time_coin'
]);
}
else
{
$config
[
'live_time_coin'
]
=
array
();
}
if
(
is_array
(
$config
[
'login_type'
])){
}
else
if
(
$config
[
'login_type'
]){
$config
[
'login_type'
]
=
preg_split
(
'/,|,/'
,
$config
[
'login_type'
]);
}
else
{
$config
[
'login_type'
]
=
array
();
}
if
(
is_array
(
$config
[
'share_type'
])){
}
else
if
(
$config
[
'share_type'
]){
$config
[
'share_type'
]
=
preg_split
(
'/,|,/'
,
$config
[
'share_type'
]);
}
else
{
$config
[
'share_type'
]
=
array
();
}
if
(
is_array
(
$config
[
'live_type'
])){
}
else
if
(
$config
[
'live_type'
]){
$live_type
=
preg_split
(
'/,|,/'
,
$config
[
'live_type'
]);
foreach
(
$live_type
as
$k
=>
$v
){
...
...
@@ -133,10 +133,10 @@
}
else
{
$config
[
'live_type'
]
=
array
();
}
return
$config
;
}
/* 获取私密配置 */
function
getConfigPri
()
{
$key
=
'getConfigPri'
;
...
...
@@ -146,9 +146,9 @@
$config
=
json_decode
(
$config
,
true
);
setcaches
(
$key
,
$config
);
}
if
(
is_array
(
$config
[
'game_switch'
])){
}
else
if
(
$config
[
'game_switch'
]){
$config
[
'game_switch'
]
=
preg_split
(
'/,|,/'
,
$config
[
'game_switch'
]);
}
else
{
...
...
@@ -162,8 +162,8 @@
function
get_host
(){
$config
=
getConfigPub
();
return
$config
[
'site'
];
}
}
/**
* 转化数据库保存的文件路径,为可以访问的url
*/
...
...
@@ -176,14 +176,14 @@
}
else
{
return
$file
;
}
}
}
/* 获取等级 */
function
getLevelList
(){
$key
=
'level'
;
$level
=
getcaches
(
$key
);
if
(
!
$level
){
$level
=
M
(
"experlevel"
)
->
order
(
"level_up asc"
)
->
select
();
foreach
(
$level
as
$k
=>
$v
){
$v
[
'thumb'
]
=
get_upload_path
(
$v
[
'thumb'
]);
if
(
$v
[
'colour'
]){
...
...
@@ -193,14 +193,14 @@
}
$level
[
$k
]
=
$v
;
}
setcaches
(
$key
,
$level
);
setcaches
(
$key
,
$level
);
}
return
$level
;
}
function
getLevel
(
$experience
){
$levelid
=
1
;
$level
=
getLevelList
();
foreach
(
$level
as
$k
=>
$v
){
...
...
@@ -212,7 +212,7 @@
}
}
$levelid
=
$levelid
<
$level_a
?
$level_a
:
$levelid
;
return
$levelid
;
}
/* 主播等级 */
...
...
@@ -225,15 +225,15 @@
$v
[
'thumb'
]
=
get_upload_path
(
$v
[
'thumb'
]);
$v
[
'thumb_mark'
]
=
get_upload_path
(
$v
[
'thumb_mark'
]);
}
setcaches
(
$key
,
$level
);
setcaches
(
$key
,
$level
);
}
return
$level
;
}
function
getLevelAnchor
(
$experience
){
$levelid
=
1
;
$level
=
getLevelAnchorList
();
foreach
(
$level
as
$k
=>
$v
){
if
(
$v
[
'level_up'
]
>=
$experience
){
$levelid
=
$v
[
'levelid'
];
...
...
@@ -243,7 +243,7 @@
}
}
$levelid
=
$levelid
<
$level_a
?
$level_a
:
$levelid
;
return
$levelid
;
}
...
...
@@ -254,27 +254,27 @@
return
1
;
}
else
{
return
0
;
}
}
}
/*判断是否拉黑*/
/*判断是否拉黑*/
function
isBlack
(
$uid
,
$touid
){
$isexist
=
M
(
"users_black"
)
->
where
(
"uid="
.
$uid
.
" and touid="
.
$touid
)
->
find
();
if
(
$isexist
){
return
1
;
}
else
{
return
0
;
return
0
;
}
}
/* 关注人数 */
function
getFollownums
(
$uid
)
function
getFollownums
(
$uid
)
{
return
M
(
"users_attention"
)
->
where
(
"uid='
{
$uid
}
' "
)
->
count
();
}
/* 粉丝人数 */
function
getFansnums
(
$uid
)
function
getFansnums
(
$uid
)
{
return
M
(
"users_attention"
)
->
where
(
" touid='
{
$uid
}
'"
)
->
count
();
}
}
/* 用户基本信息 */
function
getUserInfo
(
$uid
)
{
$info
=
M
(
"users"
)
->
field
(
"id,user_nicename,avatar,avatar_thumb,sex,signature,consumption,votestotal,province,city,birthday,issuper"
)
->
where
(
"id='
{
$uid
}
'"
)
->
find
();
...
...
@@ -287,16 +287,16 @@
$info
[
'vip'
]
=
getUserVip
(
$uid
);
$info
[
'liang'
]
=
getUserLiang
(
$uid
);
}
return
$info
;
}
return
$info
;
}
/*获取收到礼物数量(tsd) 以及送出的礼物数量(tsc) */
function
getgif
(
$uid
)
{
$live
=
M
(
"users_coinrecord"
);
$count
=
$live
->
query
(
'select sum(case when touid='
.
$uid
.
' then 1 else 0 end) as tsd,sum(case when uid='
.
$uid
.
' then 1 else 0 end) as tsc from cmf_users_coinrecord'
);
return
$count
;
return
$count
;
}
/* 用户信息 含有私密信息 */
function
getUserPrivateInfo
(
$uid
)
{
...
...
@@ -308,21 +308,21 @@
$info
[
'level_anchor'
]
=
getLevelAnchor
(
$info
[
'votestotal'
]);
$info
[
'avatar'
]
=
get_upload_path
(
$info
[
'avatar'
]);
$info
[
'avatar_thumb'
]
=
get_upload_path
(
$info
[
'avatar_thumb'
]);
$info
[
'vip'
]
=
getUserVip
(
$uid
);
$info
[
'liang'
]
=
getUserLiang
(
$uid
);
}
return
$info
;
}
return
$info
;
}
/* 用户信息 含有私密信息 */
function
getUserToken
(
$uid
)
{
$info
=
M
(
"users"
)
->
field
(
'token'
)
->
where
(
"id='
{
$uid
}
'"
)
->
find
();
return
$info
[
'token'
];
}
return
$info
[
'token'
];
}
/* 房间管理员 */
function
getIsAdmin
(
$uid
,
$showid
){
if
(
$uid
==
$showid
){
if
(
$uid
==
$showid
){
return
50
;
}
$isuper
=
isSuper
(
$uid
);
...
...
@@ -332,26 +332,26 @@
$id
=
M
(
"users_livemanager"
)
->
where
(
"uid = '
$uid
' and liveuid = '
$showid
'"
)
->
find
();
if
(
$id
)
{
return
40
;
return
40
;
}
return
30
;
return
30
;
}
/*判断token是否过期*/
function
checkToken
(
$uid
,
$token
)
{
if
(
!
$uid
||
!
$token
){
return
700
;
return
700
;
}
$userinfo
=
getcaches
(
"token_"
.
$uid
);
if
(
!
$userinfo
){
$userinfo
=
M
(
"users"
)
->
field
(
'token,expiretime'
)
->
where
(
"id ="
.
$uid
.
" and user_type='2'"
)
->
find
();
setcaches
(
"token_"
.
$uid
,
$userinfo
);
$userinfo
=
M
(
"users"
)
->
field
(
'token,expiretime'
)
->
where
(
"id ="
.
$uid
.
" and user_type='2'"
)
->
find
();
setcaches
(
"token_"
.
$uid
,
$userinfo
);
}
if
(
$userinfo
[
'token'
]
!=
$token
||
$userinfo
[
'expiretime'
]
<
time
()){
return
700
;
return
700
;
}
else
{
return
0
;
}
return
0
;
}
}
/*前台个人中心判断是否登录*/
function
LogIn
()
...
...
@@ -360,7 +360,7 @@
if
(
$uid
<=
0
)
{
$url
=
$_SERVER
[
'HTTP_HOST'
];
header
(
"Location:http://"
.
$url
);
header
(
"Location:http://"
.
$url
);
exit
;
}
}
...
...
@@ -369,7 +369,7 @@
$isexist
=
M
(
"users_super"
)
->
where
(
"uid='
{
$uid
}
'"
)
->
find
();
if
(
$isexist
){
return
1
;
}
}
return
0
;
}
/* 判断账号是被禁用 */
...
...
@@ -380,13 +380,13 @@
}
return
1
;
}
/* 过滤关键词 */
function
filterField
(
$field
){
$configpri
=
getConfigPri
();
$sensitive_field
=
$configpri
[
'sensitive_field'
];
$sensitive
=
explode
(
","
,
$sensitive_field
);
$replace
=
array
();
$preg
=
array
();
...
...
@@ -403,10 +403,10 @@
unset
(
$sensitive
[
$k
]);
}
}
return
preg_replace
(
$preg
,
$replace
,
$field
);
}
/* 检验手机号 */
function
checkMobile
(
$mobile
){
$ismobile
=
preg_match
(
"/^1[3|4|5|7|8]\d
{
9
}
$/"
,
$mobile
);
...
...
@@ -416,15 +416,15 @@
return
0
;
}
}
/* 多维数组排序 */
function
array_column2
(
$input
,
$columnKey
,
$indexKey
=
NULL
){
$columnKeyIsNumber
=
(
is_numeric
(
$columnKey
))
?
TRUE
:
FALSE
;
$indexKeyIsNull
=
(
is_null
(
$indexKey
))
?
TRUE
:
FALSE
;
$indexKeyIsNumber
=
(
is_numeric
(
$indexKey
))
?
TRUE
:
FALSE
;
$result
=
array
();
foreach
((
array
)
$input
AS
$key
=>
$row
){
foreach
((
array
)
$input
AS
$key
=>
$row
){
if
(
$columnKeyIsNumber
){
$tmp
=
array_slice
(
$row
,
$columnKey
,
1
);
$tmp
=
(
is_array
(
$tmp
)
&&
!
empty
(
$tmp
))
?
current
(
$tmp
)
:
NULL
;
...
...
@@ -448,7 +448,7 @@
function
isZombie
(
$uid
)
{
$userinfo
=
M
(
"users"
)
->
field
(
"iszombie"
)
->
where
(
"id="
.
$uid
)
->
find
();
return
$userinfo
[
'iszombie'
];
return
$userinfo
[
'iszombie'
];
}
/* 时间差计算 */
function
datetime
(
$time
){
...
...
@@ -463,7 +463,7 @@
/* 时 */
$h
=
floor
(
$hz
/
24
);
/* 天 */
if
(
$cha
<
60
){
return
$cha
.
'秒前'
;
}
else
if
(
$iz
<
60
){
...
...
@@ -476,9 +476,9 @@
return
date
(
"Y-m-d"
,
$time
);
}
}
/* 时长格式化 */
function
getSeconds
(
$cha
,
$type
=
0
){
function
getSeconds
(
$cha
,
$type
=
0
){
$iz
=
floor
(
$cha
/
60
);
$hz
=
floor
(
$iz
/
60
);
$dz
=
floor
(
$hz
/
24
);
...
...
@@ -489,7 +489,7 @@
/* 时 */
$h
=
floor
(
$hz
/
24
);
/* 天 */
if
(
$type
==
1
){
if
(
$s
<
10
){
$s
=
'0'
.
$s
;
...
...
@@ -501,14 +501,14 @@
if
(
$h
<
10
){
$h
=
'0'
.
$h
;
}
if
(
$hz
<
10
){
$hz
=
'0'
.
$hz
;
}
return
$hz
.
':'
.
$i
.
':'
.
$s
;
return
$hz
.
':'
.
$i
.
':'
.
$s
;
}
if
(
$cha
<
60
){
return
$cha
.
'秒'
;
}
else
if
(
$iz
<
60
){
...
...
@@ -518,8 +518,8 @@
}
else
if
(
$dz
<
30
){
return
$dz
.
'天'
.
$h
.
'小时'
.
$i
.
'分钟'
.
$s
.
'秒'
;
}
}
}
/*判断该用户是否已经认证*/
function
auth
(
$uid
)
{
...
...
@@ -549,15 +549,15 @@
}
return
$hash
;
}
/* 发送验证码 */
function
sendCode_huiyi
(
$mobile
,
$code
){
$rs
=
array
();
$config
=
getConfigPri
();
/* 互亿无线 */
$target
=
"http://106.ihuyi.cn/webservice/sms.php?method=Submit"
;
$post_data
=
"account="
.
$config
[
'ihuyi_account'
]
.
"&password="
.
$config
[
'ihuyi_ps'
]
.
"&mobile="
.
$mobile
.
"&content="
.
rawurlencode
(
"您的验证码是:"
.
$code
.
"。请不要把验证码泄露给其他人。"
);
//密码可以使用明文密码或使用32位MD5加密
$gets
=
xml_to_array
(
Post
(
$post_data
,
$target
));
...
...
@@ -567,10 +567,10 @@
}
else
{
$rs
[
'code'
]
=
1002
;
$rs
[
'msg'
]
=
$gets
[
'SubmitResult'
][
'msg'
];
}
}
return
$rs
;
}
function
Post
(
$curlPost
,
$url
){
$curl
=
curl_init
();
curl_setopt
(
$curl
,
CURLOPT_URL
,
$url
);
...
...
@@ -583,7 +583,7 @@
curl_close
(
$curl
);
return
$return_str
;
}
function
xml_to_array
(
$xml
){
$reg
=
"/<(\w+)[^>]*>([
\\
x00-
\\
xFF]*)<
\\
/
\\
1>/"
;
if
(
preg_match_all
(
$reg
,
$xml
,
$matches
)){
...
...
@@ -601,22 +601,24 @@
return
$arr
;
}
/* 发送验证码 */
/* 发送验证码 -- 容联云 */
function
sendCode
(
$mobile
,
$code
){
var_dump
(
1
);
die
;
$rs
=
array
(
'code'
=>
0
,
'msg'
=>
''
,
'info'
=>
array
());
$config
=
getConfigPri
();
if
(
!
$config
[
'sendcode_switch'
]){
$rs
[
'code'
]
=
667
;
$rs
[
'msg'
]
=
'123456'
;
return
$rs
;
}
require_once
SITE_PATH
.
'../sdk/ronglianyun/CCPRestSDK.php'
;
//主帐号
$accountSid
=
$config
[
'ccp_sid'
];
//主帐号Token
...
...
@@ -625,25 +627,25 @@
$appId
=
$config
[
'ccp_appid'
];
//请求地址,格式如下,不需要写https://
$serverIP
=
'app.cloopen.com'
;
//请求端口
//请求端口
$serverPort
=
'8883'
;
//REST版本号
$softVersion
=
'2013-12-26'
;
$tempId
=
$config
[
'ccp_tempid'
];
file_put_contents
(
SITE_PATH
.
'../data/sendCode_ccp_'
.
date
(
'Y-m-d'
)
.
'.txt'
,
date
(
'Y-m-d H:i:s'
)
.
' 提交参数信息 post_data: accountSid:'
.
$accountSid
.
";accountToken:
{
$accountToken
}
;appId:
{
$appId
}
;tempId:
{
$tempId
}
\r\n
"
,
FILE_APPEND
);
$rest
=
new
\REST
(
$serverIP
,
$serverPort
,
$softVersion
);
$rest
->
setAccount
(
$accountSid
,
$accountToken
);
$rest
->
setAppId
(
$appId
);
$datas
=
[];
$datas
[]
=
$code
;
$result
=
$rest
->
sendTemplateSMS
(
$mobile
,
$datas
,
$tempId
);
file_put_contents
(
SITE_PATH
.
'../data/sendCode_ccp_'
.
date
(
'Y-m-d'
)
.
'.txt'
,
date
(
'Y-m-d H:i:s'
)
.
' 提交参数信息 result:'
.
json_encode
(
$result
)
.
"
\r\n
"
,
FILE_APPEND
);
if
(
$result
==
NULL
)
{
$rs
[
'code'
]
=
1002
;
$rs
[
'msg'
]
=
"获取失败"
;
...
...
@@ -663,7 +665,7 @@
return
$rs
;
}
/**导出Excel 表格
* @param $expTitle 名称
* @param $expCellName 参数
...
...
@@ -700,7 +702,7 @@
$authcode
=
'rCt52pF2cnnKNB3Hkp'
;
$pass
=
"###"
.
md5
(
md5
(
$authcode
.
$pass
));
return
$pass
;
}
}
/* 密码检查 */
function
passcheck
(
$user_pass
)
{
$num
=
preg_match
(
"/^[a-zA-Z]+$/"
,
$user_pass
);
...
...
@@ -710,10 +712,10 @@
return
2
;
}
else
if
(
!
$check
){
return
0
;
}
}
return
1
;
}
}
/**
* @desc 获取推拉流地址
* @param string $host 协议,如:http、rtmp
...
...
@@ -745,10 +747,10 @@
break
;
}
return
$url
;
}
/**
* @desc 阿里云直播A类鉴权
* @param string $host 协议,如:http、rtmp
...
...
@@ -770,9 +772,9 @@
$domain
=
$host
.
'://'
.
$pull
;
$time
=
time
()
+
$length_pull
;
}
$filename
=
"/5showcam/"
.
$stream
;
if
(
$type
==
1
){
if
(
$key_push
!=
''
){
$sstring
=
$filename
.
"-"
.
$time
.
"-0-0-"
.
$key_push
;
...
...
@@ -797,7 +799,7 @@
$auth_key
=
'?'
.
$auth_key
;
}
$url
=
$domain
.
$filename
.
$auth_key
;
if
(
$type
==
3
){
$url_a
=
explode
(
'/'
.
$stream
,
$url
);
$url
=
array
(
...
...
@@ -806,10 +808,10 @@
);
}
}
return
$url
;
}
/**
* @desc 腾讯云推拉流地址
* @param string $host 协议,如:http、rtmp
...
...
@@ -822,19 +824,19 @@
$push_url_key
=
$configpri
[
'tx_push_key'
];
$push
=
$configpri
[
'tx_push'
];
$pull
=
$configpri
[
'tx_pull'
];
$stream_a
=
explode
(
'.'
,
$stream
);
$streamKey
=
$stream_a
[
0
];
$ext
=
$stream_a
[
1
];
//$live_code = $bizid . "_" .$streamKey;
$live_code
=
$streamKey
;
//$live_code = $bizid . "_" .$streamKey;
$live_code
=
$streamKey
;
$now_time
=
time
()
+
3
*
60
*
60
;
$txTime
=
dechex
(
$now_time
);
$txSecret
=
md5
(
$push_url_key
.
$live_code
.
$txTime
);
$safe_url
=
"&txSecret="
.
$txSecret
.
"&txTime="
.
$txTime
;
$safe_url
=
"&txSecret="
.
$txSecret
.
"&txTime="
.
$txTime
;
if
(
$type
==
1
){
//$push_url = "rtmp://" . $bizid . ".livepush2.myqcloud.com/live/" . $live_code . "?bizid=" . $bizid . "&record=flv" .$safe_url; 可录像
...
...
@@ -845,7 +847,7 @@
);
}
else
{
$url
=
"http://
{
$pull
}
/live/"
.
$live_code
.
"."
.
$ext
;
if
(
$type
==
3
){
$url_a
=
explode
(
'/'
.
$live_code
,
$url
);
$url
=
array
(
...
...
@@ -854,7 +856,7 @@
);
}
}
return
$url
;
}
...
...
@@ -907,7 +909,7 @@
);
}
}
return
$url
;
}
/**
...
...
@@ -941,7 +943,7 @@
}
return
$url
;
}
/**网易cdn获取拉流地址**/
function
PrivateKey_wy
(
$host
,
$stream
,
$type
)
{
...
...
@@ -952,7 +954,7 @@
$curTime
=
time
();
$var
=
$appSecret
.
$nonce
.
$curTime
;
$checkSum
=
sha1
(
$appSecret
.
$nonce
.
$curTime
);
$header
=
array
(
"Content-Type:application/json;charset=utf-8"
,
"AppKey:"
.
$appkey
,
...
...
@@ -960,7 +962,7 @@
"CurTime:"
.
$curTime
,
"CheckSum:"
.
$checkSum
,
);
if
(
$type
==
1
){
$url
=
'https://vcloud.163.com/app/channel/create'
;
$paramarr
=
array
(
...
...
@@ -974,11 +976,11 @@
);
}
$paramarr
=
json_encode
(
$paramarr
);
$curl
=
curl_init
();
curl_setopt
(
$curl
,
CURLOPT_URL
,
$url
);
curl_setopt
(
$curl
,
CURLOPT_HEADER
,
0
);
curl_setopt
(
$curl
,
CURLOPT_HTTPHEADER
,
$header
);
curl_setopt
(
$curl
,
CURLOPT_HTTPHEADER
,
$header
);
curl_setopt
(
$curl
,
CURLOPT_RETURNTRANSFER
,
1
);
curl_setopt
(
$curl
,
CURLOPT_SSL_VERIFYHOST
,
0
);
curl_setopt
(
$curl
,
CURLOPT_SSL_VERIFYPEER
,
0
);
...
...
@@ -989,7 +991,7 @@
$url
=
json_decode
(
$data
,
1
);
return
$url
;
}
/**
* @desc 奥点云推拉流
* @param string $host 协议,如:http、rtmp
...
...
@@ -1022,7 +1024,7 @@
$filename
=
"/"
.
$configpri
[
'ady_apn'
]
.
"/"
.
$stream
;
$url
=
$domain
.
$filename
;
}
if
(
$type
==
3
){
$url_a
=
explode
(
'/'
.
$stream
,
$url
);
$url
=
array
(
...
...
@@ -1031,10 +1033,10 @@
);
}
}
return
$url
;
}
/* 生成邀请码 */
function
createCode
(){
$code
=
'ABCDEFGHIJKLMNPQRSTUVWXYZ'
;
...
...
@@ -1059,10 +1061,10 @@
return
$d
;
}
}
createCode
();
}
/* 数字格式化 */
function
NumberFormat
(
$num
){
if
(
$num
<
10000
){
...
...
@@ -1089,7 +1091,7 @@
}
return
$num
;
}
/* 获取用户VIP */
function
getUserVip
(
$uid
){
$rs
=
array
(
...
...
@@ -1100,7 +1102,7 @@
if
(
$isexist
){
$rs
[
'type'
]
=
$isexist
[
'type'
];
}
return
$rs
;
}
...
...
@@ -1122,11 +1124,11 @@
$rs
[
'swf'
]
=
get_upload_path
(
$info
[
'swf'
])
;
$rs
[
'swftime'
]
=
$info
[
'swftime'
];
$rs
[
'words'
]
=
$info
[
'words'
];
}
}
return
$rs
;
}
...
...
@@ -1140,10 +1142,10 @@
if
(
$isexist
){
$rs
[
'name'
]
=
$isexist
[
'name'
];
}
return
$rs
;
}
/* 三级分销 */
function
setAgentProfit
(
$uid
,
$total
){
/* 分销 */
...
...
@@ -1220,7 +1222,7 @@
M('users_voterecord')->add($insert_votes);
}
} */
if
(
$isinsert
==
1
){
$data
=
array
(
'uid'
=>
$uid
,
...
...
@@ -1237,13 +1239,13 @@
}
}
return
1
;
}
/* 家族分成 */
function
setFamilyDivide
(
$liveuid
,
$total
){
$configpri
=
getConfigPri
();
$anthor_total
=
$total
;
/* 家族 */
if
(
$configpri
[
'family_switch'
]
==
1
){
...
...
@@ -1263,10 +1265,10 @@
/* 主播 */
if
(
$users_family
[
'divide_family'
]
>=
0
){
$divide_family
=
$users_family
[
'divide_family'
];
}
$family_total
=
$total
*
$divide_family
*
0.01
;
$anthor_total
=
$total
-
$family_total
;
$addtime
=
time
();
$time
=
date
(
'Y-m-d'
,
$addtime
);
...
...
@@ -1296,7 +1298,7 @@
return
0
;
}
$date
=
date
(
"Ymd"
);
$ip
=
ip2long
(
$_SERVER
[
"REMOTE_ADDR"
])
;
$ip
=
ip2long
(
$_SERVER
[
"REMOTE_ADDR"
])
;
$IP_limit
=
M
(
"getcode_limit_ip"
);
$isexist
=
$IP_limit
->
field
(
'ip,date,times'
)
->
where
(
"ip=
{
$ip
}
"
)
->
find
();
if
(
!
$isexist
){
...
...
@@ -1317,8 +1319,8 @@
$isexist
=
$IP_limit
->
where
(
"ip=
{
$ip
}
"
)
->
save
(
array
(
'date'
=>
$date
,
'times'
=>
1
));
return
0
;
}
}
}
}
}
/* 获取用户守护信息 */
function
getUserGuard
(
$uid
,
$liveuid
){
...
...
@@ -1332,11 +1334,11 @@
$guardinfo
=
M
(
'guard_users'
)
->
field
(
'type,endtime'
)
->
where
(
"uid =
{
$uid
}
and liveuid=
{
$liveuid
}
"
)
->
find
();
->
find
();
setcaches
(
$key
,
$guardinfo
);
}
$nowtime
=
time
();
if
(
$guardinfo
&&
$guardinfo
[
'endtime'
]
>
$nowtime
){
$rs
=
array
(
'type'
=>
$guardinfo
[
'type'
],
...
...
@@ -1345,4 +1347,4 @@
);
}
return
$rs
;
}
\ No newline at end of file
}
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