移除getVideoReward getDeskReward getShareVideoReward getWatchAdReward addVideotimes
This commit is contained in:
parent
a9d8303118
commit
422a23c36f
55
doc/Role.py
55
doc/Role.py
@ -139,61 +139,6 @@ class Role(object):
|
||||
_common.RspHead(),
|
||||
]
|
||||
},
|
||||
{
|
||||
'desc': 'getVideoReward',
|
||||
'group': 'Role',
|
||||
'url': 'webapp/index.php?c=Role&a=getVideoReward',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
]
|
||||
},
|
||||
{
|
||||
'desc': 'getDeskReward',
|
||||
'group': 'Role',
|
||||
'url': 'webapp/index.php?c=Role&a=getDeskReward',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
]
|
||||
},
|
||||
{
|
||||
'desc': 'getShareVideoReward',
|
||||
'group': 'Role',
|
||||
'url': 'webapp/index.php?c=Role&a=getShareVideoReward',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
]
|
||||
},
|
||||
{
|
||||
'desc': 'getWatchAdReward',
|
||||
'group': 'Role',
|
||||
'url': 'webapp/index.php?c=Role&a=getWatchAdReward',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
]
|
||||
},
|
||||
{
|
||||
'desc': 'addVideotimes',
|
||||
'group': 'Role',
|
||||
'url': 'webapp/index.php?c=Role&a=addVideotimes',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
]
|
||||
},
|
||||
{
|
||||
'desc': 'getFightEquip',
|
||||
'group': 'Role',
|
||||
|
@ -746,292 +746,6 @@ class RoleController extends BaseAuthedController {
|
||||
));
|
||||
}
|
||||
|
||||
public function getVideoReward()
|
||||
{
|
||||
$account_id = $_REQUEST['account_id'];
|
||||
$conn = $this->getMysql($account_id);
|
||||
$rowUser = $conn->execQueryOne('SELECT rmb_num, share_video_times FROM user WHERE accountid=:accountid;',
|
||||
array(
|
||||
':accountid' => $account_id,
|
||||
));
|
||||
|
||||
if (!$rowUser) {
|
||||
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
|
||||
return;
|
||||
}
|
||||
$p = mt\Parameter::getOldParam(SHARE_VIDEO_REWARD);
|
||||
$num = $p['param_value'];
|
||||
|
||||
$ret = $conn->execScript('UPDATE user SET rmb_num=:rmb_num, share_video_times=:share_video_times, modify_time=:modify_time ' .
|
||||
' WHERE accountid=:accountid;',
|
||||
array(
|
||||
':accountid' => $account_id,
|
||||
':rmb_num' => $rowUser['rmb_num'] + $num,
|
||||
':share_video_times' => $rowUser['share_video_times'] + 1,
|
||||
':modify_time' => phpcommon\getNowTime()
|
||||
));
|
||||
if (!$ret) {
|
||||
die();
|
||||
return;
|
||||
}
|
||||
|
||||
$addreward = new classes\AddReward();
|
||||
|
||||
$rmb_num = $addreward->getRmbNum($account_id);
|
||||
echo json_encode(array(
|
||||
'errcode' => 0,
|
||||
'errmsg'=> '',
|
||||
'rmb_nums' => $rmb_num,
|
||||
|
||||
));
|
||||
}
|
||||
|
||||
public function getDeskReward()
|
||||
{
|
||||
$account_id = $_REQUEST['account_id'];
|
||||
$conn = $this->getMysql($account_id);
|
||||
$rowUser = $conn->execQueryOne('SELECT first_gift FROM user WHERE accountid=:accountid;',
|
||||
array(
|
||||
':accountid' => $account_id,
|
||||
));
|
||||
|
||||
if (!$rowUser) {
|
||||
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
|
||||
return;
|
||||
}
|
||||
|
||||
$ret = $conn->execScript('UPDATE user SET first_gift=1, modify_time=:modify_time ' .
|
||||
' WHERE accountid=:accountid;',
|
||||
array(
|
||||
':accountid' => $account_id,
|
||||
':modify_time' => phpcommon\getNowTime()
|
||||
));
|
||||
if (!$ret) {
|
||||
die();
|
||||
return;
|
||||
}
|
||||
|
||||
$addreward = new classes\AddReward();
|
||||
$item_list = array();
|
||||
$all_item_list = array();
|
||||
$items = $addreward->addReward(13003, 1, $account_id, 0, 0);
|
||||
array_push($item_list, array(
|
||||
'item_id' => 13003,
|
||||
'item_num' => 1,
|
||||
'time' => 0,
|
||||
|
||||
));
|
||||
array_push($item_list, array(
|
||||
'item_id' => 10003,
|
||||
'item_num' => 88,
|
||||
'time' => 0,
|
||||
|
||||
));
|
||||
|
||||
foreach($items as $i) {
|
||||
array_push($all_item_list, array(
|
||||
'item_id' => $i['item_id'],
|
||||
'item_num' => $i['item_num'],
|
||||
'time' => $i['time'],
|
||||
));
|
||||
}
|
||||
$items = $addreward->addReward(10003, 88, $account_id, 0, 0);
|
||||
foreach($items as $i) {
|
||||
array_push($all_item_list, array(
|
||||
'item_id' => $i['item_id'],
|
||||
'item_num' => $i['item_num'],
|
||||
'time' => $i['time'],
|
||||
));
|
||||
}
|
||||
|
||||
$rmb_num = $addreward->getRmbNum($account_id);
|
||||
echo json_encode(array(
|
||||
'errcode' => 0,
|
||||
'errmsg'=> '',
|
||||
'item_list'=>$item_list,
|
||||
'all_item_list' => $all_item_list,
|
||||
'rmb_nums' => $rmb_num,
|
||||
'flag' => 1,
|
||||
));
|
||||
}
|
||||
|
||||
public function getShareVideoReward()
|
||||
{
|
||||
$account_id = $_REQUEST['account_id'];
|
||||
$conn = $this->getMysql($account_id);
|
||||
$rowUser = $conn->execQueryOne('SELECT act_video_status FROM user WHERE accountid=:accountid;',
|
||||
array(
|
||||
':accountid' => $account_id,
|
||||
));
|
||||
|
||||
if (!$rowUser) {
|
||||
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
|
||||
return;
|
||||
}
|
||||
if ($rowUser['act_video_status'] != 1){
|
||||
phpcommon\sendError(ERR_USER_BASE + 2, '奖励不可领取');
|
||||
return;
|
||||
}
|
||||
|
||||
$ret = $conn->execScript('UPDATE user SET act_video_status=2, modify_time=:modify_time ' .
|
||||
' WHERE accountid=:accountid;',
|
||||
array(
|
||||
':accountid' => $account_id,
|
||||
':modify_time' => phpcommon\getNowTime()
|
||||
));
|
||||
if (!$ret) {
|
||||
die();
|
||||
return;
|
||||
}
|
||||
|
||||
$addreward = new classes\AddReward();
|
||||
$item_list = array();
|
||||
$all_item_list = array();
|
||||
array_push($item_list,array(
|
||||
'item_id' => 13018,
|
||||
'item_num' => 1,
|
||||
'time' => 0
|
||||
));
|
||||
$items = $addreward->addReward(13018, 1, $account_id, 0, 0);
|
||||
foreach($items as $i) {
|
||||
array_push($all_item_list, array(
|
||||
'item_id' => $i['item_id'],
|
||||
'item_num' => $i['item_num'],
|
||||
'time' => $i['time'],
|
||||
));
|
||||
}
|
||||
|
||||
array_push($item_list,array(
|
||||
'item_id' => 15018,
|
||||
'item_num' => 1,
|
||||
'time' => 0
|
||||
));
|
||||
$items = $addreward->addReward(15018, 1, $account_id, 0, 0);
|
||||
foreach($items as $i) {
|
||||
array_push($all_item_list, array(
|
||||
'item_id' => $i['item_id'],
|
||||
'item_num' => $i['item_num'],
|
||||
'time' => $i['time'],
|
||||
));
|
||||
}
|
||||
$rmb_num = $addreward->getRmbNum($account_id);
|
||||
echo json_encode(array(
|
||||
'errcode' => 0,
|
||||
'errmsg'=> '',
|
||||
'rmb_nums' => $rmb_num,
|
||||
'item_list' => $item_list,
|
||||
'all_item_list' => $all_item_list,
|
||||
'status' => 2,
|
||||
));
|
||||
}
|
||||
|
||||
public function getWatchAdReward()
|
||||
{
|
||||
$account_id = $_REQUEST['account_id'];
|
||||
$conn = $this->getMysql($account_id);
|
||||
$rowUser = $conn->execQueryOne('SELECT act_ad_status FROM user WHERE accountid=:accountid;',
|
||||
array(
|
||||
':accountid' => $account_id,
|
||||
));
|
||||
|
||||
if (!$rowUser) {
|
||||
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
|
||||
return;
|
||||
}
|
||||
if ($rowUser['act_ad_status'] != 1){
|
||||
phpcommon\sendError(ERR_USER_BASE + 2, '奖励不可领取');
|
||||
return;
|
||||
}
|
||||
|
||||
$ret = $conn->execScript('UPDATE user SET act_ad_status=2, modify_time=:modify_time ' .
|
||||
' WHERE accountid=:accountid;',
|
||||
array(
|
||||
':accountid' => $account_id,
|
||||
':modify_time' => phpcommon\getNowTime()
|
||||
));
|
||||
if (!$ret) {
|
||||
die();
|
||||
return;
|
||||
}
|
||||
|
||||
$addreward = new classes\AddReward();
|
||||
$item_list = array();
|
||||
$all_item_list = array();
|
||||
array_push($item_list,array(
|
||||
'item_id' => 13003,
|
||||
'item_num' => 1,
|
||||
'time' => 0
|
||||
));
|
||||
$items = $addreward->addReward(13003, 1, $account_id, 0, 0);
|
||||
foreach($items as $i) {
|
||||
array_push($all_item_list, array(
|
||||
'item_id' => $i['item_id'],
|
||||
'item_num' => $i['item_num'],
|
||||
'time' => $i['time'],
|
||||
));
|
||||
}
|
||||
|
||||
array_push($item_list,array(
|
||||
'item_id' => 15003,
|
||||
'item_num' => 1,
|
||||
'time' => 0
|
||||
));
|
||||
$items = $addreward->addReward(15003, 1, $account_id, 0, 0);
|
||||
foreach($items as $i) {
|
||||
array_push($all_item_list, array(
|
||||
'item_id' => $i['item_id'],
|
||||
'item_num' => $i['item_num'],
|
||||
'time' => $i['time'],
|
||||
));
|
||||
}
|
||||
|
||||
$rmb_num = $addreward->getRmbNum($account_id);
|
||||
echo json_encode(array(
|
||||
'errcode' => 0,
|
||||
'errmsg'=> '',
|
||||
'rmb_nums' => $rmb_num,
|
||||
'item_list' => $item_list,
|
||||
'all_item_list' => $all_item_list,
|
||||
'status' => 2,
|
||||
));
|
||||
}
|
||||
|
||||
public function addVideotimes()
|
||||
{
|
||||
$account_id = $_REQUEST['account_id'];
|
||||
$conn = $this->getMysql($account_id);
|
||||
$row = $conn->execQueryOne('SELECT share_video_sums, act_video_status FROM user WHERE accountid=:accountid;',
|
||||
array(
|
||||
':accountid' => $account_id,
|
||||
|
||||
));
|
||||
if (!$row) {
|
||||
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
|
||||
return;
|
||||
|
||||
}
|
||||
$status = $row['act_video_status'];
|
||||
if ($row['share_video_sums'] + 1 >= 3 && $row['act_video_status'] < 1){
|
||||
$status = 1;
|
||||
}
|
||||
$ret = $conn->execScript('UPDATE user SET share_video_sums=:share_video_sums, modify_time=:modify_time, act_video_status=:act_video_status ' .
|
||||
' WHERE accountid=:accountid;',
|
||||
array(
|
||||
':accountid' => $account_id,
|
||||
':modify_time' => phpcommon\getNowTime(),
|
||||
':share_video_sums' => $row['share_video_sums'] + 1,
|
||||
':act_video_status' => $status,
|
||||
));
|
||||
if (!$ret) {
|
||||
die();
|
||||
return;
|
||||
}
|
||||
echo json_encode(array(
|
||||
'errcode' => 0,
|
||||
'errmsg'=> '',
|
||||
));
|
||||
}
|
||||
|
||||
public function getFightEquip()
|
||||
{
|
||||
$account_id = $_REQUEST['account_id'];
|
||||
@ -1129,12 +843,10 @@ class RoleController extends BaseAuthedController {
|
||||
$sqlStr = "SELECT give_me_five FROM player_info WHERE accountid=:accountid; ";
|
||||
$row = $conn->execQuery($sqlStr,array(':accountid' => $account_id));
|
||||
if($row) {
|
||||
|
||||
$giveMeFiveCnt = $row["give_me_five"];
|
||||
}
|
||||
//error_log("当前GiveMeFiveCnt===".$giveMeFiveCnt);
|
||||
}
|
||||
//error_log("当前GiveMeFiveCnt===".$giveMeFiveCnt);
|
||||
return $giveMeFiveCnt;
|
||||
|
||||
}
|
||||
|
||||
public function addGiveMeFive()//玩家被点赞一次
|
||||
@ -1161,13 +873,14 @@ class RoleController extends BaseAuthedController {
|
||||
);
|
||||
$this->sendDataToClient(100,"getGiveMeFiveTest",null);
|
||||
}
|
||||
|
||||
public function getPlayerInfo()//获得玩家个人信息
|
||||
{
|
||||
|
||||
$account_id = $_REQUEST['acctID'];
|
||||
$conn = $this->getMysql($account_id);
|
||||
$from = $_REQUEST['from'];
|
||||
|
||||
|
||||
$sqlStr = "SELECT * FROM user WHERE accountid=:accountid; ";
|
||||
$row = $conn->execQuery($sqlStr,array(':accountid' => $account_id));
|
||||
$resultArr = null;
|
||||
@ -1274,6 +987,7 @@ class RoleController extends BaseAuthedController {
|
||||
//获得改名卡道具数量结束--
|
||||
$this->sendDataToClient($code,"getPlayerInfo",$resultArr);
|
||||
}
|
||||
|
||||
public function changeHIFrameHero()//修改头像 头像框 英雄
|
||||
{
|
||||
$account_id = $_REQUEST['account_id'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user