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
3eca25a4
Commit
3eca25a4
authored
Apr 14, 2020
by
刘海龙
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://132.232.91.252:9999/ice/quxiu
parents
25d5e62e
32efbcec
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
68 additions
and
37 deletions
+68
-37
api/Appapi/Api/Linkmic.php
+1
-0
api/Appapi/Api/User.php
+3
-2
api/Appapi/Domain/User.php
+2
-2
api/Appapi/Model/Home.php
+3
-3
api/Appapi/Model/Live.php
+20
-25
api/Appapi/Model/User.php
+39
-5
No files found.
api/Appapi/Api/Linkmic.php
View file @
3eca25a4
...
@@ -244,6 +244,7 @@ class Api_Linkmic extends PhalApi_Api {
...
@@ -244,6 +244,7 @@ class Api_Linkmic extends PhalApi_Api {
);
);
@
$result
=
curl_exec
(
$ch
);
@
$result
=
curl_exec
(
$ch
);
if
(
curl_errno
(
$ch
)){
if
(
curl_errno
(
$ch
)){
//print curl_error($ch);
//print curl_error($ch);
file_put_contents
(
'./MergeVideoStream.txt'
,
date
(
'y-m-d H:i:s'
)
.
' 提交参数信息 ch:'
.
json_encode
(
curl_error
(
$ch
))
.
"
\r\n
"
,
FILE_APPEND
);
file_put_contents
(
'./MergeVideoStream.txt'
,
date
(
'y-m-d H:i:s'
)
.
' 提交参数信息 ch:'
.
json_encode
(
curl_error
(
$ch
))
.
"
\r\n
"
,
FILE_APPEND
);
...
...
api/Appapi/Api/User.php
View file @
3eca25a4
...
@@ -90,6 +90,7 @@ class Api_User extends PhalApi_Api {
...
@@ -90,6 +90,7 @@ class Api_User extends PhalApi_Api {
'uid'
=>
array
(
'name'
=>
'uid'
,
'type'
=>
'int'
,
'min'
=>
1
,
'require'
=>
true
,
'desc'
=>
'用户ID'
),
'uid'
=>
array
(
'name'
=>
'uid'
,
'type'
=>
'int'
,
'min'
=>
1
,
'require'
=>
true
,
'desc'
=>
'用户ID'
),
'token'
=>
array
(
'name'
=>
'token'
,
'type'
=>
'string'
,
'require'
=>
true
,
'desc'
=>
'用户token'
),
'token'
=>
array
(
'name'
=>
'token'
,
'type'
=>
'string'
,
'require'
=>
true
,
'desc'
=>
'用户token'
),
'id'
=>
array
(
'name'
=>
'id'
,
'type'
=>
'string'
,
'require'
=>
true
,
'desc'
=>
'id'
),
'id'
=>
array
(
'name'
=>
'id'
,
'type'
=>
'string'
,
'require'
=>
true
,
'desc'
=>
'id'
),
'source'
=>
array
(
'name'
=>
'source'
,
'type'
=>
'int'
,
'require'
=>
true
,
'desc'
=>
'类型,1主播,2邀请,3家族'
),
),
),
'setCash'
=>
array
(
'setCash'
=>
array
(
...
@@ -920,7 +921,7 @@ class Api_User extends PhalApi_Api {
...
@@ -920,7 +921,7 @@ class Api_User extends PhalApi_Api {
}
}
$domain
=
new
Domain_User
();
$domain
=
new
Domain_User
();
$info
=
$domain
->
rechange
(
$this
->
uid
,
$this
->
id
);
$info
=
$domain
->
rechange
(
$this
->
uid
,
$this
->
id
,
$this
->
source
);
if
(
$info
===
1
){
if
(
$info
===
1
){
$rs
[
'code'
]
=
1001
;
$rs
[
'code'
]
=
1001
;
...
@@ -930,7 +931,7 @@ class Api_User extends PhalApi_Api {
...
@@ -930,7 +931,7 @@ class Api_User extends PhalApi_Api {
if
(
$info
===
2
){
if
(
$info
===
2
){
$rs
[
'code'
]
=
1002
;
$rs
[
'code'
]
=
1002
;
$rs
[
'msg'
]
=
'
积分
不足'
;
$rs
[
'msg'
]
=
'
魅力值
不足'
;
return
$rs
;
return
$rs
;
}
}
...
...
api/Appapi/Domain/User.php
View file @
3eca25a4
...
@@ -92,11 +92,11 @@ class Domain_User {
...
@@ -92,11 +92,11 @@ class Domain_User {
return
$rs
;
return
$rs
;
}
}
public
function
rechange
(
$uid
,
$id
)
{
public
function
rechange
(
$uid
,
$id
,
$source
)
{
$rs
=
array
();
$rs
=
array
();
$model
=
new
Model_User
();
$model
=
new
Model_User
();
$rs
=
$model
->
rechange
(
$uid
,
$id
);
$rs
=
$model
->
rechange
(
$uid
,
$id
,
$source
);
return
$rs
;
return
$rs
;
}
}
...
...
api/Appapi/Model/Home.php
View file @
3eca25a4
...
@@ -73,7 +73,7 @@ class Model_Home extends PhalApi_Model_NotORM {
...
@@ -73,7 +73,7 @@ class Model_Home extends PhalApi_Model_NotORM {
$result
=
DI
()
->
notorm
->
users_live
$result
=
DI
()
->
notorm
->
users_live
->
select
(
"uid,thumb,title,city,stream,pull,thumb,isvideo,type,type_val,game_action,goodnum,anyway"
)
->
select
(
"uid,thumb,title,city,stream,pull,thumb,isvideo,type,type_val,game_action,goodnum,anyway"
)
->
where
(
$where
)
->
where
(
$where
)
->
order
(
'hotvotes desc,starttime desc'
)
->
order
(
'hotvotes desc,
starttime desc'
)
->
limit
(
$start
,
$pnum
)
->
limit
(
$start
,
$pnum
)
->
fetchAll
();
->
fetchAll
();
...
@@ -603,11 +603,11 @@ class Model_Home extends PhalApi_Model_NotORM {
...
@@ -603,11 +603,11 @@ class Model_Home extends PhalApi_Model_NotORM {
public
function
getRecommend
(){
public
function
getRecommend
(){
$configpri
=
getConfigPri
();
$configpri
=
getConfigPri
();
$where
=
"
isrecommend = '1' and islive= '1' and ishot='1'
"
;
$where
=
"
islive= '1'
"
;
$result
=
DI
()
->
notorm
->
users_live
$result
=
DI
()
->
notorm
->
users_live
->
select
(
"uid,thumb,title,city,stream,pull,thumb,isvideo,type,type_val,game_action,goodnum,anyway"
)
->
select
(
"uid,thumb,title,city,stream,pull,thumb,isvideo,type,type_val,game_action,goodnum,anyway"
)
->
where
(
$where
)
->
where
(
$where
)
->
order
(
'starttime desc'
)
->
order
(
'
isrecommend desc,
starttime desc'
)
->
limit
(
50
)
->
limit
(
50
)
->
fetchAll
();
->
fetchAll
();
...
...
api/Appapi/Model/Live.php
View file @
3eca25a4
...
@@ -857,12 +857,10 @@ class Model_Live extends PhalApi_Model_NotORM {
...
@@ -857,12 +857,10 @@ class Model_Live extends PhalApi_Model_NotORM {
$anthor_total
=
floor
(
$anthor_total
*
$jackpotset
[
'luck_anchor'
]
*
0.01
);
$anthor_total
=
floor
(
$anthor_total
*
$jackpotset
[
'luck_anchor'
]
*
0.01
);
}
}
/* 幸运礼物分成 */
/* 幸运礼物分成 */
/* 家族分成之后的金额 */
/* 家族分成之后的金额 */
$anthor_total
=
setFamilyDivide
(
$liveuid
,
$anthor_total
);
$anthor_total
=
setFamilyDivide
(
$liveuid
,
$anthor_total
);
//主播 经验
//主播 经验
$get_gift
=
!
empty
(
$set
[
'get_gift'
])
?
$set
[
'get_gift'
]
:
0
;
$get_gift
=
!
empty
(
$set
[
'get_gift'
])
?
$set
[
'get_gift'
]
:
0
;
$get_gift2
=
!
empty
(
$set
[
'get_gift2'
])
?
$set
[
'get_gift2'
]
:
0
;
$get_gift2
=
!
empty
(
$set
[
'get_gift2'
])
?
$set
[
'get_gift2'
]
:
0
;
...
@@ -871,7 +869,6 @@ class Model_Live extends PhalApi_Model_NotORM {
...
@@ -871,7 +869,6 @@ class Model_Live extends PhalApi_Model_NotORM {
$get_gif3
=
(
int
)(
$total
/
$get_gift
);
$get_gif3
=
(
int
)(
$total
/
$get_gift
);
$total3
+=
(
$get_gif3
*
$get_gift2
);
$total3
+=
(
$get_gif3
*
$get_gift2
);
}
}
/* 更新直播 魅力值 累计魅力值 */
/* 更新直播 魅力值 累计魅力值 */
$istouid
=
DI
()
->
notorm
->
users
$istouid
=
DI
()
->
notorm
->
users
->
where
(
'id = ?'
,
$liveuid
)
->
where
(
'id = ?'
,
$liveuid
)
...
@@ -894,8 +891,6 @@ class Model_Live extends PhalApi_Model_NotORM {
...
@@ -894,8 +891,6 @@ class Model_Live extends PhalApi_Model_NotORM {
$insert
=
array
(
"type"
=>
$type
,
"action"
=>
$action
,
"uid"
=>
$uid
,
"touid"
=>
$liveuid
,
"giftid"
=>
$giftid
,
"giftcount"
=>
$giftcount
,
"totalcoin"
=>
$totalcoin
,
"showid"
=>
$showid
,
"mark"
=>
$giftinfo
[
'mark'
],
"addtime"
=>
$addtime
);
$insert
=
array
(
"type"
=>
$type
,
"action"
=>
$action
,
"uid"
=>
$uid
,
"touid"
=>
$liveuid
,
"giftid"
=>
$giftid
,
"giftcount"
=>
$giftcount
,
"totalcoin"
=>
$totalcoin
,
"showid"
=>
$showid
,
"mark"
=>
$giftinfo
[
'mark'
],
"addtime"
=>
$addtime
);
DI
()
->
notorm
->
users_coinrecord
->
insert
(
$insert
);
DI
()
->
notorm
->
users_coinrecord
->
insert
(
$insert
);
/* 更新主播热门 */
/* 更新主播热门 */
// if($giftinfo['mark']==1){
// if($giftinfo['mark']==1){
DI
()
->
notorm
->
users_live
DI
()
->
notorm
->
users_live
...
@@ -986,26 +981,26 @@ class Model_Live extends PhalApi_Model_NotORM {
...
@@ -986,26 +981,26 @@ class Model_Live extends PhalApi_Model_NotORM {
);
);
DI
()
->
notorm
->
users_coinrecord
->
insert
(
$insert
);
DI
()
->
notorm
->
users_coinrecord
->
insert
(
$insert
);
$luckcoin2
=
(
int
)(
$luckcoin
*
0.05
*
100
);
//
$luckcoin2 = (int)($luckcoin*0.05 * 100);
$luckcoin3
=
$luckcoin2
/
100
;
//
$luckcoin3 = $luckcoin2 / 100;
if
(
$luckcoin3
>
0
)
{
//
if ($luckcoin3 > 0) {
DI
()
->
notorm
->
users
//
DI()->notorm->users
->
where
(
'id = ?'
,
$liveuid
)
//
->where('id = ?', $liveuid)
->
update
(
array
(
'votes'
=>
new
NotORM_Literal
(
"votes +
{
$luckcoin3
}
"
),
'votestotal'
=>
new
NotORM_Literal
(
"votestotal +
{
$luckcoin3
}
"
)
));
//
->update( array('votes' => new NotORM_Literal("votes + {$luckcoin3}"),'votestotal' => new NotORM_Literal("votestotal + {$luckcoin3}") ));
$insert
=
array
(
//
$insert=array(
"type"
=>
'income'
,
//
"type"=>'income',
"action"
=>
'luckgift'
,
//
"action"=>'luckgift',
"uid"
=>
$liveuid
,
//
"uid"=>$liveuid,
"touid"
=>
$liveuid
,
//
"touid"=>$liveuid,
"giftid"
=>
$giftid
,
//
"giftid"=>$giftid,
"giftcount"
=>
$lucktimes
,
//
"giftcount"=>$lucktimes,
"totalcoin"
=>
$luckcoin
,
//
"totalcoin"=>$luckcoin,
"showid"
=>
$showid
,
//
"showid"=>$showid,
"mark"
=>
$giftinfo
[
'mark'
],
//
"mark"=>$giftinfo['mark'],
"addtime"
=>
$addtime
//
"addtime"=>$addtime
);
//
);
DI
()
->
notorm
->
users_coinrecord
->
insert
(
$insert
);
//
DI()->notorm->users_coinrecord->insert($insert);
}
//
}
break
;
break
;
}
else
{
}
else
{
$rateSum
-=
$ratePre
;
$rateSum
-=
$ratePre
;
...
...
api/Appapi/Model/User.php
View file @
3eca25a4
...
@@ -337,26 +337,60 @@ class Model_User extends PhalApi_Model_NotORM
...
@@ -337,26 +337,60 @@ class Model_User extends PhalApi_Model_NotORM
];
];
}
}
public
function
rechange
(
$uid
,
$id
)
public
function
rechange
(
$uid
,
$id
,
$source
)
{
{
$rechange
=
DI
()
->
notorm
->
recharge_rules
->
where
(
'id=?'
,
$id
)
->
fetchOne
();
$rechange
=
DI
()
->
notorm
->
recharge_rules
->
where
(
'id=?'
,
$id
)
->
fetchOne
();
if
(
empty
(
$rechange
))
{
if
(
empty
(
$rechange
))
{
return
1
;
return
1
;
}
}
$cashvotes
=
$rechange
[
'money'
];
$user
=
DI
()
->
notorm
->
users
->
select
(
'votes'
)
->
where
(
'id=?'
,
$uid
)
->
fetchOne
();
$user
=
DI
()
->
notorm
->
users
->
select
(
'votes'
)
->
where
(
'id=?'
,
$uid
)
->
fetchOne
();
if
(
$rechange
[
'money'
]
>
$user
[
'votes'
])
{
if
(
$source
==
1
&&
$cashvotes
>
$user
[
'votes'
])
{
return
2
;
}
if
(
$source
==
2
&&
$cashvotes
>
$user
[
'i_votes'
])
{
return
2
;
}
if
(
$source
==
3
&&
$cashvotes
>
$user
[
'f_votes'
])
{
return
2
;
return
2
;
}
}
$total
=
$rechange
[
'money'
]
+
$rechange
[
'give'
];
$total
=
$rechange
[
'money'
]
+
$rechange
[
'give'
];
DI
()
->
notorm
->
users
->
where
(
'id = ?'
,
$uid
)
->
update
([
$ifok
=
0
;
if
(
$source
==
1
)
{
$ifok
=
DI
()
->
notorm
->
users
->
where
(
'id = ? and votes>=?'
,
$uid
,
$cashvotes
)
->
update
([
'coin'
=>
new
NotORM_Literal
(
"coin +
{
$total
}
"
),
'coin'
=>
new
NotORM_Literal
(
"coin +
{
$total
}
"
),
'votes'
=>
new
NotORM_Literal
(
"votes -
{
$rechange
[
'money'
]
}
"
),
'votes'
=>
new
NotORM_Literal
(
"votes -
{
$cashvotes
}
"
)
]);
]);
}
return
0
;
if
(
$source
==
2
)
{
$ifok
=
DI
()
->
notorm
->
users
->
where
(
'id = ? and i_votes>=?'
,
$uid
,
$cashvotes
)
->
update
([
'coin'
=>
new
NotORM_Literal
(
"coin +
{
$total
}
"
),
'i_votes'
=>
new
NotORM_Literal
(
"i_votes -
{
$cashvotes
}
"
)
]);
}
if
(
$source
==
3
)
{
$ifok
=
DI
()
->
notorm
->
users
->
where
(
'id = ? and f_votes>=?'
,
$uid
,
$cashvotes
)
->
update
([
'coin'
=>
new
NotORM_Literal
(
"coin +
{
$total
}
"
),
'f_votes'
=>
new
NotORM_Literal
(
"f_votes -
{
$cashvotes
}
"
)
]);
}
// DI()->notorm->users->where('id = ?', $uid)->update([
// 'coin' => new NotORM_Literal("coin + {$total}"),
// 'votes' => new NotORM_Literal("votes - {$rechange['money']}"),
// ]);
return
!
$ifok
?
2
:
0
;
}
}
/* 关注 */
/* 关注 */
...
...
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