Commit d886e303 by 冷斌

fix bug

parent 1e41c42c
...@@ -224,9 +224,18 @@ class Model_Live extends PhalApi_Model_NotORM { ...@@ -224,9 +224,18 @@ class Model_Live extends PhalApi_Model_NotORM {
$rs['length']=getSeconds($cha,1); $rs['length']=getSeconds($cha,1);
$rs['nums']=$liveinfo['nums']; $rs['nums']=$liveinfo['nums'];
} }
if($liveinfo['votes']){ // if($liveinfo['votes']){
$rs['votes']=$liveinfo['votes']; // $rs['votes']=$liveinfo['votes'];
} // }
// 魅力值。。
$zhubo=DI()->notorm->users_voterecord
->select('sum(votes) as votes')
->where("action = 'sendgift' and showid = '{$liveinfo['showid']}'")
->fetchOne();
if (!empty($zhubo['votes'])) {
$rs['votes']=$zhubo['votes'];
}
$set=DI()->notorm->experlevel_set->where('id=1')->fetchOne(); $set=DI()->notorm->experlevel_set->where('id=1')->fetchOne();
$live = !empty($set['live']) ? $set['live'] : 0; $live = !empty($set['live']) ? $set['live'] : 0;
...@@ -874,6 +883,9 @@ class Model_Live extends PhalApi_Model_NotORM { ...@@ -874,6 +883,9 @@ class Model_Live extends PhalApi_Model_NotORM {
->where('id = ?', $liveuid) ->where('id = ?', $liveuid)
->update( array('votes' => new NotORM_Literal("votes + {$anthor_total}"),'votestotal' => new NotORM_Literal("votestotal + {$total3}") )); ->update( array('votes' => new NotORM_Literal("votes + {$anthor_total}"),'votestotal' => new NotORM_Literal("votestotal + {$total3}") ));
$stream2=explode('_',$stream);
$showid=$stream2[1];
if($anthor_total){ if($anthor_total){
$insert_votes=[ $insert_votes=[
'type'=>'income', 'type'=>'income',
...@@ -881,13 +893,13 @@ class Model_Live extends PhalApi_Model_NotORM { ...@@ -881,13 +893,13 @@ class Model_Live extends PhalApi_Model_NotORM {
'uid'=>$liveuid, 'uid'=>$liveuid,
'votes'=>$anthor_total, 'votes'=>$anthor_total,
'addtime'=>time(), 'addtime'=>time(),
'showid' => $showid,
]; ];
DI()->notorm->users_voterecord->insert($insert_votes); DI()->notorm->users_voterecord->insert($insert_votes);
} }
$stream2=explode('_',$stream);
$showid=$stream2[1];
$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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment