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(); } }