1
This commit is contained in:
parent
bda153a656
commit
19637fd825
@ -167,6 +167,32 @@ class BigwheelController extends BaseAuthedController {
|
||||
myself()->_rspErr(1, 'server internal error');
|
||||
return;
|
||||
}
|
||||
$drop1 = myself()->_callServiceStatic('LootService', 'dropOutItem', $item1['meta']['content_loot']);
|
||||
$drop2 = myself()->_callServiceStatic('LootService', 'dropOutItem', $item2['meta']['content_loot']);
|
||||
error_log(json_encode(array(
|
||||
'drop1' => $drop1,
|
||||
'drop2' => $drop2,
|
||||
)));
|
||||
++$data['drawed_times'];
|
||||
$grid1 = array(
|
||||
'grid_id' => $item1['meta']['id'],
|
||||
'grid_state' => 2,
|
||||
'item_id' => $drop1[0]['item_id'],
|
||||
'item_num' => $drop1[0]['item_num'],
|
||||
'buy_price' => 0,
|
||||
'draw_times' => $data['drawed_times'],
|
||||
);
|
||||
$grid2 = array(
|
||||
'grid_id' => $item2['meta']['id'],
|
||||
'grid_state' => 2,
|
||||
'item_id' => $drop2[0]['item_id'],
|
||||
'item_num' => $drop2[0]['item_num'],
|
||||
'buy_price' => 0,
|
||||
'draw_times' => $data['drawed_times'],
|
||||
);
|
||||
array_push($data['grid_list'], $grid1);
|
||||
array_push($data['grid_list'], $grid2);
|
||||
myself()->_callModelStatic('MidData', 'setData', $key, json_encode($data));
|
||||
}
|
||||
|
||||
public function buyS()
|
||||
@ -183,9 +209,6 @@ class BigwheelController extends BaseAuthedController {
|
||||
private function getAndCreateData($key)
|
||||
{
|
||||
$data = myself()->_callModelStatic('MidData', 'getData', $key);
|
||||
if (!empty($data)) {
|
||||
$data = json_decode($data, true);
|
||||
}
|
||||
if (empty($data)) {
|
||||
$data = array(
|
||||
'drawed_times' => 0,
|
||||
@ -236,7 +259,7 @@ class BigwheelController extends BaseAuthedController {
|
||||
private function getGridRefByGridId(&$data, $gridId, &$gridRefOut)
|
||||
{
|
||||
foreach ($data['grid_list'] as &$grid) {
|
||||
if ($grid['grid_id'] == $girdId) {
|
||||
if ($grid['grid_id'] == $gridId) {
|
||||
$gridRefOut = $grid;
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user