1
This commit is contained in:
parent
a3f5c50f1f
commit
f51739d820
@ -24,6 +24,7 @@ class RookieTask(object):
|
||||
'url': 'webapp/index.php?c=RookieTask&a=taskList',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
['day', 0, '天'],
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
@ -34,16 +35,28 @@ class RookieTask(object):
|
||||
'name': 'commitTaskS',
|
||||
'desc': '提交任务',
|
||||
'group': 'RookieTask',
|
||||
'url': 'webapp/index.php?c=RookieTask&a=commitTaskS',
|
||||
'surl': 'webapp/index.php?c=RookieTask&a=commitTaskS',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
['task_id', [Task()], '任务id'],
|
||||
['task_id', 0, '任务id'],
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['award', _common.Award(), '奖励信息'],
|
||||
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||
]
|
||||
},{
|
||||
'name': 'getTaskRedTags',
|
||||
'desc': '任务红点',
|
||||
'group': 'RookieTask',
|
||||
'url': 'webapp/index.php?c=RookieTask&a=getTaskRedTags',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['list', [], '红点信息'],
|
||||
]
|
||||
},
|
||||
]
|
||||
|
||||
|
@ -9,6 +9,7 @@ $g_conf_mail_mysql_cluster = require('../config/mail.mysql.cluster.php');
|
||||
$g_conf_log_mysql_cluster = require('../config/logdb.mysql.cluster.php');
|
||||
$g_conf_redis_cluster = require('../config/game2006api.redis.cluster.php');
|
||||
$g_conf_confdb_mysql_cluster = require('../config/confdb.mysql.cluster.php');
|
||||
$g_conf_frienddb_mysql_cluster = require('../config/frienddb.mysql.cluster.php');
|
||||
$g_metatables = array();
|
||||
|
||||
function checkMysqlConfig()
|
||||
@ -96,6 +97,12 @@ function getConfDbMysqlConfig()
|
||||
return $g_conf_confdb_mysql_cluster;
|
||||
}
|
||||
|
||||
function getFriendDbMysqlConfig()
|
||||
{
|
||||
global $g_conf_frienddb_mysql_cluster;
|
||||
return $g_conf_frienddb_mysql_cluster;
|
||||
}
|
||||
|
||||
function getServerSwitchConfig()
|
||||
{
|
||||
global $g_conf_server_switch_cluster;
|
||||
|
@ -11,6 +11,7 @@ class BaseController {
|
||||
private $mailDbConn = null;
|
||||
private $logDbConn = null;
|
||||
private $confDbConn = null;
|
||||
private $friendDbConn = null;
|
||||
private $timeOffset = 0;
|
||||
private $moduleHash = array();
|
||||
private $contributionPoint = 0;
|
||||
@ -267,6 +268,21 @@ class BaseController {
|
||||
));
|
||||
return $this->confDbConn;
|
||||
}
|
||||
public function _getFriendDbMysql()
|
||||
{
|
||||
if ($this->friendDbConn) {
|
||||
return $this->friendDbConn;
|
||||
}
|
||||
$mysql_conf = getFriendDbMysqlConfig();
|
||||
$this->friendDbConn = new phpcommon\Mysql(array(
|
||||
'host' => $mysql_conf['host'],
|
||||
'port' => $mysql_conf['port'],
|
||||
'user' => $mysql_conf['user'],
|
||||
'passwd' => $mysql_conf['passwd'],
|
||||
'dbname' => $mysql_conf['dbname'],
|
||||
));
|
||||
return $this->friendDbConn;
|
||||
}
|
||||
|
||||
public function _getRelationDbMysql()
|
||||
{
|
||||
|
@ -6,6 +6,7 @@ require_once('services/PropertyChgService.php');
|
||||
|
||||
require_once('mt/HashRateShop.php');
|
||||
require_once('mt/Item.php');
|
||||
require_once('mt/RookieTask.php');
|
||||
|
||||
require_once('models/HashRate.php');
|
||||
require_once('models/HashRateShopBuyRecord.php');
|
||||
@ -93,6 +94,7 @@ class HashRateShopController extends BaseAuthedController {
|
||||
);
|
||||
}
|
||||
$propertyChgService->addUserChg();
|
||||
myself()->_callModelStatic('RookieTask','incTaskVal',\mt\RookieTask::HASH_RATE_BUYS_COND,$goodsNum);
|
||||
$this->_rspData(
|
||||
array(
|
||||
'award' => $awardService->toDto(),
|
||||
|
@ -75,4 +75,18 @@ class RookieTaskController extends BaseAuthedController {
|
||||
));
|
||||
}
|
||||
|
||||
public function getTaskRedTags(){
|
||||
$metaList = \mt\RookieTask::allList();
|
||||
$list = array();
|
||||
foreach ($metaList as $meta){
|
||||
$metaDto = \services\RookieTaskService::getTaskDto($meta);
|
||||
if ($metaDto['state'] == \services\RookieTaskService::FINISHED_STATE){
|
||||
array_push($list,$meta['task_day']);
|
||||
}
|
||||
}
|
||||
$this->_rspData(array(
|
||||
'list' => $list,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
@ -36,6 +36,16 @@ class RookieTask {
|
||||
return $metaList;
|
||||
}
|
||||
|
||||
public static function allList(){
|
||||
$metaList = array();
|
||||
foreach (self::getMetaList() as $meta) {
|
||||
if ($meta['task_day'] > 0) {
|
||||
array_push($metaList, $meta);
|
||||
}
|
||||
}
|
||||
return $metaList;
|
||||
}
|
||||
|
||||
public static function find($id){
|
||||
return getXVal(self::getMetaList(), $id);
|
||||
}
|
||||
|
@ -106,6 +106,7 @@ class TameBattleDataService extends BaseService {
|
||||
}
|
||||
myself()->_fireEvent('Battle','onSettlement',$this->battleInfo);
|
||||
myself()->_callModelStatic('RookieTask','incTaskVal',mt\RookieTask::BATTLE_TIMES_COND,1);
|
||||
$this->isMyFriend();
|
||||
//记录战斗有效行为
|
||||
// $this->_updateBattleData();
|
||||
//记录战斗数据的排行榜
|
||||
@ -164,6 +165,38 @@ class TameBattleDataService extends BaseService {
|
||||
}
|
||||
|
||||
|
||||
private function isMyFriend(){
|
||||
$myAccount = getXVal($this->userInfo,'account_id', 0);
|
||||
foreach ($this->teamInfo as $member){
|
||||
$account = getXVal($member,'account_id', 0);
|
||||
$row = SqlHelper::ormSelectOne(
|
||||
myself()->_getFriendDbMysql(),
|
||||
't_friend_ships',
|
||||
array(
|
||||
'account1_id' => $myAccount,
|
||||
'account2_id' => $account,
|
||||
'is_friendship' => 1,
|
||||
)
|
||||
);
|
||||
if ($row){
|
||||
myself()->_callModelStatic('RookieTask','incTaskVal',mt\RookieTask::AND_FRIENDS_BATTLE_COND,1);
|
||||
break;
|
||||
}
|
||||
$row = SqlHelper::ormSelectOne(
|
||||
myself()->_getFriendDbMysql(),
|
||||
't_friend_ships',
|
||||
array(
|
||||
'account1_id' => $account,
|
||||
'account2_id' => $myAccount,
|
||||
'is_friendship' => 1,
|
||||
)
|
||||
);
|
||||
if ($row){
|
||||
myself()->_callModelStatic('RookieTask','incTaskVal',mt\RookieTask::AND_FRIENDS_BATTLE_COND,1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//记录战斗数据的排行榜
|
||||
private function recordBattleRanking(){
|
||||
|
Loading…
x
Reference in New Issue
Block a user