NPlayer merge to NPlayerInfo

This commit is contained in:
aozhiwei 2021-11-18 19:33:03 +08:00
parent d2bf465b9a
commit cba7e7616a
5 changed files with 51 additions and 62 deletions

View File

@ -1,31 +0,0 @@
# -*- coding: utf-8 -*-
import _common
class NPlayer(object):
def __init__(self):
self.apis = [
{
'desc': 'getGunInfo',
'group': 'NPlayer',
'url': 'webapp/index.php?c=NPlayer&a=getGunInfo',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getPlayerLv',
'group': 'NPlayer',
'url': 'webapp/index.php?c=NPlayer&a=getPlayerLv',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
]

View File

@ -61,4 +61,26 @@ class NPlayerInfo(object):
_common.RspHead(),
]
},
{
'desc': 'getGunInfo',
'group': 'NPlayer',
'url': 'webapp/index.php?c=NPlayer&a=getGunInfo',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getPlayerLv',
'group': 'NPlayer',
'url': 'webapp/index.php?c=NPlayer&a=getPlayerLv',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
]

View File

@ -1,31 +0,0 @@
<?php
class NPlayerController extends BaseAuthedController {
public function getGunInfo()
{
$account_id = $_REQUEST['account_id'];
$conn = $this->getMysql($account_id);
// $row = $conn->execQueryOne('SELECT guildcoin_num FROM user WHERE accountid=:accountid;',
// array(
// ':accountid' => $account_id
// ));
$sqlStr = "SELECT * FROM gun_intensify WHERE accountid=:accountid; ";
$row = $conn->execQuery($sqlStr,array(':accountid' => $account_id));
$this->sendDataToClient(0,"test02",$row);
}
public function getPlayerLv()
{
$account_id = $_REQUEST['account_id'];
$conn = $this->getMysql($account_id);
$sqlStr = "SELECT lv,lv_exp,money_of_week FROM user WHERE accountid=:accountid; ";
$row = $conn->execQuery($sqlStr,array(':accountid' => $account_id));
if($row) {
}
$this->sendDataToClient(100,"getPlayerLv",$row);
}
}

View File

@ -229,4 +229,32 @@ class NPlayerInfoController extends BaseAuthedController {
// $sqlStr = "SELECT * FROM user WHERE accountid=:accountid; ";
// $row = $conn->execQuery($sqlStr,array(':accountid' => $account_id));
}
public function getGunInfo()
{
$account_id = $_REQUEST['account_id'];
$conn = $this->getMysql($account_id);
// $row = $conn->execQueryOne('SELECT guildcoin_num FROM user WHERE accountid=:accountid;',
// array(
// ':accountid' => $account_id
// ));
$sqlStr = "SELECT * FROM gun_intensify WHERE accountid=:accountid; ";
$row = $conn->execQuery($sqlStr,array(':accountid' => $account_id));
$this->sendDataToClient(0,"test02",$row);
}
public function getPlayerLv()
{
$account_id = $_REQUEST['account_id'];
$conn = $this->getMysql($account_id);
$sqlStr = "SELECT lv,lv_exp,money_of_week FROM user WHERE accountid=:accountid; ";
$row = $conn->execQuery($sqlStr,array(':accountid' => $account_id));
if($row) {
}
$this->sendDataToClient(100,"getPlayerLv",$row);
}
}

View File

@ -28,6 +28,7 @@ $rewriteRule = array(
'Property' => 'Role',
'NBag' => 'Bag',
'NHero' => 'Hero',
'NPlayer' => 'NPlayerInfo',
);
function getRewriteClass($oldC)