1
This commit is contained in:
parent
36332c336f
commit
0199a168fc
@ -577,4 +577,9 @@ class ToolsController extends BaseController {
|
||||
var_dump(NameService::nameUsed($name));
|
||||
}
|
||||
|
||||
public function genAndroidData()
|
||||
{
|
||||
myself()->_callServiceStatic('CircuitRankingService', 'genAndroidData');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2,6 +2,11 @@
|
||||
|
||||
namespace services;
|
||||
|
||||
require_once('mt/CircuitTime.php');
|
||||
|
||||
use mt;
|
||||
use phpcommon\SqlHelper;
|
||||
|
||||
class CircuitRankingService extends BaseService {
|
||||
|
||||
public static function fillPhaseRanking($currentCircuitMeta, $currentStageMeta)
|
||||
@ -69,4 +74,38 @@ class CircuitRankingService extends BaseService {
|
||||
}
|
||||
}
|
||||
|
||||
public static function genAndroidData()
|
||||
{
|
||||
$currentStageMeta = mt\CircuitTime::getCurrentStage();
|
||||
if (empty($currentStageMeta)) {
|
||||
myself()->_rspErr(1, 'currentStageMeta Is empty');
|
||||
return;
|
||||
}
|
||||
$rows = SqlHelper::ormSelect
|
||||
(myself()->_getMysql(''),
|
||||
't_android',
|
||||
array(
|
||||
'used' => 0
|
||||
)
|
||||
);
|
||||
foreach ($rows as $row) {
|
||||
SqlHelper::upsert
|
||||
(myself()->_getMysql(''),
|
||||
't_circuit_battle_phase',
|
||||
array(
|
||||
'account_id' => $row['robot_id'],
|
||||
),
|
||||
array(),
|
||||
array(
|
||||
'account_id' => $row['robot_id'],
|
||||
'is_android' => 1,
|
||||
'cumulative_score' => 10,
|
||||
'createtime' => myself()->_getNowTime(),
|
||||
'modifytime' => myself()->_getNowTime(),
|
||||
)
|
||||
);
|
||||
}
|
||||
myself()->_rspOk();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user