You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
595 B
PHTML

5 years ago
<?php
namespace Base\Service;
use Base\Model\PromoteModel;
use Base\Model\ApplyModel;
class ApplyService {
private $model;
public function __construct()
{
$this->model = new ApplyModel();
}
public function cancelGame($gameId, $promoteId) {
$ids = [$promoteId];
$list = M('promote', 'tab_')->field('id')->where('parent_id=' . $promoteId . ' or grand_id=' . $promoteId)->select();
$ids = array_merge($ids, array_column($list, 'id'));
M('apply', 'tab_')->where(['game_id' => $gameId, 'promote_id' => ['in', $ids]])->delete();
}
}