1
This commit is contained in:
parent
27d713108f
commit
3c9415cfa7
@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
require_once('services/LogService.php');
|
||||||
require_once('mt/Item.php');
|
require_once('mt/Item.php');
|
||||||
|
|
||||||
require_once('models/Bag.php');
|
require_once('models/Bag.php');
|
||||||
@ -35,6 +36,7 @@ use models\Parachute;
|
|||||||
use models\UserSeasonRing;
|
use models\UserSeasonRing;
|
||||||
use models\Chip;
|
use models\Chip;
|
||||||
use models\Pass;
|
use models\Pass;
|
||||||
|
use services\LogService;
|
||||||
|
|
||||||
class BaseAuthedController extends BaseController {
|
class BaseAuthedController extends BaseController {
|
||||||
|
|
||||||
@ -434,6 +436,8 @@ class BaseAuthedController extends BaseController {
|
|||||||
$heads = array();
|
$heads = array();
|
||||||
$headFrames = array();
|
$headFrames = array();
|
||||||
foreach ($items as $item) {
|
foreach ($items as $item) {
|
||||||
|
//道具产出埋点
|
||||||
|
LogService::productItem($item);
|
||||||
if ($awardService){
|
if ($awardService){
|
||||||
$awardService->addItem($item['item_id'], $item['item_num']);
|
$awardService->addItem($item['item_id'], $item['item_num']);
|
||||||
}
|
}
|
||||||
@ -572,6 +576,8 @@ class BaseAuthedController extends BaseController {
|
|||||||
public function _decItems($items)
|
public function _decItems($items)
|
||||||
{
|
{
|
||||||
foreach ($items as $item) {
|
foreach ($items as $item) {
|
||||||
|
//道具消耗埋点
|
||||||
|
LogService::consumeItem($item);
|
||||||
if ($this->_isVirtualItem($item['item_id'])) {
|
if ($this->_isVirtualItem($item['item_id'])) {
|
||||||
$this->_decVirtualItem($item['item_id'], $item['item_num']);
|
$this->_decVirtualItem($item['item_id'], $item['item_num']);
|
||||||
} else {
|
} else {
|
||||||
|
@ -116,6 +116,35 @@ class LogService extends BaseService
|
|||||||
TGLog::writeToLog(self::PRONAME,self::GAMEID,$logInfo);
|
TGLog::writeToLog(self::PRONAME,self::GAMEID,$logInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function consumeItem($event,$param = [])
|
||||||
|
{
|
||||||
|
$logInfo = self::ItemRecord();
|
||||||
|
$data = self::userInfo();
|
||||||
|
$data['type'] = self::CONSUME_TYPE;
|
||||||
|
// $data['event_name'] = $event['name'];
|
||||||
|
// $data['event_type'] = self::GOLD_TYPE;
|
||||||
|
$data['item_id'] = $event['item_id'];
|
||||||
|
$data['item_num'] = $event['item_num'];
|
||||||
|
|
||||||
|
$logInfo['properties'] = array_merge($data,$param);
|
||||||
|
|
||||||
|
TGLog::writeToLog(self::PRONAME,self::GAMEID,$logInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function productItem($event,$param = [])
|
||||||
|
{
|
||||||
|
$logInfo = self::ItemRecord();
|
||||||
|
$data = self::userInfo();
|
||||||
|
$data['type'] = self::PRODUCT_TYPE;
|
||||||
|
// $data['event_name'] = $event['name'];
|
||||||
|
// $data['event_type'] = self::GOLD_TYPE;
|
||||||
|
$data['item_id'] = $event['item_id'];
|
||||||
|
$data['item_num'] = $event['item_num'];
|
||||||
|
|
||||||
|
$logInfo['properties'] = array_merge($data,$param);
|
||||||
|
TGLog::writeToLog(self::PRONAME,self::GAMEID,$logInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private static function userInfo()
|
private static function userInfo()
|
||||||
{
|
{
|
||||||
@ -188,4 +217,18 @@ class LogService extends BaseService
|
|||||||
];
|
];
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static function ItemRecord(){
|
||||||
|
$data = [
|
||||||
|
"#account_id" => myself()->_getAccountId(),
|
||||||
|
"#event_name"=> "item_record",
|
||||||
|
"#ip"=> $_SERVER['REMOTE_ADDR'],
|
||||||
|
"#controller"=> getReqVal('c', ''),
|
||||||
|
"#artion"=> getReqVal('a', ''),
|
||||||
|
"#time"=> myself()->_getNowTime(),
|
||||||
|
"#type"=> "track",
|
||||||
|
"properties"=>''
|
||||||
|
];
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user